本文介绍了FFMPEG:视频的bit_rate的动态变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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);


I use ffmpeg codes in my C++ app and would like to control the bit_rate parameter for VIDEO there. I tried to change its value in work (via ost->st->codec->codec->bit_rate), but ffmpeg did not wish to change it.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);

这篇关于FFMPEG:视频的bit_rate的动态变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 23:26