2

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

有任何想法吗?

4

1 回答 1

1

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

     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);
于 2012-04-10T10:16:04.430 回答