Forum Index


Support myDVDEdit

Register Register
Log in Log in

Search Search
FAQ FAQ



--- Links ---
MacEtVideo
VideoHelp
Forum Mac-Video
 
In main menu, how to auto-play film after 10 sec delay?
Forum Index -> Questions
Reply to topic
View previous topic :: View next topic  
Author Message
shanda_an
Member
Member   



Joined: 04 Mar 2011
Posts: 4

PostPosted: Fri 04 Mar 2011, 20:04 Reply with quote

I found myDVDEdit after struggling with the counterintuitive emasculated awfulness that is iDVD.

Thanks Monsieur Jérôme Cabanis, for a wonderfully easy-to-use, useful, low-level application.

The DVDs I am making are to make it easy to watch the 50-episode anime series "Eureka Seven".

Each DVD has 5 episodes, and I used myDVDEdit to make all 5 play in sequence if you chose the first on the list. (see "Simply way to play multiple VOB's/Titles in a row?" http://www.mydvdedit.com/viewtopic.php?t=129&pg=forum)

*** OK. Now -- super elegant! -- how do I get the DVD to start playing the first episode in the list automatically, after say, 10 seconds? ***

(I have googled around, but only find explanations on how to get a movie playing first thing from DVD without any menu appearing.)
_________________
"You think this fluffy let's-eat-a-giant-chocolate-cake-in-a-house-made-of-candy-surrounded-by-a-field-of-flowers story is the best? Personally, I thought it sucked!" -- Fukada-san, from "Bakuman" episode 22.
Back to top
View user's profile Send private message
Jerome
Administrator
Administrator   



Joined: 18 Jul 2005
Posts: 460
Location: France

PostPosted: Fri 04 Mar 2011, 20:11 Reply with quote

What do you want to see during this 10s, the menu ? or a picture ?
Back to top
View user's profile Send private message Visit poster's website
shanda_an
Member
Member   



Joined: 04 Mar 2011
Posts: 4

PostPosted: Fri 04 Mar 2011, 21:40 Reply with quote

Jérôme wrote:
What do you want to see during this 10s, the menu ? or a picture ?


The menu. If you insert the DVD and the menu comes up, and you don't choose anything, after 10 seconds the first episode on the list should just start playing for you. Quite a few young children's DVDs are like this. It's especially useful if the episodes are effectively chapters in a big long linear story, like anime is. (So delayed auto-play is not so useful a feature for a DVD of, say, South Park episodes.)
_________________
"You think this fluffy let's-eat-a-giant-chocolate-cake-in-a-house-made-of-candy-surrounded-by-a-field-of-flowers story is the best? Personally, I thought it sucked!" -- Fukada-san, from "Bakuman" episode 22.
Back to top
View user's profile Send private message
Jerome
Administrator
Administrator   



Joined: 18 Jul 2005
Posts: 460
Location: France

PostPosted: Fri 04 Mar 2011, 23:20 Reply with quote

Depends on what kind of menu yo have, and how it works.

- Animated menu or single picture ?
- what is the command in the buttons ?
    Link TailPgc
or
    Rx = n, Link TaiPgc
or
    Link Pgc x
or
    Jump Title
or
    something else

if it's a animated menu, how long is the video ?

As you can see, the answer is not easy and depends on many parameters.
Back to top
View user's profile Send private message Visit poster's website
shanda_an
Member
Member   



Joined: 04 Mar 2011
Posts: 4

PostPosted: Wed 09 Mar 2011, 01:08 Reply with quote

Jérôme wrote:
Depends on what kind of menu yo have, and how it works.

- Animated menu or single picture ?
- what is the command in the buttons ?
Link TailPgc
or
Rx = n, Link TaiPgc
or
Link Pgc x
or
Jump Title
or
something else

if it's a animated menu, how long is the video ?

As you can see, the answer is not easy and depends on many parameters.


Hmmmm.......

I looked through one of the DVDs I was making with the ever-awful iDVD. By that, I mean I stepped through the VIDEO_TS saved by iDVD 7 in myDVDEdit several times round and round (pretending to choose episodes) getting the feel of where the menu choice takes place. A lovely debugger, by the way, with the mock-up remote control. On my DVD, I *think* I pinned it down to VTS Menu 1 Pgc 7. Here are the pre- and post- codes for the point where choosing a menu item with the enter button gets registered:

VTS Menu 1 Pgc 7 Pre Cmds:-

1 Nop
2 Nop
3 Nop
4 Nop
5 Nop
6 R6 = $F805
7 R0 = R4
8 R0 &= 63
9 if(R0 != 0) Goto 11
10 R0 = 5
11 R0 &= 63
12 R0 *= $0400
13 Nop
14 R3 = 1
15 highlightedButton = R0
16 R1 = 0
17 R4 &= $8000
18 if(R4 == $8000) Link Cell 2


VTS Menu 1 Pgc 7 Post Cmds:-

1 R3 = 0
2 R0 = highlightedButton
3 R0 /= $0400
4 if(R0 != 1) Goto 8
5 Link Pgc 12
6 Nop
7 Nop
8 if(R0 != 2) Goto 12
9 Link Pgc 12
10 Nop
11 Nop
12 if(R0 != 3) Goto 16
13 Link Pgc 12
14 Nop
15 Nop
16 if(R0 != 4) Goto 20
17 Link Pgc 12
18 Nop
19 Nop
20 if(R0 != 5) Goto 24
21 Link Pgc 12
22 Nop
23 Nop
24 if(R0 != 6) Goto 28
25 Link Pgc 12
26 Nop
27 Nop
28 Nop

Cell 2 show the menu "assembling itself" and waits till you choose a menu item. Beyond this, and the obvious relevance of "R0 = highlightedButton", I cannot really fathom in full detail what is going on. I do know that, eventually, in VMG Menu PGC 2, the register R0 gets decoded (or "deconstructed", if I were writing a PhD?) into the relevant episode title, and the that title is run. iDVD is an awkward bastard -- defective by design -- it scrambles the order of the titles in relation to their corresponding position in the menu item list (For those browsing this forum thread in search of answers, bear in mind this DVD VIDEO_TS folder was created by iDVD 7.)

Jérôme, is there an easy way to introduce an automatic delayed menu choice? I hope I've given enough information. I'm really intrigued by the DVD opcode language now, and wonder what the answer will be. My guess is that at the outset, you set a register to a future time and then compare with a timer in the pre- section.

Anyway, I'm looking forward to your reply!

With kind regards,

Shanda An
_________________
"You think this fluffy let's-eat-a-giant-chocolate-cake-in-a-house-made-of-candy-surrounded-by-a-field-of-flowers story is the best? Personally, I thought it sucked!" -- Fukada-san, from "Bakuman" episode 22.
Back to top
View user's profile Send private message
Jerome
Administrator
Administrator   



Joined: 18 Jul 2005
Posts: 460
Location: France

PostPosted: Thu 10 Mar 2011, 11:02 Reply with quote

How this code works:

Pre-commands:
forget R1, R3 and R6, these registers should be used in an other part of the DVD.
Before entering this code, R4 must be set to the button index to highlight.

line 7: R0 = R4
As often, R0 is used for temporary operations, and the other registers to save values along the execution of the DVD.

8: R0 &= 63
9: if(R0 != 0) Goto 11
10: R0 = 5

63 = 0x3F (hexa). This operation is a bit mask, to hide unused bits. only the 7 firsts bits are conserved.
0 is a special value for 'default button', if R0=0, the index is replaced with the default button index, 5 in this case.

10 R0 &= 63. bit mask again, unnecessary in our case (don't forget, this is a automatic code generation)

12 R0 *= $0400
15 highlightedButton = R0

Set the highlighted button.
if you look my DVD documentation, you will see that highlightedButton must contain the value $400 to highlight button 1, $800 for button 2, etc...
the multiplication by $400 is here to transform the button index to the correct value.

17 R4 &= $8000
An other bit mask, now to test the 32th and last bit of R4

18 if(R4 == $8000) Link Cell 2
If this bit is set to 1, the cell 1 is not displayed and the menu start directly with cell 2
This is often used in menus to show a short video the first time the menu is called and not the other times.
Back to top
View user's profile Send private message Visit poster's website
Jerome
Administrator
Administrator   



Joined: 18 Jul 2005
Posts: 460
Location: France

PostPosted: Thu 10 Mar 2011, 11:23 Reply with quote

You didn't tell me but I guess that all button commands are
Link TaillPgc

this command stop the video and jump to the post commands.

I think you should have a Cell command too, set to the last cell of the Pgc. The cell command should be Link Cell 2, and is used to loop to the second part of the menu.

Post commands:

Post commands are called when a menu command is selected. Now the program must know witch button is selected and do what is necessary.

1 R3 = 0
R3 is used to know if we are in the menu display or not. It was set to 1 in pre commands, and reseted here. This should be useful in some specific case.

2 R0 = highlightedButton
3 R0 /= $0400
We get the highlighted button and, as explain before, transform the value to a button index.

4 if(R0 != 1) Goto 8
5 Link Pgc 12
...

You can compare these commands with the 'Switch' in C (if you know)
The possible values are tested and the corresponding Pgc is called.
I guess you do the same things in all cases because this is a DVD for tests.
Back to top
View user's profile Send private message Visit poster's website
Jerome
Administrator
Administrator   



Joined: 18 Jul 2005
Posts: 460
Location: France

PostPosted: Thu 10 Mar 2011, 13:11 Reply with quote

Now how to modify this code to execute a code automatically after a while.

I think the best solution is to do what is often done in the commercial DVDs, waiting after a defined count of loop.

exemple:
Your menu have two parts, the 'first time video' and the 'menu video'.
If the 'first time video' lasts 10 seconds, and the 'menu video' lasts 30 seconds, you could wait the second loop, so 10 + 30 + 30 = 70 seconds to start the movie automatically.

How to do that:

1) Add a register initialization in pre commands.

17 R8 = 2
Why R8 ?, why not ?, Just to be sure the DVD do not already use this register. If it is the case, choose a other register.
This register will be our loop counter. I set it to 2 because I want two loops. change this value to wait more or less time.

I will use R3 for a new usage. As you could see, R3 is set to 1 in pre commands and reset in post command, so, normally, it always must be set to 1 when the first post command is executed.

2) Cell command:
The cell command is used to do the loop. unlike pre and post commands, you cannot chain several commands in cell commands. each cell can execute one command and only one.
fortunately some commands are powerful and can do several things at once.

Replace the cell command with
R3 = 0, Link TailPgc

As we have to execute several command, we change the link to the Post commands, but before, we reset R3 to signal that this call is not from a button command.
A other solution is to jump to a other PGC, but this solution is slower and you risk to see a long pause before the menu loop.

3) Post command
Insert these commands at the begin of post commands.

1 if(R3 != 0) Goto 7
2 R8 -= 1
3 if(R8 != 0) Goto 5
4 Jump Title 1
5 R3 = 1
6 Link Cell 2

Explanations:

1 if(R3 != 0) Goto 7
if R3 is not null, the call is from a button command, otherwise it come from the cell command

2 R8 -= 1
We decrement R8

3 if (R8 != 0) Goto 5
5 R3 = 1
6 Link Cell 2
if R8 is not null, we need to continue and loop to the begin of the menu video. before, R3 must be set to 1 again.

4 Jump Title 1
Otherwise, we do what we have to do. In my sample, I start playing the movie. Change this command to your liking.


These changes are adapted to iDVD projects. In other situations, they must be different but I think other cases should be easier to change (I really do not like how Apple manage the menus in iDVD).

Remarque:
The loop count is only necessary if you want a loop. If you just want start the movie at the end of the menu, just change the cell command to Jump Title 1 or Link Pgc n, and forget all the rest.


Jerome
Back to top
View user's profile Send private message Visit poster's website
shanda_an
Member
Member   



Joined: 04 Mar 2011
Posts: 4

PostPosted: Sat 12 Mar 2011, 01:10 Reply with quote

I am studying what you have written. In studying your notes (If I were a cow I would call it "chewing the cud") and looking back and forth at my DVD VIDEO_TS generated by iDVD 7, I decided to collect and format all the code together in one long file. It's of the last DVD in the collection I'm making, and only has two episodes ("Titles") on the menu.

To whom it may concern, then, here is that iDVD-7 generated code (actually very slightly hand modified by myself, so as to play all episodes after episode 1). I hope the indentation is self-explanatory and helpful:

Code:

[First Play]
   
    [Pre-]
   
    R5 = $2000
    R2 = 5
    Jump VTS Menu 1, Menu root


[VMG Menu]

    [PGC 1, Title]
   
        [Pre-]
       
        R4 = 1
        R1 = 1
        Jump VTS Menu 1, Menu root
   
    [PGC 2]
   
        [Pre-]
       
        R1 = 0
        R2 = 0
        if(R3 & $FF00) Goto 5
        Goto 8
      5 R5 = R3
        R5 /= $0100
        R3 &= 255
      8 if(R3 >= 3) Link Pgc 3
        R0 = 1
        if(R0 == R3) Jump Title 1
        R0 = 2
        if(R0 == R3) Jump Title 2
        Jump First Play
   
    [PGC 3]
   
    [PGC 4]
   
        [Pre-]
       
        R5 = 0
        R2 = 0
        if(R1 >= 3) Goto 5
        Jump VTS Menu 1, Menu root
      5 Jump VTS Menu 2, Menu root
        Jump First Play
   
    [PGC 5]
   
    [PGC 6]
   
        [Pre-]
       
        R5 = 0
        R1 = 0
        if(R2 >= 6) Goto 5
        Jump VTS Menu 1, Menu root
      5 Jump VTS Menu 2, Menu root
        Jump First Play
   
    [PGC 7]
   
    [PGC 8]
   
        [Pre-]
       
        R0 = R2
        R2 = 0
        if(R0 != $FFF0) Goto 5
        Resume
      5 R3 = R0
        R3 &= $F800
        if(R3 != $F800) Goto 15
        R3 = 0
        R2 = R0
        R2 &= $07FF
        if(R2 >= 6) Link Pgc 7
        Link Pgc 6
        Nop
        Nop
     15 R3 = R0
        R3 &= $C000
        if(R3 != $C000) Goto 30
        R3 = 0
        R3 = R0
        R3 &= $3F80
        R3 /= 128
        R5 = R0
        R5 &= 127
        R5 += 1
        Link Pgc 2
        Nop
        Nop
        Nop
        Nop
     30 R3 = 0
        R1 = R0
        R1 &= $FFE0
        R1 /= 32
        R4 = R0
        R4 &= 31
        R4 += 1
        if(R1 >= 3) Link Pgc 5
        Link Pgc 4
   
    [PGC 9] -- added a new PGC !!!
   
        [Pre-]
       
        Jump Title 2


[VTS Menu 1]

    [PGC 1, Root]
   
        [Pre-]
       
        if(R5 == $4000) Link Pgc 3
        R5 = 0
        if(R1 != 0) Link Pgc 6
        if(R2 != 0) Link Pgc 5
        R0 = vstTitle
        R0 *= $0100
        R0 |= chapter
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        if(R0 >= 'ee') Goto 21
        Link Pgc 10
        Nop
        Nop
     21 Nop
        Resume
   
    [PGC 2]
   
        [Pre-]
       
        R3 = $0101
        Jump VMG Menu Pgc 2
   
    [PGC 3]
   
    [PGC 4]
   
    [PGC 5]
   
        [Pre-]
       
        R0 = R2
        R2 = 0
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        if(R0 == 1) Link Pgc 10
        if(R0 == 2) Link Pgc 11
        if(R0 == 3) Link Pgc 12
        if(R0 == 4) Link Pgc 13
        if(R0 == 5) Link Pgc 14
   
    [PGC 6]
   
        [Pre-]
       
        R0 = R1
        R1 = 0
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        if(R0 == 1) Link Pgc 7
        if(R0 == 2) Link Pgc 8
   
    [PGC 7]
   
        [Pre-]
       
        Nop
        Nop
        Nop
        Nop
        Nop
        R6 = $F805
        R0 = R4
        R0 &= 63
        if(R0 != 0) Goto 11
        R0 = 2
     11 R0 &= 63
        R0 *= $0400
        Nop
        R3 = 1
        highlightedButton = R0
        R1 = 0
        R4 &= $8000
        if(R4 == $8000) Link Cell 2
       
        [Post-]
       
        R3 = 0
        R0 = highlightedButton
        R0 /= $0400
        if(R0 != 1) Goto 8
        Link Pgc 12
        Nop
        Nop
      8 if(R0 != 2) Goto 12
        Link Pgc 12
        Nop
        Nop
     12 Nop
   
    [PGC 8]
   
        [Pre-]
       
        Nop
        Nop
        Nop
        Nop
        Nop
        R6 = 64
        R0 = R4
        R0 &= 63
        if(R0 != 0) Goto 11
        R0 = 1
     11 R0 &= 63
        R0 *= $0400
        Nop
        R3 = 2
        highlightedButton = R0
        R1 = 0
       
        [Post-]
       
        Link Pgc 13
   
    [PGC 9]
   
    [PGC 10]
   
        [Pre-]
       
        R8 = R9
        if(R10 == $F805) Link Pgc 14
        Link Pgc 14
   
    [PGC 11]
   
        [Pre-]
       
        R10 = $F805
        R4 = 1
        if(R8 == $0400) Link Pgc 7
        R4 = 2
        if(R8 == $0800) Link Pgc 7
   
    [PGC 12]
   
        [Pre-]
       
        R8 = 0
        R9 = highlightedButton
        R4 = 0
        Link Pgc 8
   
    [PGC 13]
   
        [Pre-]
       
        R5 = 1
        R3 = 2
        R0 = $0400
        if(R9 == R0) Jump VMG Menu Pgc 2
        R5 = 1
        R3 = 1
        R0 = $0800
        if(R9 == R0) Jump VMG Menu Pgc 2
   
    [PGC 14]
   
        [Pre-]
       
        R10 = $F805
        R4 = 1
        if(R8 == $0400) Link Pgc 7
        R4 = 2
        if(R8 == $0800) Link Pgc 7
        R4 = 0
        Link Pgc 7


[VTS 1] -- "Title 1"

    [PGC 1, VTSTitle 1]
   
        [Pre-]
       
        Nop
        Nop
        Nop
        Nop
        Nop
        R6 = $C080
        R7 = R6
        R0 = R5
        R5 = 0
        R1 = 0
        R2 = 0
        if(R0 == 1) Break
       
        [Post-]
       
        R2 = 1
        Call VMG Menu Pgc 9, ResumeCell 1  -- modified this line: Pgc 6 -> Pgc 9 !!!


[VTS Menu 2]

    [PGC 1, Root]
   
        [Pre-]
       
        R5 = 0
        if(R1 != 0) Link Pgc 5
        if(R2 != 0) Link Pgc 4
        Nop
        R0 = vstTitle
        R0 *= $0100
        R0 |= chapter
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        Nop
        if(R0 >= 'ee') Goto 21
        R2 = 1
        Jump VMG Menu Pgc 6
        Nop
     21 Nop
        Resume
   
    [PGC 2]
   
    [PGC 3]
   
    [PGC 4]
   
    [PGC 5]


[VTS 2] -- "Title 2"

    [PGC 1, VTSTitle 1]

        [Pre-]
       
        Nop
        Nop
        Nop
        Nop
        Nop
        R6 = $C100
        R7 = R6
        R0 = R5
        R5 = 0
        R1 = 0
        R2 = 0
        if(R0 == 1) Break
       
        [Post-]
       
        R2 = 1
        Call VMG Menu Pgc 6, ResumeCell 1
       

_________________
"You think this fluffy let's-eat-a-giant-chocolate-cake-in-a-house-made-of-candy-surrounded-by-a-field-of-flowers story is the best? Personally, I thought it sucked!" -- Fukada-san, from "Bakuman" episode 22.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Forum Index -> Questions Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2017 phpBB Group