Log in

View Full Version : VM commands for creating multiple audio and subtitle tracks


kenno7
14th August 2006, 09:14
Hello, I am currently creating a dvd.
The dvd has 3 Audio tracks and 1 subtitle track.

I am currently trying to use the guide in the link below.

http://www.mediachance.com/dvdlab/tutorial/amanager.html

I have done everything up to the VM Commands, but am unsure how to do them as the guide does not give a very comprehensive guide for the VM Commands..
This is what I have done for the precommands of each menu:

A1S0

GPRM0 = 0
SetSTN (subp=GPRM0:off )
SetSTN (audio=GPRM0 )


A2SO

GPRM1 = 0
SetSTN (subp=GPRM1:off )
SetSTN (audio=GPRM1 )


A3S0

GPRM2 = 0
SetSTN (subp=GPRM2:off )
SetSTN (audio=GPRM2 )


A1SL

GPRM0 = 0
GPRM3 = 64
SetSTN (subp=GPRM3:off )
SetSTN (audio=GPRM0 )


A2SL

GPRM1 = 0
GPRM3 = 64
SetSTN (subp=GPRM1:off )
SetSTN (audio=GPRM1 )


A3SL

GPRM2 = 0
GPRM4 = 64
SetSTN (subp=GPRM2:off )
SetSTN (audio=GPRM2 )

And these are the commands I made for the selector..

GPRM0 = 1024
SetHL_BTN GPRM0
GPRM0 = SPRM1
GPRM1 = SPRM2
GPRM2 = SPRM3
GPRM0 *= 100
GPRM0 += GPRM1
GPRM1 += GPRM2
if (GPRM0 == 64) LinkPGCN 5
if (GPRM0 == 65) LinkPGCN 6
if (GPRM0 == 100) LinkPGCN 4
if (GPRM0 == 164) LinkPGCN 7
if (GPRM0 == 165) LinkPGCN 8
LinkPGCN 3

None of this works at all at the moment, and I can't figure out how to do it..

Can anyone help me??

Thanks :)

mp3dom
14th August 2006, 20:43
There are some errors in your script.
GPRM0 is used to keep the number of the audio stream so in every precommand of every menu you need to change the GPRM0 with the appropriate value.
GPRM1 is used to store the subpicture value (subtitles)
Also SPRM3 is not necessary since it keeps the number of angles (that you don't use)
Anyway, here: http://www.mediachance.com/dvdlab/tutorial/manager_rp.htm
you can find the complete project with pre/post commands of every menu and relative button links.

kenno7
18th August 2006, 05:11
Hey! Thanks alot for that :)
I now have the subtitles working!!

The only thing that I dont have working is the Selector...
I am still confused to as what:

GPRM0 *= 100
GPRM0 += GPRM1
if (GPRM0 == 64)
if (GPRM0 == 65)
if (GPRM0 == 100)

etc all means...

Thanks :)

Susana
18th August 2006, 12:21
SPRM#2 uses 7 bits. [b_6 b_5 b_4 b_3 b_2 b_1 b_0]

b_4 to b_0 specify 32 streams:
0 0 0 0 0 :stream 0
0 0 0 0 1: stream 1
0 0 0 1 0: stream 2
.........................
1 1 1 1 0: stream 30
1 1 1 1 1: stream 31

b_5: used for forced subpicture
0 1 1 1 1 1 1: 63 (decimal) = dummy stream for forced subpicture

b_6: 1 (subpicture ON) ; 0 (subpicture OFF)

So, for example:
1 0 0 0 0 0 0 = 64 (decimal) = stream 0 ON
0 0 0 0 0 0 1 = 1 (decimal) = stream 1 OFF

The initial value of this system register is:
if subtitles OFF in player setup: 0 1 1 1 1 1 0 = 62 (decimal)
if subtitles ON in player setup: 1 1 1 1 1 1 0 = 126 (decimal)

As well as ON/OFF, in player setup you specify subtitle language.

SPRM#1 uses 4 bits. [b_3 b_2 b_1 b_0]

b_2 to b_0 specify 8 streams:
0 0 0 :stream 0
0 0 1: stream 1
0 1 0: stream 2
.........................
1 1 0: stream 6
1 1 1: stream 7

Default value: 1 1 1 1 = 15 (decimal)

mp3dom
18th August 2006, 20:52
SPRM1 is the system register that contain the current audio track (if you modify the register then you change the audio track!). The same apply to SPRM2 which contain the subpicture stream. While SPRM1 go from 0 to 7 (audio 1 is number 0 and audio 8 is number 7) the SPRM2 register go from 0 to 31 (tracks not visible) and from 64 (track 1 visible) and over. Value from 0 to 31 are mainly useful for Forced Subs (it will be displayed only the forced subs of the selected track). In the tutorial, in every menu, they save in GPRM0 the value of the audio and in GPRM1 the value of the subpicture that will be assigned to the system registers (so this allow to change audio/subs). In the setup entry they make a "combination" to know which audio/subs you have active to redirect to the right menu.
Step by Step:

GPRM0 = 1024
SetHL_BTN GPRM0
: This is for highlight button 1

GPRM0 = SPRM1
GPRM1 = SPRM2
: Retrieve the current audio/subpic settings

GPRM0 *= 100
GPRM0 += GPRM1
: Since you cannot do a "If (audio=X AND subpic=Y) then..." you need to calculate an "unambiguos" value that can display both audio and subs. So they multiply the audio track by 100 (if track is 1 you still have 0 in GPRM0, viceversa you've 100). They also add to this value, the value of GPRM1 (the subpic). GPRM1 in this case can assume values of 0 (no sub), 64 (sub 1 ON) or 65 (sub 2 ON). At the end in GPRM0 you'll have 0, 64 or 65 if you have audio 1 AND (respectively) no sub, sub1: on or sub2: on. Values of 100, 164 or 165 if you have audio 2 AND (respectively) no sub, sub1: on or sub2: on. Then, regarding the final value, they redirect to the right menu. Hope this helps.

kenno7
11th September 2006, 14:34
thanks for that guys :)

I should be right with it now!