[英]FFMPEG: Dynamic change of bit_rate for Video
I use ffmpeg codes in my C++ app and would like to control the bit_rate parameter for VIDEO there.我在我的 C++ 应用程序中使用 ffmpeg 代码,并想在那里控制 VIDEO 的 bit_rate 参数。 I tried to change its value in work (via ost->st->codec->codec->bit_rate), but ffmpeg did not wish to change it.我试图在工作中更改它的值(通过 ost->st->codec->codec->bit_rate),但 ffmpeg 不想更改它。 Perhaps anybody knows how to make it?也许有人知道怎么做?
Any ideas?有任何想法吗?
I have tried like this and its working for me.我试过这样,它对我有用。
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.