FFmpeg av_guess_format返回NULL [英] FFmpeg av_guess_format returns NULL
问题描述
我正在以下示例代码: http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/output-example_8c-source.html
I'm following the example code here: http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/output-example_8c-source.html
我的代码如下:
fmt = av_guess_format(NULL, filename, NULL);
if (!fmt) {
LOGE(1,"Could not deduce output format from file extension: using MPEG.\n");
fmt = av_guess_format("mp4", NULL, NULL);
}
if (!fmt) {
LOGE(1, "Could not find suitable output format\n");
exit(1);
}
我称之为av_guess_format的两次,它都是返回NULL两次。
我预先调用av_register_all()和avcodec_register_all()。
The two times that I call av_guess_format, it is returning NULL both times. I am calling both av_register_all() and avcodec_register_all() beforehand.
有什么想法为什么这会返回NULL?
Any ideas as to why this is returning NULL?
提前感谢
推荐答案
av_guess_format返回NULL,因为我没有正确配置FFMPEG以允许对于任何格式。
av_guess_format was returning NULL because I hadn't properly configured FFMPEG to allow for ANY formats.
我重新配置了FFMPEG以允许mp4和其他,现在它的作品
I re-configured FFMPEG to allow mp4 and others, and now it works
这篇关于FFmpeg av_guess_format返回NULL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!