Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th June 2009, 21:45   #1  |  Link
OvejaNegra
ekTOMBE STUDIOS
 
OvejaNegra's Avatar
 
Join Date: Dec 2005
Location: Cuba
Posts: 254
Information about the ratecontrol of x264

Some days ago i made this post: http://forum.doom9.org/showthread.php?t=147410

Ok, it was too much.


But i'm very interested in on this specific topic:

The ratecontrol.

If my info is correct, during 2pass encodes x264 adapts bit rate acording to the complexity of the scene. These changes are limited to avoid sudden bit rate peaks or very low bit rate parts. Usually the buffer controls that, and the buffer size is related to the chosen profile (or maybe to target some hardware device).


Now, what im trying to do (maybe this does not have any sense) is
allow x264 to use as high as possible bit rate for high motion scenes (to avoid blocks) and only the needed bit rate on the rest of the video to produce aceptable quality AND opposite.

No, i just made a mess.


Lower quantizers for high motion scenes (for better quality), producing medium quantizers for low motion scenes (like 18 - 22, but not 14-17). Simply take quality from the low motion scenes for the high motion scenes.

And
The opposite:

As low as possible quantizer for low motion scenes (14 -16) and quickly raise the quantizer on the high motion scenes to allow acceptable perceived quality with low bit rates (yes i know this will produce fluctuating quality but that's what i want). I have seen this behaviour on some real media encodes (nice looking low action scenes ,and suddendly blocky action scenes but the filesize is generally small).


If i'm not wrong, qcomp and cplxblur will help me with that, but i dont know how to use them (lower cplxblur and lower qcomp maybe?). But what about the bit rate? This sudden change on the quantizers will produce many fast bit rate changes and the buffer will avoid that.


Im trying to aim to a speceific size, not to a specific bit rate (like Xvid).


Sorry this is very confusing, for my bad english.

I'm saying something without sense please correct me.
__________________
So, it works or not???

Last edited by OvejaNegra; 8th June 2009 at 21:57.
OvejaNegra is offline   Reply With Quote
Old 8th June 2009, 21:49   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by OvejaNegra View Post
Now, what im trying to do (maybe this does not have any sense) is
allow x264 to use as high as possible bit rate for high motion scenes (to avoid blocks) and only the needed bit rate on the rest of the video to produce aceptable quality AND opposite.
That's exactly what the whole idea about 2-Pass ratecontrol is...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 8th June 2009, 22:12   #3  |  Link
OvejaNegra
ekTOMBE STUDIOS
 
OvejaNegra's Avatar
 
Join Date: Dec 2005
Location: Cuba
Posts: 254
Oh, i believed that x264 favors low motion scenes and kill the high motion scenes most because deffects are hard to see.

Well, how can i give more quality for the high motion scenes even if that reduce a little the rest of the video?
__________________
So, it works or not???
OvejaNegra is offline   Reply With Quote
Old 8th June 2009, 22:16   #4  |  Link
MasterNobody
Registered User
 
Join Date: Jul 2007
Posts: 552
Quote:
Originally Posted by OvejaNegra View Post
Well, how can i give more quality for the high motion scenes even if that reduce a little the rest of the video?
Increase --qcomp
MasterNobody is offline   Reply With Quote
Old 8th June 2009, 22:19   #5  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by OvejaNegra View Post
Oh, i believed that x264 favors low motion scenes and kill the high motion scenes most because deffects are hard to see.
Yeah, that's what CRF does compared to CQ mode. It lowers the quantizers in high motion scenes, so these don't eat as many bits as they would with a constant quantizer.
This is okay, because in high motion scenes we can usually deal with higher quantizers, as the loss is less visible. So CRF is a more bitrate-efficient version of CQ.

But 2-Pass will actually move bits towards the high motion scenes, compared to a 1-Pass ABR encode. The latter would blindly give all scenes the same bitrate (more or less).
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 8th June 2009 at 22:33.
LoRd_MuldeR is offline   Reply With Quote
Old 8th June 2009, 22:39   #6  |  Link
akupenguin
x264 developer
 
akupenguin's Avatar
 
Join Date: Sep 2004
Posts: 2,392
Quote:
Originally Posted by LoRd_MuldeR View Post
But 2-Pass will actually move bits towards the high motion scenes, compared to a 1-Pass ABR encode. The latter would blindly give all scenes the same bitrate (more or less).
No. ABR will blindly give all prefixes of the movie about the same bitrate... but by the time you're encoding a whole movie, the time constant involved is a whole lot more than one scene. ABR takes advantage of the fact that the natural variation in total size scales with sqrt(length), and so for a longer movie it doesn't have to limit bitrate variation as much. That said, if there's a high motion scene at the beginning of the movie, then 2pass will give it more bits than ABR.
akupenguin is offline   Reply With Quote
Old 9th June 2009, 14:11   #7  |  Link
OvejaNegra
ekTOMBE STUDIOS
 
OvejaNegra's Avatar
 
Join Date: Dec 2005
Location: Cuba
Posts: 254
Yes, it works as it should.
Even lowering qcompj and using low bit rates looks nice on the slow motion scenes (and totally ruins the fast motion scenes)

Just curiosity: What will happen if i touch cplxblur? The quantizer fluctuations will be higher?
__________________
So, it works or not???
OvejaNegra is offline   Reply With Quote
Reply

Tags
quality, x264

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.