中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

ps模板下載網(wǎng)站新網(wǎng)站秒收錄技術(shù)

ps模板下載網(wǎng)站,新網(wǎng)站秒收錄技術(shù),網(wǎng)頁游戲制作軟件,網(wǎng)站建設(shè)與管理的通知目錄 FFmpeg日志系統(tǒng) FFmpeg文件與目錄操作 FFmpeg文件的刪除與重命名 FFmpeg操作目錄及l(fā)ist的實現(xiàn) 操作目錄重要函數(shù) 操作目錄重要結(jié)構(gòu)體 FFmpeg日志系統(tǒng) 下面看一個簡單的 demo。 #include <stdio.h> #include <libavutil/log.h>int main(int argc,char* …

目錄

FFmpeg日志系統(tǒng)

FFmpeg文件與目錄操作

FFmpeg文件的刪除與重命名

FFmpeg操作目錄及l(fā)ist的實現(xiàn)

操作目錄重要函數(shù)

操作目錄重要結(jié)構(gòu)體


FFmpeg日志系統(tǒng)

下面看一個簡單的 demo。

#include <stdio.h>
#include <libavutil/log.h>int main(int argc,char* argv[])
{av_log_set_level(AV_LOG_DEBUG);av_log(NULL,AV_LOG_INFO,"Hello World!,%s\n","aaa");return 0;
}

編譯運行,結(jié)果如下:

wj@ubuntu:~/FFmpeg$ gcc -g -o ffmpeg_log ffmpeg_log.c -lavutil
wj@ubuntu:~/FFmpeg$ ./ffmpeg_log 
Hello World!,aaa

FFmpeg文件與目錄操作

FFmpeg文件的刪除與重命名

  1. 文件刪除函數(shù):avpriv_io_delete()
  2. 文件重命名:avpriv_io_move()

來看一個 demo

#include <stdio.h>
#include <libavformat/avformat.h>int main(int argc,char* argv[])
{int ret = 0;ret = avpriv_io_move("111.txt","222.txt");if(ret < 0){av_log(NULL,AV_LOG_ERROR,"Failed to rename\n");}av_log(NULL,AV_LOG_INFO,"Success to rename\n");//delete urlret = avpriv_io_delete("./mytestfile.txt");if(ret<0){av_log(NULL,AV_LOG_ERROR,"Failed to delete file mytestfile.txt\n");return -1;}av_log(NULL,"Success to delete mytestfile.txt");return 0;
}

sudo apt-get install libavformat-dev

wj@ubuntu:~/FFmpeg$ gcc -g -o ffmpeg_del ffmpeg_file.c -lavformat -lavutil
ffmpeg_file.c: In function ‘main’:
ffmpeg_file.c:8:11: warning: implicit declaration of function ‘a(chǎn)vpriv_io_move’ [-Wimplicit-function-declaration]8 |     ret = avpriv_io_move("111.txt","222.txt");|           ^~~~~~~~~~~~~~
ffmpeg_file.c:18:11: warning: implicit declaration of function ‘a(chǎn)vpriv_io_delete’ [-Wimplicit-function-declaration]18 |     ret = avpriv_io_delete("./mytestfile.txt");|           ^~~~~~~~~~~~~~~~
wj@ubuntu:~/FFmpeg$ ./ffmpeg_del 
Success to rename
Failed to delete file mytestfile.txt

FFmpeg操作目錄及l(fā)ist的實現(xiàn)

操作目錄重要函數(shù)

  1. avio_open_dir()
  2. avio_read_dir()
  3. avio_close_dir()

操作目錄重要結(jié)構(gòu)體

  1. AVIODirContext? ? ?操作目錄的上下文
  2. AVIODirEntry? ? ? ? ?目錄項。用于存放文件名,文件大小等信息。

實戰(zhàn):實現(xiàn)一個簡單的 ls 命令

#include <stdio.h>
#include <libavformat/avformat.h>int main(int argc,char* argv[])
{int ret = 0;AVIODirContext* ctx = NULL;AVIODirEntry* entry=NULL;av_log_set_level(AV_LOG_INFO);ret = avio_open_dir(&ctx,"./",NULL);if(ret < 0){av_log(NULL,AV_LOG_ERROR,"Can not open dir:%s\n",av_err2str(ret));return -1;}while(1){ret = avio_read_dir(ctx,&entry);if(ret < 0){av_log(NULL,AV_LOG_ERROR,"can not dir:%s\n",av_err2str(ret));//return -1;goto __fail; //avoid memleak}if(!entry){break;}av_log(NULL,AV_LOG_INFO,"%12"PRId64" %s \n",entry->size,entry->name);avio_free_directory_entry(&entry);}__fail:avio_close_dir(&ctx);return 0;
}

編譯運行,如下所示:

wj@ubuntu:~/FFmpeg$ gcc -g -o ffmpeg_ls ffmpeg_ls.c -lavformat -lavutil
wj@ubuntu:~/FFmpeg$ ./ffmpeg_ls 190 ffmpeg_log.c 127296 ffmpeg_log 0 222.txt 579 ffmpeg_file.c 4096 .vscode 848 ffmpeg_ls.c 20800 ffmpeg_ls 19776 ffmpeg_del 

http://www.risenshineclean.com/news/23098.html

相關(guān)文章:

  • 網(wǎng)站建設(shè)的主要職責(zé)免費網(wǎng)站免費
  • 建網(wǎng)站wordpress女生學(xué)網(wǎng)絡(luò)營銷這個專業(yè)好嗎
  • 國家攝影網(wǎng)站百度發(fā)布信息怎么弄
  • 讓別人做網(wǎng)站需要提供什么長沙網(wǎng)絡(luò)公關(guān)公司
  • 營銷型網(wǎng)站有哪些特點外貿(mào)網(wǎng)站建設(shè) google
  • 網(wǎng)站做數(shù)據(jù)監(jiān)測寧波網(wǎng)站推廣排名
  • 校園網(wǎng)站設(shè)計外貿(mào)接單十大網(wǎng)站
  • 嗶哩網(wǎng)站開發(fā)需求分析模板網(wǎng)上推廣
  • 創(chuàng)業(yè)做招聘網(wǎng)站靠譜嗎seo研究協(xié)會網(wǎng)app
  • 網(wǎng)上招聘網(wǎng)站開發(fā)報告中國企業(yè)網(wǎng)
  • 幫忙做公司網(wǎng)站seo專員簡歷
  • 仿新浪微博網(wǎng)站代碼推廣資源網(wǎng)
  • 怎么做祝福網(wǎng)站新手怎么做網(wǎng)絡(luò)推廣
  • PHP做網(wǎng)站案例教程軟文代寫文案
  • 賀州網(wǎng)站建設(shè)品牌推廣活動方案
  • 做外國網(wǎng)用哪些網(wǎng)站小廣告網(wǎng)頁
  • dede 企業(yè)網(wǎng)站模板下載如何優(yōu)化
  • 如何ps做網(wǎng)站首頁寧波seo優(yōu)化項目
  • ios網(wǎng)站開發(fā)工具有哪些怎么做網(wǎng)址
  • 做網(wǎng)站有哪些注意事項百度關(guān)鍵詞在線優(yōu)化
  • dw做網(wǎng)站怎么用到j(luò)ava友情鏈接網(wǎng)站
  • 鄭州餐飲 網(wǎng)站建設(shè)小視頻關(guān)鍵詞匯總
  • 東莞桂城網(wǎng)站建設(shè)外貿(mào)網(wǎng)站推廣服務(wù)
  • 網(wǎng)站建設(shè)成都時事新聞熱點
  • 開發(fā)網(wǎng)站公司收入瀏覽器廣告投放
  • 微商城小程序哪個好青島建站seo公司
  • 暗網(wǎng)做網(wǎng)站2023能用的磁力搜索引擎
  • b2b網(wǎng)站制作上海aso蘋果關(guān)鍵詞優(yōu)化
  • 龍南網(wǎng)站建設(shè)怎么做網(wǎng)絡(luò)營銷
  • 三明seo怎么優(yōu)化關(guān)鍵詞