VideoHelp Forum




+ Reply to Thread
Results 1 to 18 of 18
  1. I ripped a DVD that only had one audio track. I created a new menu that has addition text for a second audio. I reauthored the movie and placed it back in the original DVD using vobblanker. I then opened the DVD in pgcedit and fixed how many streams there were. I did set the stream attributes too. I also edited the subpic for the highlighted buttons.

    Now my issue is, how am I going to link the audiostream to the new button that I made? I was thinking I will probably have to make a dummy pgc and get the button to use that, but I'm not really sure.
    Quote Quote  
  2. You should use a button command similar to this:
    Code:
    [51 01 00 81 00 00 00 01]   1  (SetSTN) Set Audio track = 1 ; LinkTopCell
    The SetSTN part of the command changes the audio stream. (In my example, it sets it to the 2nd audio track, track #1.)

    The LinkTopCell restarts the playback of the current menu cell. The user should then select another button to get out of the menu and play the movie.
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  3. Hm....after I didi that I got tthe message:

    Name:  button.jpg
Views: 361
Size:  73.6 KB

    Will it still be ok?
    Quote Quote  
  4. No. You have to link your new button with the other (original) adjacent buttons, and vice-versa. Without the links, you will not be able to select some buttons with the remote (but you can click them if you play the DVD on a PC).

    Use the "Adjacent Buttons" sliders. Each button must be accessible from at least one button, and there must be a way to select another button from each button. For example, in a menu with 2 buttons, button 1 must be linked to button 2, and button 2 to button 1.

    You should use the link direction that is the more natural. For example, if the button 2 is below button 1, you should link button 1 to button 2 with the bottom slider, and button 2 with button 1 with the top slider.

    To disable a link, set it to the number of the current button.

    You can also use the automatic functions "Edit -> Automatically Link Buttons (...)". They try to assign automatically the best adjacent links, but it's not always perfect. Verify carefully anyway.

    You can verify if the links work well with the arrow keys of your keyboard. They simulate the arrows of the remote.

    In your case, you have obviously created button 7. It is not linked to the other buttons, as by default, when a new button is created, the 4 adjacent button links are disabled (they are pointing to button 7), and the links of the existing buttons are not modified. Therefore, you will be unable to select it with the remote, and to return to another button. You have to link whatever button(s) are closed to button 7 with it, and button 7 with them. Also, take care: if you change, say, the right link of button 6, be sure that the original button it was linked with is still accessible.

    (There is one exception to the link rule. Hidden buttons (intentionally removed) should not be accessible from the non-hidden buttons, since you don't want that the user activates them.)
    Last edited by r0lZ; 7th Jan 2013 at 05:22.
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  5. Yea, I actually figured it out a few minutes later cause all the other buttons looked different, haha. Thanks r0lZ for creating such a wonderful program.
    Quote Quote  
  6. You're welcome.
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  7. Hm.....I just noticed something very strange. When I load up my dvd in WMP and choose the second audio from the menu, that audio is not played. If I go back to the menu and choose it again, it will play. Any idea why this is?
    Quote Quote  
  8. You mean that the first time you activate button 7, the first audio is still played instead of the second one? That might be because the original authoring of the DVD forces the first stream at some point, after the playback of the menu. Search for "SetSTN" in the whole DVD, and use the trace to locate the SetSTN command. You might have to remove it, and change the command of the menu button that selects the original audio stream with a command similar to the command of my post above.

    If that doesn't work, post here the command of the button that selects the audio stream #0. Also, the pre-commands of the main movie PGC can be useful.

    I can't help much, as the audio can be set in many different ways, depending on the original authoring.
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  9. You mean that the first time you activate button 7, the first audio is still played instead of the second one?
    Yes.

    I tried using trace to locate the audio, but I couldn't locate it. I'm not really good with trace. I was able to find several SetSTN commands in several PGC:
    VTSM 6 , LU 1 (en) , 1 (dummy) RootM - Chapters: n/a, Programs: 0, Cells: 0
    ********** pre commands:
    1 (SetHL_BTN) Set Highlighted Button =(mov) 1024 (button 1)
    2 Set gprm(0) =(mov) 1
    3 if ( gprm(8) == gprm(0) ) then { (SetSTN) Set Audio stream = gprm(12) ; Set Sub-picture stream = gprm(13) }
    4 Set gprm(8) =(mov) 0
    5 Set gprm(6) =(mov) 0
    6 Set gprm(1) =(mov) 0
    7 Set gprm(2) =(mov) 0
    8 Set gprm(5) =(mov) 0
    9 Set gprm(7) =(mov) 0
    10 Set gprm(9) =(mov) 0
    11 Set gprm(14) =(mov) 0
    12 Set gprm(0) =(mov) 0
    13 if ( gprm(10) == gprm(0) ) then { (JumpSS) Jump to VMGM PGC 14 }
    14 LinkPGCN PGC 6
    ********** post commands:
    ********** cell commands:
    VTSM 6 , LU 1 (en) , 3 (dummy) AngleM - Chapters: n/a, Programs: 0, Cells: 0
    ********** pre commands:
    1 Set gprm(0) =(mov) gprm(13)
    2 Set gprm(0) |=(or) 64
    3 (SetSTN) Set Sub-picture stream = gprm(0)
    4 (SetSTN) Set Audio stream = gprm(12) ; Set Sub-picture stream = gprm(13)
    5 Set gprm(0) =(mov) 1
    6 if ( gprm(7) >= gprm(0) ) then { LinkPGCN PGC 12 }
    7 (JumpSS) Jump to VMGM PGC 8
    ********** post commands:
    ********** cell commands:
    VTSM 6 , LU 1 (en) , 10 (dummy) - Chapters: n/a, Programs: 0, Cells: 0
    ********** pre commands:
    1 Set gprm(5) =(mov) 99
    2 Set gprm(0) =(mov) sprm(2:Sub-picture stream number)
    3 Set gprm(0) =(mov) 1
    4 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Audio stream = 0 }
    5 Set gprm(0) =(mov) 0
    6 Set gprm(1) =(mov) 0
    7 Set gprm(2) =(mov) 0
    8 Set gprm(12) =(mov) sprm(1:Audio stream number)
    9 Set gprm(13) =(mov) sprm(2:Sub-picture stream number)
    10 LinkPGCN PGC 9
    ********** post commands:
    ********** cell commands:
    13 (dummy) I know is not what we're looking for cause I had to edit this button to link the commentary audio stream.
    VTSM 6 , LU 1 (en) , 13 (dummy) - Chapters: n/a, Programs: 0, Cells: 0
    ********** pre commands:
    1 Set gprm(0) =(mov) 4
    2 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Audio stream = 2 }
    3 Set gprm(1) =(mov) 0
    4 Set gprm(2) =(mov) 0
    5 Set gprm(7) =(mov) 0
    6 Set gprm(12) =(mov) sprm(1:Audio stream number)
    7 Set gprm(13) =(mov) sprm(2:Sub-picture stream number)
    8 LinkPGCN PGC 1
    ********** post commands:
    ********** cell commands:
    I did try and edit line 2 to [51 01 00 80 00 00 00 01] (SetSTN) Set Audio stream = 0 ; LinkTopCell, but that didn't work either.
    VTSM 6 , LU 1 (en) , 14 (dummy) - Chapters: n/a, Programs: 0, Cells: 0
    ********** pre commands:
    1 Set gprm(0) =(mov) 5
    2 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Audio stream = 0 }
    3 Set gprm(2) =(mov) 0
    4 Set gprm(0) =(mov) 0
    5 Set gprm(12) =(mov) sprm(1:Audio stream number)
    6 Set gprm(13) =(mov) sprm(2:Sub-picture stream number)
    7 Set gprm(2) =(mov) 0
    8 Set gprm(7) =(mov) 2
    9 LinkPGCN PGC 1
    ********** post commands:
    ********** cell commands:
    Main Movie.
    VTST 6 , 1 TTN 1 (44:06) Title 1 - Chapters: 13, Programs: 13, Cells: 15
    ********** pre commands:
    1 Set gprm(0) =(mov) 1
    2 Set gprm(0) &=(and) 255
    3 Set gprm(1) =(mov) 1
    4 if ( gprm(0) != gprm(1) ) then { (CallSS) Call the VMGM PGC 3, resume cell 1 }
    5 Goto line 13
    6 Set gprm(0) =(mov) sprm(13:Parental level)
    7 Set gprm(0) &=(and) 15
    8 Set gprm(1) =(mov) 8
    9 if ( gprm(0) >= gprm(1) ) then { Goto line 13 }
    10 (CallSS) Call the VMGM PGC 19, resume cell 1
    11 Goto line 10
    12 NOP
    13 Set gprm(0) =(mov) 1
    14 if ( gprm(8) != gprm(0) ) then { Goto line 19 }
    15 Set gprm(0) =(mov) gprm(13)
    16 Set gprm(0) |=(or) 64
    17 (SetSTN) Set Sub-picture stream = gprm(0)
    18 (SetSTN) Set Audio stream = gprm(12) ; Set Sub-picture stream = gprm(13)
    19 Set gprm(8) =(mov) 0
    20 Set gprm(15) =(mov) 1
    21 Set gprm(5) =(mov) 0
    22 Set gprm(10) =(mov) 1
    ********** post commands:
    1 Set gprm(12) =(mov) sprm(1:Audio stream number)
    2 Set gprm(13) =(mov) sprm(2:Sub-picture stream number)
    3 NOP
    4 Set gprm(10) =(mov) 1
    5 Set gprm(15) =(mov) 0
    6 (CallSS) Call the VTSM Root menu of the current VTS, resume cell 1
    ********** cell commands:
    1 NOP
    Originally the subtitle for English was button 1, but I changed button 1's order to the first audio track, which the command looks like:
    [51 01 00 80 00 00 00 01] (SetSTN) Set Audio stream = 0 ; LinkTopCell
    Quote Quote  
  10. gprm(12) is used to store the audio track number, and it is read to force it in the pre-command 18 of the main movie. So, instead of the SetSTN command given above, you should set GPRM(12) to the value of the audio stream in the button command. Try this:
    Code:
    [71 01 00 0C 00 01 00 01]   1  Set gprm(12) =(mov) 1 ; LinkTopCell
    Again, you may have to change the value 1. I've assumed again the 2nd stream.
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  11. Thank you again. That did it.

    Now button 1 is the default audio stream. Do I still leave it as "(SetSTN) Set Audio stream = 0 ; LinkTopCell" or change it to "Set gprm(12) =(mov) 0 ; LinkTopCell"?

    Also, I noticed that when I choose the second audio stream from the menu, WMP still shows the first audio stream in the audio menu:

    Click image for larger version

Name:	wmp.jpg
Views:	123
Size:	30.9 KB
ID:	15582

    When button 2's command was "(SetSTN) Set Audio stream = 1 ; LinkTopCell", I did noticed it changed to the second audio stream. Is it something I should worry about?

    I checked with another DVD in WMP and when I selected the second audio stream from the menu the second the second audio stream would be selected in the audio stream menu in WMP.
    Last edited by mrcoolekin; 7th Jan 2013 at 11:20.
    Quote Quote  
  12. Yes, change the command.

    I hate and don't use WMP. I don't know why it shows the wrong stream. If you're sure the right stream is playing, don't worry.

    BTW, the right stream is selected only when the main movie is playing. In the menu, the old stream is still "current". That's normal.
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  13. r0lZ thanks once again. All is fine now =).

    Edit: I just compared the button commands and thought I could try and mimic some of the commands.

    This was the menu I was trying to edit

    VTSM 6 , LU 1 (en) , 9 (0:18) 8b. - Chapters: n/a, Programs: 1, Cells: 1
    ********** pre commands:
    1 Set gprm(0) =(mov) 100
    2 if ( gprm(0) == gprm(5) ) then { Goto line 18 }
    3 Set gprm(0) =(mov) sprm(2:Sub-picture stream number)
    4 Set gprm(0) &=(and) 63
    5 Set gprm(1) =(mov) 0
    6 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 1024 (button 1) }
    7 Set gprm(1) =(mov) 1
    8 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 2048 (button 2) }
    9 Set gprm(1) =(mov) 2
    10 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 3072 (button 3) }
    11 NOP
    12 NOP
    13 Set gprm(0) =(mov) sprm(2:Sub-picture stream number)
    14 Set gprm(0) &=(and) 64
    15 Set gprm(1) =(mov) 0
    16 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 4096 (button 4) }
    17 Goto line 19
    18 (SetHL_BTN) Set Highlighted Button =(mov) 6144 (button 6)
    19 NOP
    ********** post commands:
    1 LinkCN Cell 1
    ********** cell commands:

    ********** menu buttons commands:
    VOB ID 4, Cell ID 1 (First NAV pack LBA=1113)
    2 Groups, Select button=0, Action button=0, 8 numerically selectable buttons.
    1: Set gprm(2) =(mov) 1 ; LinkPGCN PGC 11
    2: Set gprm(2) =(mov) 2 ; LinkPGCN PGC 11
    3: Set gprm(2) =(mov) 3 ; LinkPGCN PGC 11
    4: Set gprm(2) =(mov) 5 ; LinkPGCN PGC 11
    5: Set gprm(2) =(mov) 0 ; LinkPGCN PGC 1
    6: Set gprm(2) =(mov) 0 ; LinkPGCN PGC 16
    I noticed that PGCN 10 was not never linked in any of the other PGCN. I decided to use that.
    VTSM 6 , LU 1 (en) , 10 (dummy) - Chapters: n/a, Programs: 0, Cells: 0
    ********** pre commands:
    1 Set gprm(5) =(mov) 99
    2 Set gprm(0) =(mov) sprm(2:Sub-picture stream number)
    3 Set gprm(0) =(mov) 1
    4 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Audio stream = 0 }
    5 Set gprm(0) =(mov) 0
    6 Set gprm(1) =(mov) 0
    7 Set gprm(2) =(mov) 0
    8 Set gprm(12) =(mov) sprm(1:Audio stream number)
    9 Set gprm(13) =(mov) sprm(2:Sub-picture stream number)
    10 LinkPGCN PGC 9
    ********** post commands:
    ********** cell commands:
    I decided to edit PGCN 10 like:
    VTSM 6 , LU 1 (en) , 10 (dummy) - Chapters: n/a, Programs: 0, Cells: 0
    ********** pre commands:
    1 Set gprm(5) =(mov) 99
    2 Set gprm(0) =(mov) sprm(2:Sub-picture stream number)
    3 Set gprm(0) =(mov) 1
    4 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Audio stream = 0 }
    5 Set gprm(0) =(mov) 2
    6 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Audio stream = 1 }
    7 Set gprm(0) =(mov) 0
    8 Set gprm(1) =(mov) 0
    9 Set gprm(2) =(mov) 0
    10 Set gprm(12) =(mov) sprm(1:Audio stream number)
    11 Set gprm(13) =(mov) sprm(2:Sub-picture stream number)
    12 LinkPGCN PGC 9
    ********** post commands:
    ********** cell commands:
    Then made my buttons 1 and 2 like:
    1: Set gprm(2) =(mov) 1 ; LinkPGCN PGC 10
    2: Set gprm(2) =(mov) 2 ; LinkPGCN PGC 10
    It works just the same. Just by messing around and trying to mimic a few commands can help you a lot. Now WMP chooses the correct track and stays that way. Now I just hope I didn't break anything, hahahaha.
    Last edited by mrcoolekin; 7th Jan 2013 at 18:03.
    Quote Quote  
  14. Hm......I was testing out my 1st and 2nd disc and just realized something odd. I play the 2nd audio stream and after the movie ends, I play the movie again, but the dvd reverts back to the 1st audio stream. It's only happening to this particular title that does this on both discs. If I choose the 2nd audio stream and the movie ends, but choose a different title after the movie, the different movie will play with the 2nd audio stream.

    I used trace on that VTSM and compared it to the other VTSM on the DVD, but I couldn't find anything odd about it. They look pretty much the same, so I'm not sure why it's happening. Can anyone direct me in the right direction, so I can get this fixed? Thanks.
    Quote Quote  
  15. I have just seen your edit of post #13, as it was en edit, and I have not been automatically noticed of the change. Good work! It's the way to go.

    About your post #14, it's usually what happens when the audio (or subtitle) stream is not set directly with a SetSTN command in the audio/subtitle menu, but stored in a GPRM. The GPRM doesn't change when you select another stream during the playback of the movie, and therefore, the stream number stored in the GPRM is forced again when the title is played the second time.

    If the stream is correct when you play another title after the main movie, it's probably because the bonus has not the same streams, and therefore the authoring has to select automatically another one. It is intelligent enough to store the current stream number again in the GPRM, so that it is correctly restored when the main movie is played again.

    The audio stream number to use when a Title is played is stored in SPRM 1. That SPRM is modified when a SetSTN command is executed. With some players, it is also modified automatically when a title is played and that title has a number of streams less than the current stream number stored in SPRM 1. (For example, if the title has only 1 audio stream and the value of SPRM 1 is 2, the player cannot use stream #2 as it doesn't exist, and it uses stream #0. Some players change the value of SPRM 1 accordingly, but other ones do not that.)

    Note that SPRM 1 is never used or changed when a menu is played, as a menu can only have one audio stream, and that stream is always played, regardless of the value of SPRM 1. Of course, if a menu command issues a SetSTN, the value of SPRM 1 is updated accordingly, and will be used the next time a Title is played.

    It's because SPRM 1 is subject to change that many authoring programs store the stream number in a GPRM. The GPRMs are never changed automatically, and therefore their values can be controlled precisely by the author.

    To fix your problem, you should therefore be sure that the value of the GPRM is updated when the user has selected another stream during the playback of the main movie. When the title has finished playing, you should store the current stream number in the GPRM. That's relatively easy to do. Just add this command as the first post-command of the main movie:
    Code:
    [61 00 00 0C 00 81 00 00]   1  Set gprm(12) =(mov) sprm(1:Audio track number)
    That will work if the title is played up to its end, and never interrupted. Unfortunately, that will not work if the user calls the menu with the Root or Title menu button, as in that case, the title is interrupted, and the post-commands are never executed. So, to fix the problem for the Root Menu button, you should also add the same command as the first pre-command of the RootM PGC of the VTS containing the main movie.

    It is much more difficult to be sure that the GPRM gets updated if the user presses the Title (or Top) Menu button, as in that case, the TitleM PGC of the VMGM is called, and you cannot use a SetSTN command in the VMGM. Also, the TitleM can be called from any VTS, and therefore saving the current stream in the GPRM doesn't make sense.

    Check carefully if the correct stream is selected when you play the movie twice, and when you play a bonus. The position where you must insert the command above may depend of the authoring. For example, if the RootM PGC of the main movie VTS is called when the nav returns to the menu from a bonus, the trick will not work, as the stream used for the playback of the bonus will be stored in the GPRM, and overwrite its correct value.

    In post #9 above, I notice this pre-command in the RootM PGC:
    Code:
    3  if ( gprm(8) == gprm(0) ) then { (SetSTN) Set Audio stream = gprm(12) ; Set Sub-picture stream = gprm(13) }
    It appears that the streams of the main movie are set according to the value of GPRMs 12 and 13 only when GPRM 8 and 0 have the same value. Without the DVD, I can only guess that GPRM 8 holds a certain value when the main movie has been played. If the command I gave you above doesn't work well when the title is interrupted, try to insert this one in the RootM PGC:
    Code:
    [61 20 08 0C 00 81 00 00]   1  if ( gprm(8) == gprm(0) ) then { Set gprm(12) =(mov) sprm(1:Audio track number) }
    With that command, I hope the stream number will be stored in GPRM 12 only when it's really necessary.

    Good luck!
    Last edited by r0lZ; 18th Jan 2013 at 04:34.
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  16. I just figured something out, but it's not a fix. It's more of a revelation. In my language menu I have a my languages and subtitles list along with a resume button. I normally just click on the language I want and click resume to play the movie. After the movie ends the DVD goes to the sub menu (I think) to choose to play the movie, go to the language menu, or chapter menu. It's whenever I click on the "Play Episode" button on that menu that it defaults audio stream 0. Is the fix still the same as the above? I did run trace again to figure it out, but darn it, I was too complicated for me. I did understand some of it, but others were too confusing. I've attached the backup for the modified DVD just in case.
    Image Attached Files
    Quote Quote  
  17. I think I've located the bug. It happens (probably) only when episode 2 is played. With the other episodes, everything should be OK.

    I've also used the trace to try to understand how the streams are set and remembered, and I did notice something strange.
    In VTSM 6, 1, 1, pre-command 4 checks if the value of gprm(12) is 3, and if it's the case, it jumps to line 16, where the gprm is reset to 0, and the audio stream set to #0 with the next SetSTN command. However, if I understand the navigation correctly, gprm(12) CANNOT have the value 3, since there are only maximum 2 audio streams (#0 and #1) in the episodes. So, the reset of gprm(12) is never executed. So far so good.

    But in VTSM 7, 1, 1, the PGC has exactly the same structure, except that in line 4, gprm(12) is compared with 1 instead of 3. So, if you have forced stream #1, and that episode is played (and it's episode #2), the stream IS reset to #0. IMO, it's a bug, and you should try to replace the 1 with 3 in the condition of line 4.

    VTSM 8, 1, 1 is normal again, and correctly uses the value 3 in the comparison.

    BTW, gprm(12) is also set in VMGM 1, 7, to 0. It's the default value when the DVD is inserted. You can change it to 1 if you prefer to have stream #1 as default.

    Don't be scared by the complexity of the authoring. Indeed, it is complex. Unfortunately, it's often the case with commercial DVDs, authored automatically with complex authoring programs. They do usually a lot of useless things, such as comparing a gprm with a value that it cannot contain! (Personally, when the authoring is too complex, I redo it from scratch, but I can't explain that. It's also complex, and time consuming, but at least, I understand what I am doing!)
    Last edited by r0lZ; 19th Jan 2013 at 10:51.
    r0lZ - PgcEdit homepage Hosted by VideoHelp (Thanks Baldrick)
    - BD3D2MK3D A tool to convert 3D BD to 3D SBS/T&B/FS MKV
    Quote Quote  
  18. r0lZ, I thank you once again. I think I can finally move on with my project and have it as perfect as I want it. I did try and figure it out myself, but obviously I couldn't. I am still learning and glad you helped me with this. Have a wonderful weekend.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!