最简单的基于FFMPEG的转码程序 open_output_file函数报错“Cannot open video encoder for stream ...”

雷神的https://blog.csdn.net/leixiaohua1020/article/details/26838535

文章后附的代码,报错:Cannot open video encoder for stream blabla...

需要修改一下,解决方法来自,烛龙一现,https://blog.csdn.net/w_z_z_1991/article/details/53002416

transcoding.c中的open_output_file函数中,修改的部分如下(只增加了13-17行):

if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) {
                enc_ctx->height = dec_ctx->height;
                enc_ctx->width = dec_ctx->width;
                enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio;
                /* take first format from list of supported formats */
                if (encoder->pix_fmts)
                    enc_

你可能感兴趣的:(最简单的基于FFMPEG的转码程序 open_output_file函数报错“Cannot open video encoder for stream ...”)