繁体   English   中英

FFMPEG:视频比特率的动态变化

[英]FFMPEG: Dynamic change of bit_rate for Video

我在我的 C++ 应用程序中使用 ffmpeg 代码,并想在那里控制 VIDEO 的 bit_rate 参数。 我试图在工作中更改它的值(通过 ost->st->codec->codec->bit_rate),但 ffmpeg 不想更改它。 也许有人知道怎么做?

有任何想法吗?

我试过这样,它对我有用。

     avcodec_init();

     avcodec_register_all();

     codec = avcodec_find_encoder(CODEC_ID_H263);

     c = avcodec_alloc_context();

     picture= avcodec_alloc_frame();

        c->bit_rate = bitrate;
        c->width = w;
        c->height = h;
        c->time_base= (AVRational){1,framerate};
        c->pix_fmt = PIX_FMT_YUV420P;

avcodec_close(c);

av_free(c);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM