[x264-devel] Is it possible to dynamically change the quality mode using libx264

declan harrison harrison.declan at googlemail.com
Sat Oct 31 14:11:04 CET 2009


Hi Jason

Thanks for pointing me in the right direction on this issue.

I have made a few changes that mean that I always ensure that when in
re-init the encoder that the b_repeat_headers is set to "1".  This change
has meant that I have been able to change the quality dynamically which is
what I needed.

Much appreciate your help in this matter.

Thanks
Declan

On Mon, Oct 26, 2009 at 10:47 PM, Jason Garrett-Glaser <
darkshikari at gmail.com> wrote:

> On Mon, Oct 26, 2009 at 3:42 PM, declan harrison
> <harrison.declan at googlemail.com> wrote:
> >
> >
> > On Mon, Oct 26, 2009 at 7:26 PM, Jason Garrett-Glaser
> > <darkshikari at gmail.com> wrote:
> >>
> >> On Mon, Oct 26, 2009 at 12:22 PM, declan harrison
> >> <harrison.declan at googlemail.com> wrote:
> >> >
> >> >
> >> > On Mon, Oct 26, 2009 at 7:02 PM, Jason Garrett-Glaser
> >> > <darkshikari at gmail.com> wrote:
> >> >>
> >> >> On Mon, Oct 26, 2009 at 11:12 AM, declan harrison
> >> >> <harrison.declan at googlemail.com> wrote:
> >> >> > Hi
> >> >> >
> >> >> > Im using x264 with ffmpeg to encode videos on the fly (realtime
> with
> >> >> > minimum
> >> >> > buffering) in a proxy.  So I am working on a HTTP stream and
> >> >> > therefore 1
> >> >> > pass encoding is the only option available to me.
> >> >> >
> >> >> > My use case is that after encoding the video for say 10 seconds
> with
> >> >> > a
> >> >> > "--crf" value of 22 another network element informs me that I need
> to
> >> >> > increase/decrease the quality of the video stream being sent to the
> >> >> > client.
> >> >> > I then would like to change the effective "crf" value that I am
> >> >> > currently
> >> >> > encoding the video stream.
> >> >>
> >> >> For streaming you need to set a maxrate and bufsize so that you don't
> >> >> exceed the bounds of your connection.  If you want absolutely no
> >> >> buffer whatsoever, i.e. zero-latency, you need to set bufsize =
> >> >> (maxrate / framerate).
> >> >>
> >> >> x264 currently does not support reconfiguring ratecontrol in
> realtime,
> >> >> but you can re-init the encoder if you want.
> >> >>
> >> >>
> >> > Hi Jason
> >> >
> >> > So re-init the encoder will this cause many issues for the client or
> do
> >> > you
> >> > think that it will pass without much interference?
> >>
> >> No issues for the client; the primary issue is that of tracking the
> >> VBV buffer fullness so that you can init the encoder with the correct
> >> initial occupancy for the VBV.
> >
> > so if I re-init  the encoder will this ensure that all the meta data will
> > reflect the new video stream. Im thinking about NAL parameter sets etc?
>
> Re-initting the encoder inherently starts the stream at an IDR frame,
> which will involve sending new SPS/PPS as long as b_repeat_headers is
> set.
>
> Dark Shikari
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> http://mailman.videolan.org/listinfo/x264-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x264-devel/attachments/20091031/e663c661/attachment.htm>


More information about the x264-devel mailing list