Denaan
25th February 2006, 02:54
I recently reauthored THE WILD PARROTS OF TELEGRAPH HILL, which has 24 titles, all in one VTS. :rolleyes: I wanted to keep the main movie and a few of the extras with their menus, which totalled about 110% of a single layer DVD (and there were no motion menus to shrink). None of the guides i found online addressed this situation. :confused: After much hemming and hawing over whether to trim more of the extras (none of which i really wanted to give up) I figured out a way to do it using only DVD Shrink and PgcEdit. :cool:
Ripping and shrinking
First, i ripped the entire DVD using DVD Decrypter in file mode. Then i opened it in DVD Shrink and dragged and dropped the main movie plus the extras i wanted. Before shrinking, though, i remembered that DVD Shrink doesn't save the menus when reauthoring. Fine, i could add them back later by using the "Import menu" function in PgcEdit. But since DVD Shrink automatically shrinks to the full size of a single layer DVD, there wouldn't be room for the 50 MB of menus i wanted to add back. So to make room, i found another title among the unwanted extras that was just over 50 MB and added it to the end of the compilation, figuring that i could blank it out later to make room for the menus.
Opening two PgcEdit windows
When DVD Shrink was finished reauthoring, i ended up with my main movie in VTS_01, and nine more title sets, VTS_02 thru VTS_10, each with one 'extra' in its own VOB. (Seven out of nine were deleted scenes, most very brief, but each one was now in it's own title set). To help compare the new with the old, i opened the original DVD folder in PgcEdit in the top half of my screen, and opened the new shrunk version in another PgcEdit window in the bottom half. Besides the obvious difference in number of title sets, another difference was the lack of menus in my new version. DVD Shrink automatically sets the commands to play one title after the other, without the need for menus. I wanted to bring back the title, root, chapter and special features menus in the original.
Importing the original menus
Working in the left side of my lower PgcEdit window, i right clicked on 'VMG, First-Play PGC' and chose 'Import Menu'. I navigated to the VIDEO_TS.IFO in the DVD folder and clicked Open. When prompted, i chose to import the VOB file too. I did the same operation with 'VTST1, 1 TTN 1 Title 1' and imported the VTS_01.IFO from the DVD.Now i had a Title menu in the VGM and 42 PGCs (!) in the VTSM 1. The top half of my two screens were now identical, but when i scrolled down past the 42 lines of VTSM 1, the bottom halves were very different.
The old version had Titles 1 to 24 all in VTST 1:
VTST 1, 1 TTN 1 (2:24) Title 1
VTST 1, 2 TTN 2 (1:23:02) Title 2
VTST 1, 3 TTN 3 (6:58) Title 3
VTST 1, 4 TTN 4 (3:29) Title 4
*
*
VTST 1, 24 TTN 24 (2:01) Title 24
The new version had Titles 1 to 10 only, each in a separate VTST:
VTST 1, 1 TTN 1 (1:23:02) Title 1
VTST 2, 1 TTN 1 (6:58) Title 2
VTST 3, 1 TTN 1 (3:29) Title 3
*
*
*
VTST 10, 1 TTN 1 (2:01) Title 10
Keeping track of changed title numbers
Notice that the DVD had the main movie (1:23:02) in Title 2, but since i dumped old Title 1 (previews), the new version had its main movie in Title 1. All my other titles were renumbered too. I'd made a list, before shrinking, of which title numbers i'd kept and in what order. But it turned out to be pretty easy to match them up by the number of minutes and seconds in parentheses. To help me keep track of the changed title numbers, i added a comment to each of the new titles (right click on the title and choose 'PGC Comment') with something like 'originally title 12'. Then i started the process of correcting the commands.
Fixing commands, Part 1: Title commands
Each new title in the bottom screen had a set of commands created automatically by DVD Shrink. These work by simply changing one register, gprm(0), after playing each title and then jumping back to the First Play PGC, which then tests the register and points to the next title. My original titles in the top screen each had its own set of commands that needed to be copied and pasted to replace those in the corresponding new title in the bottom screen.
Commands highlighted in red (uh-oh...)
But then i saw some of the commands i had pasted into the bottom screen turn red when i highlighted them. This is a nice feature of PgcEdit that warns you when a command is not allowed, or refers to something that isn't there. Here's what happened. A command, for example to 'Call the VTSM Root menu of the current VTS,' worked okay when it was in a title in VTS 1 and pointed to the root menu of VTS 1. But now i had pasted the command into VTS 2, and it's not permitted to jump from one title set to another. It is, however, possible to jump from one title set to a menu in the VMG that jumps to another title set.
Creating a VMG dummy menu
So i created VMGM, 2 (dummy) with the pre command 'Jump to VTSM 1, Root menu.' To do this, i right clicked on VMGM, 1 TitleM, chose 'New dummy PGC', and answered yes at the prompt. This created VMGM, 2 (dummy) with a single pre command 'NOP'. I highlighted NOP and clicked on the button 'Edit Cmd' (or right clicked NOP and chose 'Edit Cmd'). In the dialog, i clicked Jump and Call => From VMGM menu => To VTSM menu => JumpSS-VTSM, which gave me by default the correct command.
Now i had to correct the command in VTS 2 which used to point to the root menu in the same VTS. This time, in the command editor i clicked Jump and Call => From VTST title => to VMGM menu => CallSS-VMGM-pgc, and entered the number 2 in the little box. This changed the command to to 'Call the VMGM PGC 2'.
More dummy PGCs
As i was thinking about this process of jumping between titles via the VMG menus, i realized that i was eventually going to have to jump from VTS 1 -- where my main menu, chapter menu and special features menus all resided -- to all of the other new titles. This meant i would need new dummy PGCs in the VMG, each one pointing to one of the ten new titles. So i used the same process i'd used to create VMGM, 2 and created ten more dummies, each one jumping to a different title number. Then, whenever i came upon an old command that had pointed to a title in old VTS 1, i changed it to point to the appropriate new VMG dummy menu.
Fixing commands, Part 2: menu commands
This process took care of the commands in the titles. But there were still commands in the menus pointing to old title numbers, and i wanted to be sure i hadn't missed any of the title commands that might still be pointing to the wrong locations. For each of the old titles that i'd kept, i wanted to find every command in the original DVD structure that pointed to it, and then correct that command in the new version. PgcEdit has the perfect tool for this, a function called 'Go to calling command'. For each of my titles on the bottom screen, i highlighted the original version on the top screen and chose 'Go to calling command' (Control+G) to find all the commands that referred to that title. Then on the bottom screen, i navigated to each command in the 'calling command' list (from the top screen) and changed it to refer to the new title number.
Editing menu buttons
Most menu commands can be edited as i described above under 'Creating a VMG dummy menu'. But the button commands are a little different. For those of you who haven't edited menu buttons, here's a little trick. Open the scratchbook by clicking the button on the upper right of the PgcEdit screen. Now click on the buttons 'Add after' and 'Edit Cmd' and create the command you'll need. Once you have the proper command in the scratchbook, copy it, click on the menu at the left, and hit the MENU button on the toolbar, which opens the menu editor. Now click on the menu button you want to edit, click on 'Clipboard' and choose Paste. You should see the command in the menu editor window change to what you want. Then close the menu editor.
Blanking out an unwanted title
When i was correcting commands in the last of the new titles, i remembered that my new Title 10 was an unwanted 'extra' that i'd included only so that there would be room for the menus i'd added back in. I wanted to blank out Title 10, which was a little more than 50 MB, so that my menu VOBs that i imported would fit on the final DVD. I right clicked on Title 10, and chose 'Blank Out All VTST Titles' (which sounds like it might mean all titles on the compilation, but really just refers to all titles in that particular title set.) I now saw a dialog that said 'Blank out ALL Titles of VTS 10', which was okay since there was just the one unwanted title in VTS 10. But here i had a choice of blank out method: I could replace all titles by a black frame (10 KB) or replace the titles by an imported clip, like a 'feature removed' still frame.
Adding a still frame
Now i knew that when i eventually had to tackle the menus, i could just delete (or better yet, hide) all the menu buttons that referred to items removed. But to make things less confusing for anyone else watching the reauthored DVD, i decided to follow the suggestion and add a still frame with the message 'This item has been removed'. By the way, you can get free VOB clips with this and other useful messages here:
http://www.posunplugged.com/vobclips/
So back in the dialog, i chose 'Replace all Titles by an imported clip...' and clicked OK, navigated to the folder with the still clip and selected it. Thus, my new Title 10 was now (0:00) and just 18 KB instead of over 50 MB. This, in effect, reduced the overall size of the compilation so that it would now fit on a single layer DVD. And by previewing my new Title 10, i could see that i now had a still clip with the proper message to point those now-useless menu buttons.
Fixing commands, Part 3: deleted items
I'd already corrected the commands referring to my renumbered titles, but i still had to deal with the commands pointing to titles that i'd deleted. Here, all i had to do was continue the process i'd started earlier, going through my list of deleted titles one by one. I'd dumped Title 1 (previews), so in my top screen, i highlighted Title 1, and continued with the 'Go to calling command' (Control+G) routine. I found each command in the bottom screen and changed it either to point to my new Title 10 ('item removed') or to the root menu of VTS 1. In either case, i simply changed the command to jump to the appropriate VMG menu that pointed to the proper location.
A special problem with menu button commands
One more little glitch i discovered is that some of the menu button commands were in a format where a register is first set to a certain value and then there's a link, for example: (SetHL_BTN) Set Highlighted Button =(mov) 1024 (button 1) ; LinkPGCN PGC 37. In this case i couldn't jump to the VMG directly, because apparently that's not an option with a combined 'Set, Link' command. In other words, 'Set, Jump' is not allowed. You are allowed to link to just about anything in the same VTS, but not elsewhere. So I created another dummy menu in the same VTS, in the same manner as before, that jumped to a VMGM dummy. I then changed the menu button command to link to my new dummy PGC. Thus to get my menu buttons to set a register AND point to Title 10, i had to go first through PGC 43 in my VTS 1, and then through another dummy PGC in VMG 3. Sometimes getting from a menu button in one title to another title is like skipping stones: from inside the menu the stone first skips to a dummy PGC in the same VTS, then to a dummy PGC in the VMG and finally to the other title. The rules of DVD structure may seem complicated, but you don't have to learn them all at once -- or understand everything -- in order to reauthor with PgcEdit.
Testing the final result
After finally correcting all the commands, i tested the new DVD structure with the Trace mode. (That is well explained in the PgcEdit guides, so i won't go into details.) ;) If i'd wanted to be really safe, i could have found and deleted the unreferenced PGCs with the 'find jumps to nowhere' and 'cross calling commands' routines (follow the link below to learn about those), but i preferred to burn a copy to DVD-RW and thoroughly test it on my settop player, rather than spend even more time laboriously wading through those 43+ PGCs yet again!
If you really want to be absolutely safe, and thoroughly clean up the mess of jumps to nowhere and unreferenced material, then here's a great post that includes good tips by blutach and r0lZ:
http://forum.doom9.org/showthread.php?t=103731
I'd appreciate your feedback on this method. If there are other, easier ways to go about it, then i'd love to hear them. Even if that's the case, i hope this guide is helpful to some of you, and i'll happily revise it as needed. Cheers. :)
Ripping and shrinking
First, i ripped the entire DVD using DVD Decrypter in file mode. Then i opened it in DVD Shrink and dragged and dropped the main movie plus the extras i wanted. Before shrinking, though, i remembered that DVD Shrink doesn't save the menus when reauthoring. Fine, i could add them back later by using the "Import menu" function in PgcEdit. But since DVD Shrink automatically shrinks to the full size of a single layer DVD, there wouldn't be room for the 50 MB of menus i wanted to add back. So to make room, i found another title among the unwanted extras that was just over 50 MB and added it to the end of the compilation, figuring that i could blank it out later to make room for the menus.
Opening two PgcEdit windows
When DVD Shrink was finished reauthoring, i ended up with my main movie in VTS_01, and nine more title sets, VTS_02 thru VTS_10, each with one 'extra' in its own VOB. (Seven out of nine were deleted scenes, most very brief, but each one was now in it's own title set). To help compare the new with the old, i opened the original DVD folder in PgcEdit in the top half of my screen, and opened the new shrunk version in another PgcEdit window in the bottom half. Besides the obvious difference in number of title sets, another difference was the lack of menus in my new version. DVD Shrink automatically sets the commands to play one title after the other, without the need for menus. I wanted to bring back the title, root, chapter and special features menus in the original.
Importing the original menus
Working in the left side of my lower PgcEdit window, i right clicked on 'VMG, First-Play PGC' and chose 'Import Menu'. I navigated to the VIDEO_TS.IFO in the DVD folder and clicked Open. When prompted, i chose to import the VOB file too. I did the same operation with 'VTST1, 1 TTN 1 Title 1' and imported the VTS_01.IFO from the DVD.Now i had a Title menu in the VGM and 42 PGCs (!) in the VTSM 1. The top half of my two screens were now identical, but when i scrolled down past the 42 lines of VTSM 1, the bottom halves were very different.
The old version had Titles 1 to 24 all in VTST 1:
VTST 1, 1 TTN 1 (2:24) Title 1
VTST 1, 2 TTN 2 (1:23:02) Title 2
VTST 1, 3 TTN 3 (6:58) Title 3
VTST 1, 4 TTN 4 (3:29) Title 4
*
*
VTST 1, 24 TTN 24 (2:01) Title 24
The new version had Titles 1 to 10 only, each in a separate VTST:
VTST 1, 1 TTN 1 (1:23:02) Title 1
VTST 2, 1 TTN 1 (6:58) Title 2
VTST 3, 1 TTN 1 (3:29) Title 3
*
*
*
VTST 10, 1 TTN 1 (2:01) Title 10
Keeping track of changed title numbers
Notice that the DVD had the main movie (1:23:02) in Title 2, but since i dumped old Title 1 (previews), the new version had its main movie in Title 1. All my other titles were renumbered too. I'd made a list, before shrinking, of which title numbers i'd kept and in what order. But it turned out to be pretty easy to match them up by the number of minutes and seconds in parentheses. To help me keep track of the changed title numbers, i added a comment to each of the new titles (right click on the title and choose 'PGC Comment') with something like 'originally title 12'. Then i started the process of correcting the commands.
Fixing commands, Part 1: Title commands
Each new title in the bottom screen had a set of commands created automatically by DVD Shrink. These work by simply changing one register, gprm(0), after playing each title and then jumping back to the First Play PGC, which then tests the register and points to the next title. My original titles in the top screen each had its own set of commands that needed to be copied and pasted to replace those in the corresponding new title in the bottom screen.
Commands highlighted in red (uh-oh...)
But then i saw some of the commands i had pasted into the bottom screen turn red when i highlighted them. This is a nice feature of PgcEdit that warns you when a command is not allowed, or refers to something that isn't there. Here's what happened. A command, for example to 'Call the VTSM Root menu of the current VTS,' worked okay when it was in a title in VTS 1 and pointed to the root menu of VTS 1. But now i had pasted the command into VTS 2, and it's not permitted to jump from one title set to another. It is, however, possible to jump from one title set to a menu in the VMG that jumps to another title set.
Creating a VMG dummy menu
So i created VMGM, 2 (dummy) with the pre command 'Jump to VTSM 1, Root menu.' To do this, i right clicked on VMGM, 1 TitleM, chose 'New dummy PGC', and answered yes at the prompt. This created VMGM, 2 (dummy) with a single pre command 'NOP'. I highlighted NOP and clicked on the button 'Edit Cmd' (or right clicked NOP and chose 'Edit Cmd'). In the dialog, i clicked Jump and Call => From VMGM menu => To VTSM menu => JumpSS-VTSM, which gave me by default the correct command.
Now i had to correct the command in VTS 2 which used to point to the root menu in the same VTS. This time, in the command editor i clicked Jump and Call => From VTST title => to VMGM menu => CallSS-VMGM-pgc, and entered the number 2 in the little box. This changed the command to to 'Call the VMGM PGC 2'.
More dummy PGCs
As i was thinking about this process of jumping between titles via the VMG menus, i realized that i was eventually going to have to jump from VTS 1 -- where my main menu, chapter menu and special features menus all resided -- to all of the other new titles. This meant i would need new dummy PGCs in the VMG, each one pointing to one of the ten new titles. So i used the same process i'd used to create VMGM, 2 and created ten more dummies, each one jumping to a different title number. Then, whenever i came upon an old command that had pointed to a title in old VTS 1, i changed it to point to the appropriate new VMG dummy menu.
Fixing commands, Part 2: menu commands
This process took care of the commands in the titles. But there were still commands in the menus pointing to old title numbers, and i wanted to be sure i hadn't missed any of the title commands that might still be pointing to the wrong locations. For each of the old titles that i'd kept, i wanted to find every command in the original DVD structure that pointed to it, and then correct that command in the new version. PgcEdit has the perfect tool for this, a function called 'Go to calling command'. For each of my titles on the bottom screen, i highlighted the original version on the top screen and chose 'Go to calling command' (Control+G) to find all the commands that referred to that title. Then on the bottom screen, i navigated to each command in the 'calling command' list (from the top screen) and changed it to refer to the new title number.
Editing menu buttons
Most menu commands can be edited as i described above under 'Creating a VMG dummy menu'. But the button commands are a little different. For those of you who haven't edited menu buttons, here's a little trick. Open the scratchbook by clicking the button on the upper right of the PgcEdit screen. Now click on the buttons 'Add after' and 'Edit Cmd' and create the command you'll need. Once you have the proper command in the scratchbook, copy it, click on the menu at the left, and hit the MENU button on the toolbar, which opens the menu editor. Now click on the menu button you want to edit, click on 'Clipboard' and choose Paste. You should see the command in the menu editor window change to what you want. Then close the menu editor.
Blanking out an unwanted title
When i was correcting commands in the last of the new titles, i remembered that my new Title 10 was an unwanted 'extra' that i'd included only so that there would be room for the menus i'd added back in. I wanted to blank out Title 10, which was a little more than 50 MB, so that my menu VOBs that i imported would fit on the final DVD. I right clicked on Title 10, and chose 'Blank Out All VTST Titles' (which sounds like it might mean all titles on the compilation, but really just refers to all titles in that particular title set.) I now saw a dialog that said 'Blank out ALL Titles of VTS 10', which was okay since there was just the one unwanted title in VTS 10. But here i had a choice of blank out method: I could replace all titles by a black frame (10 KB) or replace the titles by an imported clip, like a 'feature removed' still frame.
Adding a still frame
Now i knew that when i eventually had to tackle the menus, i could just delete (or better yet, hide) all the menu buttons that referred to items removed. But to make things less confusing for anyone else watching the reauthored DVD, i decided to follow the suggestion and add a still frame with the message 'This item has been removed'. By the way, you can get free VOB clips with this and other useful messages here:
http://www.posunplugged.com/vobclips/
So back in the dialog, i chose 'Replace all Titles by an imported clip...' and clicked OK, navigated to the folder with the still clip and selected it. Thus, my new Title 10 was now (0:00) and just 18 KB instead of over 50 MB. This, in effect, reduced the overall size of the compilation so that it would now fit on a single layer DVD. And by previewing my new Title 10, i could see that i now had a still clip with the proper message to point those now-useless menu buttons.
Fixing commands, Part 3: deleted items
I'd already corrected the commands referring to my renumbered titles, but i still had to deal with the commands pointing to titles that i'd deleted. Here, all i had to do was continue the process i'd started earlier, going through my list of deleted titles one by one. I'd dumped Title 1 (previews), so in my top screen, i highlighted Title 1, and continued with the 'Go to calling command' (Control+G) routine. I found each command in the bottom screen and changed it either to point to my new Title 10 ('item removed') or to the root menu of VTS 1. In either case, i simply changed the command to jump to the appropriate VMG menu that pointed to the proper location.
A special problem with menu button commands
One more little glitch i discovered is that some of the menu button commands were in a format where a register is first set to a certain value and then there's a link, for example: (SetHL_BTN) Set Highlighted Button =(mov) 1024 (button 1) ; LinkPGCN PGC 37. In this case i couldn't jump to the VMG directly, because apparently that's not an option with a combined 'Set, Link' command. In other words, 'Set, Jump' is not allowed. You are allowed to link to just about anything in the same VTS, but not elsewhere. So I created another dummy menu in the same VTS, in the same manner as before, that jumped to a VMGM dummy. I then changed the menu button command to link to my new dummy PGC. Thus to get my menu buttons to set a register AND point to Title 10, i had to go first through PGC 43 in my VTS 1, and then through another dummy PGC in VMG 3. Sometimes getting from a menu button in one title to another title is like skipping stones: from inside the menu the stone first skips to a dummy PGC in the same VTS, then to a dummy PGC in the VMG and finally to the other title. The rules of DVD structure may seem complicated, but you don't have to learn them all at once -- or understand everything -- in order to reauthor with PgcEdit.
Testing the final result
After finally correcting all the commands, i tested the new DVD structure with the Trace mode. (That is well explained in the PgcEdit guides, so i won't go into details.) ;) If i'd wanted to be really safe, i could have found and deleted the unreferenced PGCs with the 'find jumps to nowhere' and 'cross calling commands' routines (follow the link below to learn about those), but i preferred to burn a copy to DVD-RW and thoroughly test it on my settop player, rather than spend even more time laboriously wading through those 43+ PGCs yet again!
If you really want to be absolutely safe, and thoroughly clean up the mess of jumps to nowhere and unreferenced material, then here's a great post that includes good tips by blutach and r0lZ:
http://forum.doom9.org/showthread.php?t=103731
I'd appreciate your feedback on this method. If there are other, easier ways to go about it, then i'd love to hear them. Even if that's the case, i hope this guide is helpful to some of you, and i'll happily revise it as needed. Cheers. :)