View Full Version : Settings change on the fly with x264_encoder_reconfig
koliva
1st August 2013, 09:39
Hi,
I have been searching in the internet but could find a sort of "freedom" list that we can change in x264 encoder on the fly without restarting the encoder.
I am currently using VBV parameters to limit the output bandwidth and I am in a situation that I need to restrict it further down in some cases on the fly. I know that I can't change the VBV parameters on the fly but can I change the resolution, can I change the QP and so on...
Thanks.
Dark Shikari
1st August 2013, 14:34
VBV parameters can be changed on the fly -- resolution cannot. The full list is in the source code; unfortunately, any English explanation would be no simpler than the source, which is just a list of parameters copied.
koliva
1st August 2013, 16:20
VBV parameters can be changed on the fly -- resolution cannot. The full list is in the source code; unfortunately, any English explanation would be no simpler than the source, which is just a list of parameters copied.
I see the code in encoder.c. It's so nice to hear that I can change VBV parameters on the fly.
My input frames are full frames without any interlacing. Do you think that I can simply have interlaced encoded frames if I play with fake-interlaced parameter? I am just trying to find out possible ways of reducing the bandwidth usage without effecting much on the quality side. Do you think that interlacing is a good option to choose?
Dark Shikari
1st August 2013, 16:22
Fake-interlaced is a hack designed to allow progressive content in formats that don't support it. If you don't have such a use-case, you shouldn't be using it. Interlacing makes compression worse, not better.
koliva
1st August 2013, 16:26
Fake-interlaced is a hack designed to allow progressive content in formats that don't support it. If you don't have such a use-case, you shouldn't be using it. Interlacing makes compression worse, not better.
So what I understand from you is that if I want lower output bitrate I should lower the VBV parameters down. Don't touch anything else :cool:
BTW: I am using ultrafast preset and zerolatency tune.
sneaker_ger
1st August 2013, 17:26
Do you really need zerolatency? Many people think they do because they do "live streaming" but do not actually require it.
koliva
2nd August 2013, 07:56
Do you really need zerolatency? Many people think they do because they do "live streaming" but do not actually require it.
Well, it is live streaming. So it should be as fast as possible or the latency should be lower than XXX ms.
I think what you are going to suggest is to use slower preset to have more efficient (loewr bitrate) encoding. Right? But this is not possible with x264_encoder_reconfig().
sneaker_ger
2nd August 2013, 12:49
Well, it is live streaming.
"Live streaming" does not necessarily require zero latency. If you are for example watching a live sport event on TV the signal can be several seconds behind the actual game, but is it a problem? No. Low latency is only really needed for tasks with interactions like video conferencing, maybe remote controlling a robot etc. where you interact with the source of the video in some way and have to react as quickly as possible to what the other side does. Even if you want it low for some reason think about whether it really has to be zero or not.
I think what you are going to suggest is to use slower preset to have more efficient (loewr bitrate) encoding. Right?
That, too, of course. Now I don't know what kind of machine you are using, but even first generation Core i7s do almost 200fps for 1080p content on ultrafast, so that's a lot of cpu power not put into use if you do real-time encoding.
But this is not possible with x264_encoder_reconfig().
I think it should be possible to reconfigure many of the important options of a preset (which are just collections of individual parameters) but you may have to make sure that you don't start the encode with too harsh limits (for example 0 bframes) to leave room for switching.
koliva
6th August 2013, 09:56
...
I think it should be possible to reconfigure many of the important options of a preset (which are just collections of individual parameters) but you may have to make sure that you don't start the encode with too harsh limits (for example 0 bframes) to leave room for switching.
I have been playing with the reconfigurable settings for some time. As Dark Shikari mentioned, I am able to change the VBV parameters on the fly, which is very good. However, if I set the VBV parameters to 1 Mbps while I am encoding at 10Mbps, naturally I see a lot of deterioration on the decoded frames. I thought of playing with resolution or switching it to a different preset but they both not possible. As far as I understood from the x264_encoder_reconfig code, the only "useful" parameter that is changeable on the fly is the VBV parameter. The rest can not be changed without any proper restart.
Dark Shikari
6th August 2013, 21:08
You can change most settings associated with a preset on a reconfig(); there's dozens of parameters that can be changed. Only a few important ones can't be.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.