[x264-devel] Dynamic setting of ratecontrol parameters (bitrate, fps)

Mojtaba Hosseini Mojtaba.Hosseini at magorcorp.com
Thu Jan 31 17:12:49 CET 2008


Hello,
 Just an update on this issue from my end:
1-Having briefly looked through the code, changing rate control parameters (bitrate and fps) dynamically with multiple threads
seems to be quite complicated. So I opted to see how bad it would be to do encoder_open() and encoder_close() every time a 
change in bitrate/fps is needed. 

2-I found that the processing cost of calling encoder_close() and encoder_open() is *relatively* minimal. I write "relatively"
because this is done every few seconds and not every frame. This method, although inelegant, serves my purpose (bit rate
control of encoding in response to network conditions). According to my measurements, it takes less than 1ms to do a close()
followed by open(). 

3-However, as has already been reported multiple times:

http://mailman.videolan.org/pipermail/x264-devel/2007-November/003832.html

http://mailman.videolan.org/pipermail/x264-devel/2007-October/003656.html

encoder_open() and encoder_close() produce a large memory leak (frames are not always deleted). This caused considerable
problems for 1920x1080 frame encoding. Luckily, the patch here

http://mailman.videolan.org/pipermail/x264-devel/2007-October/003657.html

fixes the problem with thread=1 at least. 

Any comment on when the proper fix for the memory leak will be make it in?

Anne, could you keep us updated on your progress as well?

Thanks.

Mojtaba Hosseini




-----Original Message-----
From: x264-devel-bounces at videolan.org on behalf of Anne Aaron
Sent: Tue 1/22/2008 2:34 PM
To: Mailing list for x264 developers
Subject: Re: [x264-devel] Dynamic setting of ratecontrol parameters (bitrate, fps)
 
I am also interested in dynamically changing the rate control parameters (bitrate and fps) for CBR rate control with a VBV.

For varying fps (constant bitrate and VBV size), as an intermediate patch, I do the following --
I keep track of the average fps given a time window, and for every new frame I update rc->fps, and recalculate rc->buffer_rate and rc->cbr_decay.

When I run in single thread mode the resulting bitstream seems close enough to CBR. But I am not yet familiar with all the aspects of the x264 rate control so I am not sure whether there's an issue with this. Does anyone see a problem with doing this? If these reconfigurations are ok, could we integrate it and possibly other dynamic rate control changes in x264_encoder_reconfig()? I am looking into dynamically changing the bitrate next.


Anne

-----Original Message-----
From: x264-devel-bounces at videolan.org [mailto:x264-devel-bounces at videolan.org] On Behalf Of Mojtaba Hosseini
Sent: Monday, January 21, 2008 7:13 AM
To: Mailing list for x264 developers
Subject: [x264-devel] Dynamic setting of ratecontrol parameters (bitrate, fps)

Hello,
 I'm interested in changing the average output bitrate of the encoder *dynamically* (in the middle of encoding). From a 2005 post,

http://mailman.videolan.org/pipermail/x264-devel/2005-November/001251.html

Loren states that "There is no way to reinitialize ratecontrol in the middle of an encode".
Looking at the current code, this is still the case with x264_encoder_open() initializing all ratecontrol parameters that are not really changeable from then on.
My questions are:
Is there any interest in the community for the feature of dynamically changing ratecontrol parameters (such as bitrate, qp, etc)? Can anyone suggest an elegant approach? (other than
encoder_open() and close() for every change in ratecontrol!).
Any help or suggestion is appreciated.

Mojtaba Hosseini

_______________________________________________
x264-devel mailing list
x264-devel at videolan.org
http://mailman.videolan.org/listinfo/x264-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 5094 bytes
Desc: not available
Url : http://mailman.videolan.org/pipermail/x264-devel/attachments/20080131/1a1b95b8/attachment.bin 


More information about the x264-devel mailing list