雷神的https://blog.youkuaiyun.com/leixiaohua1020/article/details/26838535
文章后附的代码,报错:Cannot open video encoder for stream blabla...
需要修改一下,解决方法来自,烛龙一现,https://blog.youkuaiyun.com/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_ctx->pix_fmt = encoder->pix_fmts[0];

在尝试使用FFMPEG进行视频转码时遇到'Cannot open video encoder for stream'的问题。解决方案来源于烛龙一现的博客,需要在open_output_file函数中增加一行代码:enc_ctx->qmax = 51;调整该值可以改善转码后的视频质量。
最低0.47元/天 解锁文章
1049

被折叠的 条评论
为什么被折叠?



