[Ffmpeg-devel] changing encoding bitrate dynamically

Martin Prangl martin.prangl
Tue May 30 15:47:00 CEST 2006


I have a question. I am trying to change the bit rate of a video stream during the encoding process.
So i inserted in the big for loop of the av_encode function of ffmpeg.c :

for (i=0;i<nb_ostreams;i++) {
if(ost->st->codec->codec_type == CODEC_TYPE_VIDEO)

    opts = ost->sync_opts * av_q2d(ost->st->codec->time_base);
    /* new code begins here */
    ost->st->codec->bit_rate = ost->st->codec->bit_rate -10;
    ost->st->codec->rc_min_rate = ost->st->codec->rc_min_rate-10;
    ost->st->codec->rc_max_rate = ost->st->codec->rc_max_rate-10;
    /* new code ends here */

But these statements have no effect. Why?

Thank you, 
kind regards, 

More information about the ffmpeg-devel mailing list