[x264-devel] On the fly bit rate change

Jason Garrett-Glaser darkshikari at gmail.com
Tue Jan 20 18:10:59 CET 2009


On Tue, Jan 20, 2009 at 12:01 PM, P O'Hanlon <p.ohanlon at gmail.com> wrote:
> Hi,
>
> We've been using x264 for video encoding in a network video
> application for a while but so far I can only get 264 to set the
> initial bit rate (rc.i_bitrate) from x264_encoder_open(). We would
> like to be able to alter the video rate during a session but it isn't
> clear how to do this without having to reinitialise the codec (which I
> imagine would lose us a number of frames?)

You wouldn't lose any frames--all you have to do is flush the encoder
as if you were proceeding to close it, and then re-initialize it.

> I have noticed the x264_encoder_reconfig() function but this does not
> appear to allow for a change in the bit rate directly - I guess one
> can alter other settings here that will have an effect on the bit rate
> but I wondered if it was possible to alter the target bit rate for the
> ratecontrol system on the fly? Or some insight as to how one might go
> about adding such a feature - which I imagine a few real-time video
> streaming/conferencing apps would be interested in having control
> over.

Allowing reinitialization of ratecontrol without reinitializing the
encoder as a whole would be tricky and would require an API change,
but it would definitely be possible.

Dark Shikari


More information about the x264-devel mailing list