[Ffmpeg-devel] h263+: size of encoded frames after opening ffmpeg

Martin marthi
Wed Jan 17 11:14:40 CET 2007


Michael Niedermayer wrote:
> Hi
> On Mon, Jan 15, 2007 at 02:05:12PM +0100, Martin wrote:
>>I'm using ffmpeg to encode and decode h263+ video. While encoding, I
>>want to change the bitrate of the encoded stream. Therefore, I close
>>ffmpeg, change the bitrate in the codec context and reopen ffmpeg again.
>>I noticed that the first frame encoded is a key frame and the next 4
>>frames encoded after the first one are all no key frames. These 4 frames
>>are much bigger than other frames in the stream, that are no key frames.
>>Is it possible to stop ffmpeg from creating frames (that are not key
>>frames) with such a big size after opening?

> try AVCodecContext.rc_initial_cplx

I tried that. I'm not sure, but it seems to start with low quality at
the beginning and raises it to the "normal quality" specified. It takes
very long to get to "normal quality". Is there another parameter which I
can use to change the raise?

>>Even better, is there a
>>possibility to change the bitrate without closing and reopening ffmpeg?
> you can set the quality of frames which affects the bitrate,
> closing and reopening within the same stream is generally not allowed
> doing so means you are on your own

Ok, how can I set the quality within the same stream without closing and
reopening? I tried to set the AVCodecContext.crf parameter but it
doesn't seem to have any effect on quality and size of outputted frames.
Is there another parameter which I can use?

Thanks for helping!


More information about the ffmpeg-devel mailing list