当前位置:网站首页>FFmpeg多媒体文件处理(ffmpeg打印音视频Meta信息)
FFmpeg多媒体文件处理(ffmpeg打印音视频Meta信息)
2022-08-09 12:44:00 【一叶知秋@qqy】
打印音/视频信息
- avdevice_register_all()
- avformat_open_input()/avformat_close_input
- av_dump_format()
实战
int main(int argc, const char * argv[]) {
int ret = 0;
AVFormatContext *fmt_ctx = NULL; //创建AVFormatContext格式上下文指针
av_log_set_level(AV_LOG_INFO); //设置日志打印级别
avdevice_register_all(); //注册所有的设备
ret = avformat_open_input(&fmt_ctx, "./test.mp4", NULL, NULL); //第三个参数是输入文件的格式,NULL则会根据文件后缀名自行选择,如果文件后缀名不是mp4,但是里面是mp4数据格式,这个时候第三个参数要指定为mp4,第四个参数是从命令行传一些参数进来,一般设置为NULL就可以
if(ret < 0){
av_log(NULL, AV_LOG_ERROR, "Can't open file:%s\n", av_err2str(ret));
}
av_dump_format(fmt_ctx, 0, "./童话镇.flac", 0); //第2个参数是流的索引值,直接填0就可以,应该是代表取第一路视频流,第四个参数指是输入流还是输出流,这里是向ffmpeg输入文件所以使用0,如果是ffmpeg向外输出文件就要是1
avformat_close_input(&fmt_ctx);
return 0;
}
边栏推荐
- 联通网管协议框图
- Intranet penetration tool ngrok usage tutorial
- AQS Synchronization Component - FutureTask Analysis and Use Cases
- Flutter Getting Started and Advanced Tour (7) GestureDetector
- Use RecyclerView to implement three-level collapsed list
- read stream 特别注意
- 5G China unicom AP:B SMS ASCII 转码要求
- FPGA-近日工作总结
- 5G China unicom AP:B SMS ASCII Transcoding Requirements
- 【FPGA教程案例48】图像案例8——基于FPGA的RGB图像转化为HSV图像的实现,通过MATLAB进行辅助验证
猜你喜欢
How to save Simulink simulation model as image or PDF
K个结点的组内逆序调整
Compensation transaction and idempotency guarantee based on CAP components
联通网管协议框图
安踏携手华为运动健康共同验证冠军跑鞋 创新引领中国体育
ABAP interview questions: how to use the System CALL interface of the ABAP programming language, direct execution ABAP server operating System's shell command?
Flutter introduction advanced trip (5) Image Widget
The batch size does not have to be a power of 2!The latest conclusions of senior ML scholars
MySQL principle and optimization of Group By optimization techniques
注:检测到当前使用的ADB不是HBuilder内置或自定义ADB:PID为:9544进程名称为:adb.exe 路径为:c:\users\administrator\appdata\local\and
随机推荐
FPGA中串口通信的时钟频率和波特率计数
腾讯发布第二代四足机器人Max,梅花桩上完成跳跃、空翻
Flutter Getting Started and Advanced Tour (7) GestureDetector
时间序列分析课程实验报告
中断系统结构及中断控制详解
1-hour live broadcast recruitment order: industry big names share dry goods, and enterprise registration opens丨qubit·viewpoint
5G China unicom general exception handling
手写大根堆
AI basketball referee, walking is special, ask harden care don't care
十六进制字符→十进制数字
使用RecyclerView实现三级折叠列表
telnet+ftp 对设备进行 操控 和 升级
Intra-group reverse order adjustment of K nodes
安踏携手华为运动健康共同验证冠军跑鞋 创新引领中国体育
使用注解将EventBus封装抽取到基类
FPGA-在ISE中错误总结(更新中)
JVM之配置介绍(一)
Dry+Bean+Dataset R语言数据分析,报告英文
卷积神经网络表征可视化研究综述(1)
R语言kaggle 游戏数据探索与可视化