[Ffmpeg-devel] avcodec_encode_video

Michael Niedermayer michaelni
Mon May 22 22:57:47 CEST 2006


On Mon, May 22, 2006 at 02:54:15PM +0000, Martin wrote:
> Hi, 
> i want to change the encoding bit rate during an ffmpeg-encoding process.
> I' ve seen that this parameters are in the AVCodecContext, nameley "bit_rate" 
> and "rc_max_rate".
> I have changed (decreased) this values in the big for loop of the "av_encode" 
> function (in "ffmpeg.c") in each iteration.
> The av_encode function calls the "avcodec_encode_video" function as consquence.
> In case of mpeg2 the video becomes waste, and in case of h264 there is no 
> effect.
> What i am doing wrong??

you cant change the ratecontrol parameters during encoding, the stuff isnt
designed for this, if it works its pure luck ...

either change ratecontrol.c or disable ratecontrol (CODEC_FLAG_QSCALE) and 
set the qp for each frame from the user app (AVFrame.quality)


In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is

More information about the ffmpeg-devel mailing list