[英]ffmpeg : Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[英]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.