網站首頁 編程語言 正文
新建文件ffmpeg_dir.c
#include<stdio.h>
#include<libavutil/avutil.h>
#include<libavformat/avformat.h>
int main(int argc,char* argv[]){
int ret;
av_register_all();
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));
goto __fail;
}
while(1){
ret = avio_read_dir(ctx,&entry);
if(ret<0){
av_log(NULL,AV_LOG_ERROR,"can not read dir:%s\n",av_err2str(ret));
goto __fail;
}
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;
}
編譯
[root@localhost c]# gcc -g -o ffmpeg_dir ffmpeg_dir.c `pkg-config --libs --cflags libavutil libavformat`
執行完成沒有報錯證明編譯成功
查看是否生成了可執行文件ffmpeg_dir
執行下面的命令,執行結果如下,表明程序執行成功
這里列出了我的上一級目錄的所有文件
原文鏈接:https://blog.csdn.net/chendongpu/article/details/123248134
相關推薦
- 2022-06-24 python中的__dict__屬性介紹_python
- 2022-03-27 centos7安裝mongo數據庫的方法(mongo4.2.8)_MongoDB
- 2022-09-25 什么是模板引擎(web)?常見的模板引擎有哪些?thymeleaf的常用指令介紹
- 2024-03-22 【IDEA】Spring boot項目設置網站圖標favicon不生效
- 2022-12-26 C++內存分區模型超詳細講解_C 語言
- 2022-01-10 egg作為后端接口,在前端調用
- 2022-04-14 Python實現注冊登錄功能_python
- 2022-11-26 React從插槽、路由、redux的詳細過程_React
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支