RB-OPT

OVERVIEW

RB-Opt is an addon for DVD-RB.
It allows the user to select different bitrates for every Vob-ID or every cell in a DVD to process by DVD-RB. For example, backing up a DVD you may want to lower the bitrates for the extras, leaving more room to the film. It works even for extras in the same VTS of the film (ex. Trailers, deleted scenes...), or simply you may want to lower the bitrate of the last cell of the film (usually with end-credits).

With RB-Opt you can tweak some CCE parameters, and add Avisynth command, per Vob-ID, allowing, for example, to use CCE internal filters, or any filter for avisynth, on selected VOB-ID's. You would use CG filters for main title in "Finding Nemo", but not on extras...

Furthermore it's possible to select for eveery VobID to use normal VBR (multipass encoding in CCE), or OPV mode (single pass fast encoding, with the "prediction pass run by RB-Opt).
Most of the code of the OPV mode is by SansGrip.

DISCLAIMER

This is BETA software: there are probably bugs. If you don't like BETA software, please, don't use it. If you have problems in backing up a dvd after the use of RB-Opt, please don't report bugs in the general threads of DVD-Rebuilder on doom9.

This software is designed to be used as a method of backing up DVDs. Note the wording: It is NOT meant to be used as a tool for stealing copyrighted material -- but instead for LEGALLY creating backups of DVDs that you own.

The software is in an early beta stage.

It has been tested with DVD-RB 0.4x-0.5x Beta.
Hint: Please, don't use the "Steal Space From Extras" Option introduced in DVD-RB 0.52 if you plan to change bitrate with RB-Opt. Using this option, you'll have a wrong reduction % displayed.

USAGE

Put DVD-RB in "3 click mode", and run the "Prepare" stage.

Now run RB-Opt, and open the REBUILDER.INF created by DVD-RB.

RB-Opt shows the default bitrate used for every VOB-ID in the "Encode" stage.

Find (using preview) the VobID of the film, and link them.

Select the VOB-ID you want to compress more/less, and input your custom bitrate.

The program will automatically calculate the new bitrate for the Vob-IDs labeled as "Auto".

It's just like DVDShrink and other one-click apps do ... in a less graphical way :-(

Now you can tweak end credits cell, initial cell, or use "expert settings" to tweak any CCE parameters, or to apply an avisynth filter.

After saving the changes, you can start the encoding stage in DVD-RB

The bitrate is always calculate cell by cell: if in DVD-RB you selected "Dynamically Assign Cell Bitrates", the resultant Cell Bitrates will be still proportional to the original ones.

You can tweak every single cell bitrate for Vob-IDs not set as "Auto".

OPV WITH RB-OPT

To answer what is likely to be the most asked question: RB-Opt now includes OPV prediction for several reasons.

1) Because DVD-RB's OPV prediction pass is done at the end of the prepare phase, this makes it impossible to use RB-Opt with DVD-RB's version of OPV. The prediction has already been run using the default CCE settings from DVD-RB, and any changes to those (e.g. by selecting a custom matrix with RB-Opt, or changing the GOP length) will invalidate the results and cause an under- or over-sized encode. By doing the prediction in RB-Opt one is able to set custom parameters and tweaks as usual and *then* run the OPV prediction, meaning the prediction will be run with the same CCE parameters as the actual encode, and should thus be accurate.

2) DVD-RB's prediction is sometimes off by a couple of Qs. This is inevitable -- OPV prediction is never, and can never be, perfect -- but we feel RB-Opt's method to be a little more accurate.

3) RB-Opt's version is more configurable. You can set your desired sample size, safety margin, "GOPs per range" (see below), and can even choose a two-pass mode for better accuracy.

4) RB-Opt allows the user to specify a custom, set Q factor for each segment, for those who have their own method of size prediction and would like to supply the Q themselves.

5) You can use Q factor prediction even for a normal VBR encode, for two reasons:

a) You can check the quality of the encoded samples, as an indication of the quality of the final encode.
b) The Q factor can be considered a "measure of quality" (values over 40 show that you could find MPEG artifacts in your final encode)
In this case you can cancel the process after prediction, without saving, thus restoring VBR mode. If you're not satisfied with the quality you can change CCE parameters or .avs scripts until you're pleased with the result.

The addition of OPV prediction to RB-Opt is in no way a criticism or slight of jdobbs's code: it's there simply to make OPV mode available to RB-Opt users, and a recognition that some people like to tweak settings, even when it comes to OPV prediction.

HOW TO USE IT

OPV prediction in RB-Opt is relatively simple. First, select VBR in DVD-RB -- do not use DVD-RB's OPV mode. Run the prepare phase, then fire up RB-Opt as usual.

You will notice, in the centre "Properties" panel, a choice between VBR and OPV. VBR is selected by default, and will produce the same results as in previous versions of RB-Opt: DVD-RB will run an n-pass VBR encode. By selecting OPV mode you inform RB-Opt that you wish to run size prediction on this segment.

Once OPV mode is selected you'll notice the "Set Custom Q" button becomes clickable. This is intended for advanced users who wish to set the Q factor for each segment manually. It is assumed that the user has already run some kind of size prediction on the segment and knows the correct Q to use. Using this feature can result in wildly under- or over-sized results -- only use it if you know what you're doing!

Tweak your settings as usual, then hit "Save Settings." RB-Opt's OPV prediction will run if you have selected OPV mode for any of the segments.

The "OPV Prediction" dialog, which will now appear, allows you to change some settings with regard to the prediction pass:

Sample size -- this is the percentage of each segment you would like to use for prediction. Usually between 1% and 3% is recommended. In theory, the larger the percentage sampled, the more accurate the results.

Safety margin -- again a percentage, this allows paranoid users to specify "room for error." If you set a 1% safety margin, the OPV prediction will attempt to obtain a result that is under-sized by 1%.
Should the prediction turn out to be slightly off, and the final encode is 1% bigger, congratulations, you've hit your target. Of course, the prediction could be inaccurate in the other direction, and you end up with an even smaller encode than you would've had without a safety margin set. I usually set this to zero, but YMMV.

GOPs per range -- to understand this parameter you need to know a little about how OPV prediction works. Basically it takes a bunch of "clips" from the segment it is predicting and combines them into one.
This is then encoded and the file size of the resulting M2V compared against the desired size. The "GOPs per range" setting allows you to determine the length of these "clips," in GOPs. If your GOP length is 12 and you set this to 1, each "clip" will be 12 frames in length. If you set it to 2, they'll be 24. And so on. Whatever value you use, RB-Opt will pull out enough of these "clips" to make a sample of the size you set in "sample size," or as close as it can get. The jury is still out on what value is best here, but I've obtained good results using a setting of 1.

Double pass -- enabling double pass causes RB-Opt to run prediction in two phases. In the first it selects the sample as normal and determines the "correct" Q. In the second pass it will select a different sample (of the same size and with the same number of GOPs per range) and run the prediction again, starting with the Q value it determined in the first pass. That is to say it'll run the predicted Q over a different set of frames in the segment to verify the predicted Q was correct. If the second pass finds a Q that is within 2 points of the original, it'll use the average of the the first and second Q. If the Q from the second pass is off by more than 2, RB-Opt will suggest that this particular segment isn't suited to OPV prediction.

Launch encoder minimized -- if selected CCE will be run minimized. Otherwise it won't.

To begin OPV prediction click the "PREDICT" button. The first time it is run RB-Opt will ask you for the location of the CCE (or EclCCE) executable you use to encode. This should be the same executable DVD-RB uses to do the encode phase. RB-Opt will then launch CCE repeatedly until it has determined the "correct" Q to use for each segment for which you chose OPV mode.

Once prediction is complete RB-Opt will allow you to preview the quality of each segment, to determine if it's good enough for your eyes. To do this choose the segment in the dropdown list and then click the "Check Quality" button. RB-Opt will use the media player you specify to preview the sample.

Click the "Save" button to save the settings and exit the OPV Prediction dialog. You can now exit RB-Opt and run the encode phase in DVD-RB.