RealProducer VBR Latency Trick

 

 

Below you will find instructions and information about a hidden feature in RealProducer 8.0 and above.  This feature provides the following benefits:

1)  During high-action scenes, the video is less likely to become blocky or display other compression artifacts.
2)  The video is very unlikely to start dropping frames, even during high-motion scenes.
3)  As a result of the two above benefits, you will be able to encode your files at a lower bitrate while retaining comparable quality.  

The only consequence I have noticed is that RealProducer will usually use a slightly higher bitrate than the one you select.  For example, if you were to try encoding at 225 kbps (the 256K Audience setting), RealProducer might actually use an average rate of 250 kbps.  However, this 250 kbps file will often be of identical or higher quality than a 300 kbps file encoded without using the trick.  
It is also important to note that you should not use the trick if you intend to stream your video.  The increased latency will cause RealPlayer to download the whole video before it starts playing.


Automatically Enabling the Feature

I have created a registry file that should enable the trick on any Windows-based computer with RealProducer 8.5.  Follow the steps below to install it.

1)  First, set up the RealProducer Preferences as described in my RealMedia 8 Encoding section.

2)  Close any RealProducer windows that may be running.

3)  Download this file:  vbrtrick.zip

4)  Open the .zip file and extract "vbrtrick.reg" to any location on your hard drive.

5)  Double-click "vbrtrick.reg" and press OK if asked to confirm.

6)  Run RealProducer, click on Options -> Preferences.  Go to the advanced tab and look at the setting for VBR Maximum Startup Latency.  If the registry patch installed correctly, the number of seconds should be 4000.  Here is a picture of what it should look like:

VBR Maximum Startup Latency Setting

7)  Hit Cancel to exit the Preferences menu.  If you try clicking OK or going to another tab, an error message will appear.  Just hit OK to ignore the error message and then proceed to hit Cancel.
In the future, you should avoid going to the Advanced tab.  The same error message will appear because the increased VBR Latency exceeds RealProducer's default maximum.  Like before, you can just hit OK to ignore the error message and then proceed to hit Cancel.  As long as you stay away from the Advanced tab, you shouldn't have any trouble changing the settings on any of the other tabs.

8)  Finally, resume following Step #4 in the Setting the RealProducer Preferences section of my RealMedia 8 Encoding page.

This automatic method will work with any video less than 1 hour and 6 minutes in length.  If your video is longer than that, you will have to use the manual method, which is found below.


Manually Enabling the Feature

By using the Registry Editor, anyone can custom-tailor the setting for videos longer than 1 hour and 6 minutes.  It's also a better option if you're using a different version of RealProducer or are extremely paranoid.

1)  First, set up the RealProducer Preferences as described in my RealMedia 8 Encoding section.

2)  Close any RealProducer windows that may be running.

3)  Click on the Windows Start button, and then click on Run...

4)  Type in "regedit" (without the quotes) and press enter.  The Registry Editor should appear.

5)  Navigate to the following key (folder):
HKEY_CLASSES_ROOT\Software\RealNetworks\RealProducer\8.5\Preferences\VBR Latency
If you have version 8.0 of RealProducer, you would change the "8.5" in the above location to "8.0".

6)  Double click the "(Default)" value that appears in the right window pane and change the value to "4000000".  That is the time in milliseconds, so if you wanted to encode a 2 hour movie you would change the value to "7200000".  However, my suggested value of "4000000" should be adequate for most purposes.  It is also possible that RealProducer will ignore values higher than "9999000".  Here is a screenshot of what the value should look like in the Registry Editor:

VBR Latency setting in Registry Editor

You may now exit Registry Editor.

7)  Run RealProducer and click on Options -> Preferences.  Go to the advanced tab and look at the setting for VBR Maximum Startup Latency.  If you did everything correctly, the number of seconds should be 4000 (or whatever value you entered).  Here is a picture of what it should look like:

VBR Maximum Startup Latency Setting

8)  Hit Cancel to exit the Preferences menu.  If you try clicking OK or going to another tab, an error message will appear.  Just hit OK to ignore the error message and then proceed to hit Cancel.
In the future, you should avoid going to the Advanced tab.  The same error message will appear because the increased VBR Latency exceeds RealProducer's default maximum.  Like before, you can just hit OK to ignore the error message and then proceed to hit Cancel.  As long as you stay away from the Advanced tab, you shouldn't have any trouble changing the settings on any of the other tabs.

9)  Finally, resume following Step #4 in the Setting the RealProducer Preferences section of my RealMedia 8 Encoding page.


What is the VBR Maximum Startup Latency Setting?

The RealProducer documentation gives a terribly imprecise description of this feature.  They say that it used for the sole purpose of increasing or decreasing startup time for videos streamed across the Internet, but that is merely a side effect of what the option actually does.  Since I do not have a source of information about the setting, I have been forced to piece together a possibly inaccurate explanation of it.  However, I feel that my understanding is reasonably close to the truth.  At the very least, it predicts the behavior of this setting.

To begin, let me first explain what 2-pass VBR encoding is.  VBR encoding is a special way of compressing file that uses more data during high-action scenes and less data during low-action scenes.  This way, more bits are given to the scenes that need them and bits are taken away from those that don't.  RealProducer uses a 2-pass method that first scans the entire video, looking for high-action and low-action scenes and noting their location in the video.  Once the first pass is completed, RealProducer uses the statistics from the first pass to provide a higher bitrate exactly where it is needed.  This improves the quality of a video and can also decrease its file size.

It is my belief that the VBR Maximum Startup Latency setting determines how far ahead RealProducer will look ahead in the video statistics when assigning a bitrate.  This is called a "sliding window" VBR.  Although RealProducer scans the entire video in its first pass, I think RealProducer only uses VBR in chunks the size of the Startup Latency.  For example, if you had a Startup Latency of 15 seconds, RealProducer would only look ahead 15 seconds when assigning bitrates.  If you have a 5 second low-motion scene followed by a 5 second action-scene, this poses no problem with a Startup Latency of 15 seconds.  However, if you have 20 seconds of little action followed by a high action scene, RealProducer will waste information by assigning the normal bitrate to that low-motion scene.  Since it cannot "see" beyond the 15 seconds of data in the Startup Latency, RealProducer will happily give away bits that would be better used in the following high-action scene.  By increasing the Startup Latency to 4000 seconds, you ensure that RealProducer utilizes the statistics for the entire video and thus does not waste any bits on low-motion scenes.  By doing so, it can drastically improve your high-motion scenes by intelligently taking bits from the low-motion scenes (where they are not needed).

 

If you so choose, you may now read my RealMedia 8 Encoding section.