av_guess_格式h264在Android上返回空值
执行此代码:av_guess_格式h264在Android上返回空值,android,ffmpeg,h.264,Android,Ffmpeg,H.264,执行此代码: av_log_set_callback(_log_callback); av_register_all(); avcodec_register_all(); LOG(avcodec_configuration()); AVOutputFormat * fmt = av_guess_format( "h264", NULL, NULL ); 并在我的日志文件中显示下一个配置: --target-os=linux --disable-doc --disable-ffmpeg --d
av_log_set_callback(_log_callback);
av_register_all();
avcodec_register_all();
LOG(avcodec_configuration());
AVOutputFormat * fmt = av_guess_format( "h264", NULL, NULL );
并在我的日志文件中显示下一个配置:
--target-os=linux --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-avfilter --disable-everything --enable-libx264 --enable-encoder=libx264 --enable-decoder=h264 --enable-gpl ....
av_guess_格式
返回空值
有什么建议吗?
非常感谢尝试列出所有已注册的编解码器:
AVCodec * codec = NULL;
while(codec = av_codec_next(codec))
{
LOG(codec->name);
}
UPD
您可以为H264创建编码器:
AVCodec * avCodec = avcodec_find_encoder_by_name("h264");
AVCodecContext * avCodecCtx = avcodec_alloc_context3(avCodec);
// fill all required fields in avCodecCtx
AVDictionary * opt = NULL;
avcodec_open2(avCodecCtx, avCodec, &opt);
您没有任何格式,因为您指定了选项“禁用一切”尝试列出所有已注册的编解码器:
AVCodec * codec = NULL;
while(codec = av_codec_next(codec))
{
LOG(codec->name);
}
UPD
您可以为H264创建编码器:
AVCodec * avCodec = avcodec_find_encoder_by_name("h264");
AVCodecContext * avCodecCtx = avcodec_alloc_context3(avCodec);
// fill all required fields in avCodecCtx
AVDictionary * opt = NULL;
avcodec_open2(avCodecCtx, avCodec, &opt);
您没有任何格式,因为您指定了选项
--禁用所有内容h264、vp8、libvpx、libx264已列出。很抱歉,您似乎正在创建编码器。是否要为原始H264创建容器?我正在使用H264编码视频。在windows ffmpeg+h264上运行正常,然后我想在android上运行相同的应用程序。您已指定选项<代码>--禁用所有内容代码>。您没有注册格式,只指定了视频编解码器。我已经做了一个快速测试,没有--disable一切正常:)。但是libavcodec.a是巨大的+1为了看到标志,当我检查您的答案时,我将验证它;)已列出h264、vp8、libvpx、libx264。抱歉,我觉得您正在创建编码器。是否要为原始H264创建容器?我正在使用H264编码视频。在windows ffmpeg+h264上运行正常,然后我想在android上运行相同的应用程序。您已指定选项<代码>--禁用所有内容代码>。您没有注册格式,只指定了视频编解码器。我已经做了一个快速测试,没有--disable一切正常:)。但是libavcodec.a是巨大的+1为了看到标志,当我检查您的答案时,我将验证它;)