av_dump_format输出的信息不完整
来源:5-8 FFmpeg打印音视频Meta信息

慢慢向前
2024-04-16
下图是ffmpeg输出信息:
以下是av_dump_format打印信息
代码简单如下:
AVFormatContext *fmt_ctx = NULL;
//注册设备信息,新版可以不用调用
avdevice_register_all();
//打开文件
char *file = "/Users/akr/Desktop/天地龙鳞.mp3";
ret = avformat_open_input(&fmt_ctx, file, NULL, NULL);
if(ret < 0)
{
av_log(NULL, AV_LOG_ERROR, "Can't open file:%s error=%s", file, av_err2str(ret));
return;
}
//输出文件meta信息
av_dump_format(fmt_ctx, 0, file, 0);
//关闭上下文
avformat_close_input(&fmt_ctx);
写回答
1回答
-
李超
2024-04-16
不是信息不完整,是ffmpeg 从你的音频文件中只能拿到这些信息
022024-04-16
相似问题