You are on page 1of 8

MenuShrink V. 1.

0 User Guide
Home Page
Introduction
MenuShrink is a small utility for shrinking DVD motion menus to still frames, either with or
without audio. By doing this, users backing up their DVDs to a DVD-5 can usually save
hundreds of Mb and prune the menu to about 5% of its original size.

Where to get MenuShrink


You can download MenuShrink free of charge here.

Usage instructions
Use MenuShrink after ripping your DVD but before using DVD Shrink. MenuShrink will be
able to free a significant amount of space in the DVD, which DVD Shrink can put to good use
to improve the quality of your backup.

There are essentially 2 modes – with audio and without.

1. Rip your DVD to your hard drive with DVD Decrypter or similar

2. Open MenuShrink

3. Drag the folder which contains your ripped files over to the MenuShrink window. You
can also drag a file from that folder to the MenuShrink window.

4. MenuShrink will load the DVD and report how many titlesets (VTS – video title set) it
found and the overall size of all menus (260.92MB in this case).

5. Decide if you wish to keep the audio or not - naturally, eliminating the audio will
cause the greatest space savings

6. You can then hit the Process button and MenuShrink will shrink down all the menus
using default options. Or you can use advanced options.

Advanced Options
This is where you can adjust which frames to select for the still menus, and make more
advanced adjustments:

7. All menus (titlesets) are ticked by default. If you only wish to process certain menus,
untick the ones you want MenuShrink to leave intact or click “None” and then select
only the ones you’d like to process.

8. You should leave the “Remove stop in subpics” option checked (see the details
below).

9. Decide whether you want the still to be displayed indefinitely (no-audio mode only).
It’s best to leave this option unchecked (see the details below).

10. You also have an option to skip menu intro/outro clips. These are the short video
clips that are sometimes played before and after menus. Skipping them makes for a
nicer smoother playback so you should select this option. See the details below.

11. Also, use the slider to decide where the still image should be taken from in the
original menu. Move it all the way to the left to select the first menu frame, all the way
to the right to select the last menu frame. The default position is 85%, which means
the image is taken at 85% of the menu duration. Sometimes, the first or last frame
will be the clearest. Other times, the first frame is black (fade-in) or the last one is
(fade-out). Just experiment. If you don’t like your output, just try it again with different
settings - you don’t even need to restore your backup as MenuShrink works on the
files in its own special backup folder. If you use PowerDVD 6.0 or media player
classic, this is where the “Soft DVD Player” button comes handy!

12. The default path to DVD Shrink will also be shown. If that is not where DVD Shrink is
located, change the path (To launch DVD Shrink, just click on DVD Shrink in the
main MenuShrink window). You can also set the path to your favorite software DVD
player. This will enable the “Soft DVD Player” button on the main MenuShrink
window. Note that for this to work, the player application has to be able to open a
DVD from its command line (MenuShrink passes VIDEO_TS.IFO). Media player
classic (free!) can do that and so can PowerDVD 6.0 but PowerDVD 5.0 can’t and
neither can WinDVD.
13. Back in the main MenuShrink window, click Process!

MenuShrink will very quickly (within a few seconds) process the menu, extracting a still
frame at the selected location for each cell in the menus and tell you the resultant menu size
and how much space you have saved

In this case, you can see without audio, the menu ended up at just 7.8Mb, a savings of 97%
(the same DVD with audio resulted in 21.5Mb, still a savings of 91% - the “with audio”
feature usually varies between 65% and 90% saved, depending, of course, on the length of
the menu)

14. You can view the output of the shrink by looking at the log. This contains useful
information.

15. Test your menu in a software player (e.g. media player classic) before proceeding
to do any further operations on the DVD (eg DVD Shrink). To do that, if your path to
your soft player is correct and it can open a DVD from the command line, simply click
on the “Soft DVD Player” button.

16. If your path to DVD Shrink is correct (see above) you can then hit the “DVD Shrink”
button to open DVD shrink on the processed files and start your normal shrinking
session. Or you can open the processed DVD files with any other backup program
(CloneDVD, Recode). Remember, MenuShrink processes in place. This means the
processed files will be in the original folder.
Oops – I goofed up!!!
No worries. Just click Restore Backup and all will be back as it was in a flash. You
can do this at any time, even after the program has been closed and re-opened.

Easter egg!! User-defined tools:


MenuShrink lets you define “hot keys” (keys F1 through F4) to open the processed
DVD with your favorite programs. There is no user interface to set the paths to these
tools, so you have to do it in MenuShrink’s “INI” file, normally located here:

C:\Documents and Settings\YourName\Application


Data\MenuShrink\MenuShrink.ini

Simply open the file in notepad, and set the path (between quotes) for your tools. I
like to use PgcEdit to further customize my DVDs so I have this line in my “ini” file:
F1=”C:\temp\dvdutils\pgcedit”
Again, for this to work, the program in question has to be able to open a file passed
as a command line argument. MenuShrink always passes VIDEO_TS.IFO.

Known Issues and Limitations


1. It’s not currently possible to preview each menu to select the very best frame to keep
for a still. VobBlanker lets you do that. Likewise, MenuShrink processes the whole
menu of the selected video titlesets (and not a certain cell or PGC within that VTS).
To process on a cell-by-cell basis, use VobBlanker.

2. Delayed highlighting of buttons (see below)

________________________________________________________________

Technical discussion (for those who are interested)


Some background
MPEG2 image coding is done in groups of pictures (GOPs) made up of I, B and P frames. I
(intra) frames are the only ones that can be decoded by a DVD player on their own. Both B
and P (predictive) frames require at least one other frame to be decoded. This is why it's
much easier to use an I-frame to turn a motion menu into a still: keeping a single I-frame will
yield a full image. (This is not entirely true for interlaced video, as each image is made up of
two fields, one of which might be coded as an I-frame, and the other as a P-frame).

MenuShrink always selects the first I-frame after a NAV Pack (and possibly the next frame if
the video is interlaced) to use as a still. In theory, any such I-frame is a good candidate, but
some may be better than others (for example, the first I-frame in the cell might be black, and
the last one too, in case of a fade-out). The option to take the largest one (idea by jsoto) is
usually the best option, however, because it is in motion, it may be blurred. It is best for
users to experiment.
The hierarchy in the VOB file, starting at the lowest level, is:
- A frame is part of a GOP. The GOP always starts with an I-Frame
- A GOP is part of a Video OBject Unit (VOBU). There is usually 1 GOP per VOBU
(lasting 0.4 seconds long), but there can be more (up to 1.2 seconds). A VOBU always
starts with a NAV Pack and ends at the next NAV Pack.
- Several VOBUs make up a cell. A cell is characterized by being made up of VOBUs that
have the same VOB/CELL IDs (a pair of numbers that are declared in the NAV Packs).
MenuShrink operates on individual cells (it loads the first cell, processes it, forgets about
it, and then loads the next one etc).
- Several cells make up a VOB, characterized by being made up of cells that have the
same VOB ID (the first number in the pair of numbers mentioned above). Often times,
there's only 1 cell per VOB, for example 1/1, 2/1, 3/1 etc.
- A VOB file (e.g. VTS_01_0.VOB) usually contains several VOBs, but may contain just
one (the menus we will be dealing with will always contain many VOBs).

A VOBU always starts with a NAV Pack, then the first video pack of an I-Frame. Following
that, there can be more video packs, audio packs and subpicture (subpic) packs. The
subpic packs contain all the information about the button highlights and need to be
preserved to keep the menu functional. The audio packs can be kept or discarded,
depending on user preferences. As mentioned above, there can be more than 1 GOP in a
given VOBU but MenuShrink will only consider the first one as a candidate for a still I-frame.

In order to turn an I-Frame into a 1 frame GOP, a few things need to be done:
- A sequence-end-code needs to be added to the end of the I-frame, along with a packing
stream (since we probably removed lots of stuff from subsequent video frames). This is
especially true if we don't keep audio packs.
- The NAV Pack's "End PTM of VOBU if sequence-end-code" (offset 0x41) must be set to
indicate the presentation end time of the I-Frame.
- Although it is not strictly necessary for a single I-frame, it is probably safer to set the
"closed GOP" flag and it's necessary to reset the "Broken GOP" flag. The Closed GOP
flag indicates that a B-frame that's coming right after the I-frame does not require the
previous GOP to be decoded. B-frames can reference frames before and after them and
these frames are then required to decode the B-frame. The flag indicates that this GOP
does not require the preceding one to be decoded. In our case, there is no B-frame after
processing, so the flag is useless. The Broken GOP flag indicates that the GOP is not
closed (a B-frame requires the previous GOP for decoding) but some editing made the
previous GOP unavailable. The flag can be used by a player to cheat during playback,
for example by repeating a frame instead of attempting to decode the B-frame. In our
case, it must be reset.
- Several other pointers in the NAV Pack must also be updated to reflect the fact that
some video (and maybe some audio) packs were dropped, most notably in the SYNCI
and VOBU_SR areas. The SYNCI area indicates where the audio and subpic packs are
to be found in the VOBU (relative to the current NAV Pack) for each audio and subpic
stream. VOBU_SRI is the search information table, which is normally used for fast-
forwarding through the video. It contains offset (in sectors) to video packs located at
various time lags from the current NAV Pack (0.5 seconds, 1 second … up to 120
seconds before and after the current time). Since we've removed many packs, most of
these offsets are now off and must be corrected or flagged as invalid.

Creating the shrunk-down cell


As the first output VOBU, MenuShrink uses the first VOBU where subpic packs are present.
However, MenuShrink can insert an I-frame from another location in the cell (the largest one
for example). To do this, MenuShrink removes the original I-frame in that first VOBU, then
inserts the new I-Frame in between the remaining packs (subpic packs, and audio packs, if
selected), according to their SCR (system clock reference). Each pack has an SCR value
attached to it, which indicates at which time (in a 90 kHz reference clock) the pack should be
extracted from the medium and sent for decoding. Software players most likely ignore this
value because they have large amounts of memory available to store packs in advance.
This is not the case for standalone players which have minimal amounts of memory. As a
result, it is crucial to preserve SCR values so the player does not run out of audio or video.
Audio is the most important aspect (a gap in the audio is immediately noticeable, whereas a
gap in the video isn't), and in MenuShrink, the I-frame packs are inserted in between the
audio and subpic packs, their SCR values being incremented from pack to pack. The SCR
values of the audio and subpic packs are not changed, which ensure the same smooth
playback as in the original cell.

The still time option


When retaining the audio, MenuShrink keeps the first VOBU where the subpic packs appear,
and inserts the selected I-frame. Then subsequent subpic and audio packs are added,
along with their NAV Packs. In No Audio mode, the same things happen, but none of the
audio packs are kept. In that case, a still time is set in the IFO file, to indicate that the cell
should play for a certain amount of time. MenuShrink can make the cell play for exactly the
same amount of time as it originally did, or it can set the still time to an infinite value.

Some menus are made up of three parts (for example most of the Star Wars menus):
- There is a short menu intro clip (no buttons), followed by
- a first menu cell with buttons (A), which does not loop, but leads into
- a second one (B) that loops.

MenuShrink will shrink the intro clip, but will keep the first and second cells A and B fully
functional. If you select an infinite still time, cell A will pause until you select one of the menu
options, or select Next, which will take you to cell B. By contrast, if you select the default of
a still time that matches the original duration, cell A will pause for as many seconds as it was
originally, then go into cell B, as the original DVD did.

Another case is that of a DVD where a menu plays for about 30 seconds, then goes on into
a default action (for example, starting the movie). The menu cell does not loop in that case.
MenuShrink will preserve this behavior if you use a still time that matches the original
duration. By contrast, if you select an infinite still time, the menu will pause forever, until you
hit a button.

Bypassing menus intros/outros


When MenuShrink encounters a cell with no buttons, it will shrink it to a single frame,
dropping the audio, so the cell plays very briefly (for about ½ second). The latest version of
MenuShrink is able to entirely skip many such cells. In the example above, this means the
intro clip will not play at all and the navigation will go straight to menu (A). This makes
menus play in a much smoother manner in general. However, in some rare cases, it can
cause a menu to repeat itself once: For example you can make a selection and find yourself
in the same menu. The next time you make the selection the menu will behave normally. In
my view, the benefits of skipping menu intros/outros clearly outweigh the remote possibility
of a menu that repeats itself. But there’s a button in the advanced panel to disable the
skipping mechanism if you find the results objectionable.
The gory technical details are as follows: if the menu intro (specifically a cell with no buttons)
has no cell command and is followed by another cell in the PGC (program chain), say cell A,
we know for sure that cell A plays immediately after the intro. Entirely removing the intro is
very difficult because the cell numbers would change and some of the DVD commands in
the PGC or in the menus themselves would need to be updated, not an easy task. Instead,
we can copy the information from cell A into the menu intro, which then behaves exactly as
the menu A. In your PGC you end up with Cell A repeated twice, but that’s usually not a
problem. The net result is that the menu intro no longer plays and you go to menu A directly.
If the intro resides in its own Program Chain Number or if it has a cell command, MenuShrink
can't bypass it, but makes sure the playback is as brief as possible (not noticeable on my
settop player).

The problem with stop commands in the subpic streams


Subpic packs contain all the highlight information for the buttons, along with commands
controlling the display of the highlights. The commands are located at the very end of the
subpic data. In some cases, for example, the Star Wars DVDs, the subpic data includes a
"stop" command that's executed after a delay. That stop command causes the highlights to
disappear. Usually, this is done in a menu that loops, and the timing of the stop command
(also coded in the subpic data) coincides with the duration of the menu, so the highlights
disappear, but reappear again when the menu loops.

It is not clear to me what the benefit of these stop commands is. The fact is that they pose a
problem when turning a motion menu into a still, in no-audio mode. If the menu is turned
into an infinite still time, the stop command will still execute after the encoded delay, and the
highlights will disappear, never to reappear due to the infinite still time. If the still time is 4
seconds, the highlights will reappear 4 seconds after they disappear. Both cases are bad,
and MenuShrink normally removes such timed stop commands from the subpic data to avoid
the problem entirely. A message is sent to the log if a timed stop command is detected and
removed. The procedure is normally safe, but an option is provided to disable the stop
removal in case the subpic data would get messed.

So, if you test your DVD and the button highlights behave strangely, you should check in the
log whether stop commands were removed and disable the option to see if the highlights are
normal without it. However, chances are that having the option turned off will make
highlights disappear after a delay. (Note that all this only applies to no-audio mode. If you
keep the audio, then there's no problem keeping these stop commands around).

The problem of delayed highlights


Because of the way MenuShrink operates, it sometimes happens that highlights do not
appear right at the beginning of the cell. This is the case when subpic packs appear in
VOBUs where no buttons are declared.

Button information is located in the NAV Packs – this includes the exact area on the screen
for each button, how buttons are linked with the arrow commands, which command is to
execute when a button is "pushed", how long the highlights and the selection are to be
displayed, etc.

On some menus, the NAV Packs with all the button information can appear several seconds
after the first NAV Pack with subpics. This may not have been a problem in the original
menu, for example, because the buttons were meant to appear with a delay after some
video was shown. Because of the way MenuShrink operates, the final cell will show the
same delay: the cell will start playing but only after the NAV Pack with the button information
is decoded will the highlights appear. At this point, MenuShrink does not offer a solution for
that problem. In the future, a solution could be to move the early subpic data and the
selected I-Frame into the first VOBU where buttons are declared.

IFO Processing
Finally, the various IFO files must be updated to reflect the changes that were made to the
VOB files. In particular the VTSM_VOBU_ADMAP table holds a list of all the VOBUs in the
VOB file with their starting sectors. Since we’ve removed lots of data from the VOB files,
there are usually fewer VOBUs than originally (except with the “keep audio” option) and the
starting sectors are no longer the same and must be corrected. The VTSM_C_ADT table
must also be updated. It keeps track of all the VOB/CELL ids in the VOB file, with their start
and end sectors. The VTSM_PGCI_UT table holds all the information on the PGC (program
chains) in the VOB file. The cell durations, still times, start and end sectors must also be
updated in this table. There are a few more pointers that need to be updated in all the IFO
files, finishing with the VIDEO_TS.IFO file which keeps pointers pertaining to the layout of
VOB, IFO and BUP files on the disc. MenuShrink implements its own “Get VTS Sectors”
(thanks again to r0lZ and jsoto for lots of explanations on how to do that!).

Questions and comments

Questions and comments can be directed to doom9’s forums in the IFO/VOB Editors forum
or sent directly to jeanldvd(at)free(dot)fr.

Written/edited by blutach and jeanl.

You might also like