用DVDAuthor制作一张影视DVD

Totem,mplayer,sopcast,realplayer,bmp
回复
pinkme005
帖子: 11
注册时间: 2013-01-06 20:43
系统: LFS

用DVDAuthor制作一张影视DVD

#1

帖子 pinkme005 » 2018-01-14 10:39

目前DVD制作软件形形色色,功能异常强大,试用过锐动天地和TMPG Enc Authoring制作,效果都不理想,对DVD结构的控制能力不够,制作普通家用的DVD还是不错,难以实现准商业化的DVD制作和逻辑跳转。本次选中自由软件DVDAuthor来完成制作工作,也曾尝试GUI For DVDAuthor,但折腾了几把,没有学会怎么用它,只好放弃,采用纯命令行的方式进行。
一、准备工作
1、软件准备:DVDAuthor、MjpegTools、DVDReMakePro、PS软件(我用美图秀秀和GIMP)、转码编辑软件(锐动天地、TMPG Enc Authoringn或Mencoder都行),DVDAuthor和MjpegTools是必备软件,PS和转码编辑软件选自己顺手的,DVDReMakePro用于制作调试和校对。因为我不会PS,所以我选择用AUTOCAD来绘制和准确定位菜单。
2、知识准备:(1)推荐熟读DVDAuthor官方文档,重点掌握1. Examples和I. DVDAuthor Man Pages(DVDAuthor、spumux)这两部分内容,这是最准确、最权威的制作文档,所有的操作规范和要求都包含在里面,需要细细品读、认真领悟、体察入微,否则入坑是一定的;(2)《Some thoughts on DVD authoring》(James Tappin,24 Apr 2003),主要帮助理解VMGM和VTSM的跳转规则,里面有一些spumux和DVDAuthor的实例,可以辅助理解VMGM、VTSM和Title互跳规则; (3)《Creating a DVD with a menu》(mythtv.org/wiki),主要学习用jpeg2yuv合成DVD菜单,里面包含了N制和P制示例,非常实用;(4)《How to author a DVD in Linux》(Kirk Bauer),主要学习逻辑控制。
二、DVD的结构和参数
1、光盘结构。一张DVD主要由VMGM和TitleSet两部分构成,组织层级:VMGM->TitleSet->titles(menus)->PGC->VOB(title,chapter,cell)->Button->操作式(if else +/-)。VMGM类似于DVD光盘的引导区,DVD播放器从VMGM开始读取一张光盘的内容,VGMG完成片头CG菜单和TitleSet内容的链接指向和关键逻辑控制;TitleSet为titles合集,在物理结构上与VMGM同级,在实际操作中通常做为VMGM的下级菜单使用,在VMGM中跳转或链接到TitleSet中的首菜单(TitleSet Menus)或第一章节内容(Title 1、Chapters 1);按照官方文档的说法,一张光盘可包含最多一个VMGM和多个TitleSet,VMGM和TitleSet均可包含0个或多个菜单,一个TitleSet包含最多一个titles标识。
2、菜单(Menus)和标题(Titles)。菜单(Menu)做为DVD光盘内容的索引,实质上是一个带强制显示字幕的mpeg视频文件,因此在spumux配置文件中有force="yes"参数,最多可包含video、audio、subpicture各一个和多个pgc,在物理结构上由相当数量的可点击、可选择的按钮(Button)构成,这些按钮由pgc组织起来,按钮指向TitleSet、Menu、Title和Chapter实现点击链接;Titles负责组织所在TitleSet的所有内容,包含1个video、8个audio、32个subpciture和任意数量的pgc,通常带vob的pgc构成一个单独标题(title),每个title(vob)又可划分为一个 (Chapter)或多个章节(Chapters)。

代码: 全选

TitleSet
This is the highest level of structure within a video DVD. Every DVD has at least 1 titleset. All the files associated with a given titleset start with VTS_nn where nn is the titleset number (starting from 1).
3、PGC、title、chapter、button和cell。PGC做为DVD的基本功能单元,用于DVD资源的组装和蓝分,在VMGM和TitleSet中大量被使用,常出现在Menus和Titles里面。PGC可以理解为一个相对独立的功能片断或函数,设有pre和post字段,主要组装button、vob等资源。PGC可以设置title(只能用于VMGM Menu)、root(常用于TitleSet根菜单)、subtitlesub、audio、angel和ptt。一个包含VOB的PGC在DVD中常被视为一个title,可按跳转规则直接跳转。一个VOB不做切分就是一个title,视其PGC在含有VOB的PGC中的位置排序自动命令为title X。如果对VOB用chapter和cell参数进行细分,就是一个或多个章节。通常对单个MTV曲的VOB按chapter来处理,对含有多个MTV曲的VOB用chapter和cell分割后可变成一个title的多个chapter。通常理解,chapter和cell不混用,官方文档的说法是有了cell就不必有chapter了。Chapter和cell都是title分片分断的一种方式,利用它可以把一个演唱会的VOB从逻辑上切成多首单曲MTV。Cell按官方文档的定义,是一种比chapter更详细的title分片标记。Chapter只有分片的开始时间, 00:00:00做为chapter 1,在跳转或链接到chapter时须注意这个问题。如果一场演唱会第一道曲子不从00:00:00开始, chapter 1将会指向00:00:00开始的开场白。Cell可以指定划分title单片的开始和结束时间,cell带有chapter和program属性,指定program属性,可以用遥控的Pre/Next按钮来搜索cell,同时指定chapter属性,该Cell就变成独立chapter。Cell也可带commands,按官方文档的说法,当该Cell被播放时,该Cell的命令将被执行。Button实质上是一个透明背景上的图案边界,可以是实心填充的图案,也可以是图形边框,按官方文档的说法,spumux通过在这个图案边界之间划矩形来确定各个按钮的位置,最后在控制台以左上角和右下角座标(X0,Y0)-(X1,Y1)方示来显示每个按钮的位置。通常菜单按钮采用长条色带、边框,甚至可以用某个小图案(一朵小花),在需要对应内容的位置出现,通过指定button的commands,实现点击或选择按钮链接对应内容。

代码: 全选

Title
Each titleset contains 1 or more titles. Each title is effectively a standalone movie. If you start xine and just tell it to play a dvd, and that dvd doesn't have a top-level menu, then it will just play the first title of the first titleset and then stop.
Chapter
Titles are subdivided into chapters. Chapters provide entry points to the movie, but when the player reaches the end of a chapter it will continue to the next chapter.
4、Video、entry、audio和palette。Video用于指定所在PGC组的视频属性,常出现在Menu和Titles中,在pgc标识前设定。Video常用参数有制式(PAL、NTSC)、比例(4:3和16:9)、分辨率(resolution)、caption和widescreen到普屏的处理方式(nopanscan|noletterbox|crop)。Entry指定所在pgc的入口属性(title,root),常用于指定menus属性,title属性可以用遥控上的topmenu按钮直接跳转,root可以用遥控上的索引菜单按钮直接跳转。在titles中,遇到entry=notitle,表示title结束。audio和palette主要用于指定音频参数和调色板,具体见官方文档。

三、菜单的制作
1.确定DVD制式。NTSC或PAL不要搞混,如果把P制的菜单做到N制的视频到将会导致菜单按钮错位。
2.用图片处理软件绘制菜单。
(1)制成一个完整的菜单jpeg文件,用后续的菜单mpegp视频生成,颜色不限,背景与菜单项颜色配合要协调,简洁素雅,易于观看,常用深色或半透效果的背景配上高亮清晰的菜单项,
(2)采用层复制的方式生成被选中的高亮菜单项(buttons),该层必须全透明处理,颜色采用4色索引模式,透明算一种颜色,实际可视颜色控制在3种以内,抹去无关的内容,仅保留需要选中高亮的菜单项既可,导出为png文件既可。在实际操作中,可以对原菜单项加衬底或在菜单项的位置描边框或在菜单项位置附件放上一朵小花都可以。按官方文档的说法,DVDAuthor对菜单项高亮显示的实质是一种映射,即将本层图片原样映射到前面菜单jpeg图形文件生成的mpeg视频中,因此,本层底色透明的png图形需要高亮的内容应该和前面菜单jpeg图形对应的内容位置完全一致,如果有错位,就位显示重影或偏差。如果本层图片有覆盖前面菜单jpeg图形的内容,一并会被映射上去。如果背景不透明,spumux将会本层图形识别成一个实心按钮,全部映射到菜单jpeg上去。
3.生成菜单
(1)合成jpeg菜单视频
推荐使用jepg2yuv,程序易得,兼容性好

代码: 全选

N制:
jpeg2yuv -n 50 -I p -f 29.97 -j menu.jpg | mpeg2enc -n n -f 8 -o menu.m2v
P制:
jpeg2yuv -n 50 -I p -f 25 -j menu.jpg | mpeg2enc -n p -f 8 -o menu.m2v
(2)增加音频
DVD可用音频主要为ac3和mp2,dobly未做测试,未知。视频文件的时长受音频文件时长控制,与音频文件等长。
mplex -f 8 -o menu.mpg menu.m2v menu.ac3

(3)合成菜单按钮
合成菜单按钮需要用到spumux的xml配置文件,主要内容如下:

代码: 全选

<subpictures>
  <stream>
    <spu
     force="yes"
     start="00:00:00.00"
     image="menu1.png"
     select="menu2.png"
     highlight="menu2.png"
     autooutline="infer"
     outlinewidth="6"
     autoorder="rows"
    >
    </spu>
  </stream>
</subpictures>
特别需要注意outlinewidth和autoorder参数,outlinewidth是设置spumux按钮检测最小间隙,如果不设置该参数,由两个图形拼成的按钮存在任何一点间隙便会被识别为两个按钮;auoorder有rows和columns两个参数,rows是读完一整行按钮再读下一行,columns是读完一整列按钮后再读另一列。在物理结构上两者是等价的,但是在布置DVD菜单时尽量按行布置,用rows参数有一个好处就是能够最后处理菜单下面“播放、上一页、下一页”这些按钮,但columns就必须在一列的最后处理“播放、上一页、下一页”这些按钮,所以多数DVD都是采用的rows参数。其中imgae和select均可省略,保留highlight既可,如果你想用不一样的背景图和菜单项点击瞬变,可以增选这些项目。最后,用spumux将透明背景的图像按钮以强制字幕的方式映射到菜单视频上,一张DVD菜单就完成了。

代码: 全选

spumux menu.xml < menu.mpg > menu_final.mpg 
四、逻辑控制
1.变量寄存器。DVD虚拟机能够处理16bit数据,含有16个通用寄存器,保留3个留作系统使用,可用通用寄存器序号g0~g12。DVD VM有24个系统寄存器,按照官方文档说法,并不是所有的系统寄存器都能被用户设定,官方给出了4个可设置的系统寄存器。

代码: 全选

audio (s1, rw):Denotes the audio stream, ranging from 0-7.
subtitle (s2, rw):The subtitle track, ranging from 0-31.
详情见官方文档。
angle (s3, rw):Selects the angle (currently untested).
button (s8, rw):Denotes the currently highlighted button. Note that the value is multiplied by 1024, so the first button is 1024, the second is 2048, etc.
2.操作符(EXPRESSION):

代码: 全选

==, !=, >=, >, <=, <, &&, ||, !, eq, ne, ge, gt, le, lt, and, or, xor, not, +, -, *, /, %, &, |, ^
经实际使用,字母操作式比符号操作式好用,如DVDAuthro对eq的辨识度明显比==高。
3.随机函数:random(EXPRESSION) Computes a psuedo-random number, between 1 and the supplied number, inclusively.
4.语句块(Blocks):可以是单句或用{}围起来的多句,支持{}嵌套。超过一个语句必须使用{}。

代码: 全选

官方示例:
g3=s7;
{
  audio=1;
  subtitle=65;
  jump vmgm menu 3;
}
If else可以做为一个单独blocks使用,与官方的if else语句表达略有不同。
如:<post>if (g2 eq 3) {g2=0;jump title 1;} else jump menu 2;</post>

5.主要操作语句:
DVD VM为一个超简易的虚拟处理机,仅支持赋值、条件判断和跳转,就一个贫瘠的汇编语言编译器,虽然号称C风格的语句,但是功能实在太弱爆,C的各种花式语句是不要想有了,如for循环、移位、指针。
(1) 赋值依旧是通用方式:VARIABLE=EXPRESSION;如g1=g1+1
(2) if (EXPRESSION) BLOCK;
(3) if (EXPRESSION) BLOCK; else BLOCK;
如果表达式值为真(1),执行BLOCK。
(4) jump TARGET; 跳至某个特殊的标题或菜单,常用于Menu和Titles跳转。
(5) call TARGET [resume CELL]; 调用某个特殊菜单,用于pgc内的title或chapter返回索引菜单(root)或根菜单(VMGM)的唯一方式。加上rescue CELL可返回调用点。
(6) resume; 具体用法见官方文档,不指定CELL,默认返回CELL 1。
部分官方原文:

代码: 全选

Jumps to a particular title or menu, or calls a particular menu, or returns to the calling title. You can only execute a call from a title to a menu; all other forms are illegal.
6.内部命令语句:
(1)<fpc>commands;</fpc> VMGM段专用,在进入VMGM菜单前飞入其他对象,可以用之实现片头CG循环播放。
(2) <post>commands;</post> 常出现在vob和pgc标识,用于设定所在的vob或pgc片断完成后所执行的动作。
(3) <pre>commans;</pre>常出现在vob和pgc标识,用于设定进入所在的vob或pgc片断之前所执行的动作。
通过<post><pre>可以实现菜单、标题、章节的循环或连续播放。
(4) pause="seconds|inf"
设定所在片断执行完成后进入下一片断的暂停时间。

7.跳转对象:

代码: 全选

(1)[vmgm | titleset X] menu, [vmgm | titleset X] menu Y, [vmgm | titleset X] menu entry Z
(2)[titleset X] title Y [chapter Z]、
All of the titles on the disc are accessible in the VMGM domain, or you can access them by titleset instead.
(3)chapter Z
Targets a chapter in the current title.
(4)program Z, cell Z
Targets a program or cell in the current PGC. You can use this to create looping menus: jump cell 1;
(5)cell top, next cell, prev cell, program top, next program, prev program, pgc top, next pgc, prev pgc, up pgc, pgc tail
"cell/program/pgc top" goes back to the start of the current Cell/program/PGC; "next/prev cell/program/pgc" goes to the next or previous cell/program/PGC; "up pgc" goes to the "up" PGC (not currently settable indvdauthor); and "pgc tail" goes to the <post> sequence in the current PGC.
Chapters are numbered from 1 in each title, while programs are numbered from 1 in each PGC. Thus, the latter can reset independently of the former when there is more than one PGC in a title.
8.跳转规则:

代码: 全选

•	A VMGM menu can only jump to:
o	Another VMGM menu
o	The first VTSM of a titleset
o	The start of a titleset
•	A VTSM menu can only jump to
o	Another VTSM in the same titleset.
o	A title or chapter within the titleset.
o	The first VMGM of the disk
•	A Title can only jump to
o	A title 、menu or chapter within the titleset.
o	The first VMGM of the disk
五、 合成DVD

1.关于VMGM的处理技巧
代码示例:

代码: 全选

<dvdauthor dest="e:\dvd1\">
<vmgm>
<fpc>{g1=0;g2=0;g3=0;g4=0;g5=0;g6=0;g7=0;g8=0;g9=0;jump title 4;}</fpc>
 
    <menus>
      <pgc entry="title">
      <pre>{if (g3 eq 1) {g3=0;jump titleset 3 menu;}
            if (g6 eq 1) {g6=0;jump titleset 1 menu;}
            if (g5 eq 1) {g5=0;jump titleset 1 menu;}
            if (g4 eq 1) {g4=0;jump titleset 2 menu;}
            if (g7 eq 1) {g7=0;jump title 1;}
            if (g8 eq 1) {g8=0;jump title 2;}
            if (g9 eq 1) {g9=0;jump title 3;}
           }
      </pre>

         <vob file="vmgm1.mpg"></vob>
         <button>jump titleset 1 menu;</button>
         <button>jump titleset 1 menu;</button>
         <button>jump titleset 2 menu;</button>
         <button>jump titleset 3 menu;</button>

         <button>jump title 1;</button>
<post>if (g1 eq 2) {g1=0;jump titleset 1 menu;} else jump title 4;</post> 
      </pgc>
   </menus>
</vmgm>

<titleset>
  <menus>
      <pgc entry="root">
      <pre>g2=g2+1;</pre>
      <vob file="menuA1.mpg"></vob>
                  
         <button>jump title 1 chapter 2;</button>
         <button>jump title 1 chapter 3;</button>         
         <button>jump title 1 chapter 4;</button>
         <button>jump title 1 chapter 5;</button>
         <button>jump title 1 chapter 6;</button> 
         <button>jump title 1 chapter 7;</button>
         <button>jump title 1 chapter 8;</button>
         <button>jump title 1 chapter 9;</button>
        
         <button>jump title 1 chapter 11;</button>
         <button>jump title 1 chapter 12;</button>
         <button>jump title 1 chapter 13;</button> 
         <button>jump title 1 chapter 14;</button> 
         

         <button>jump title 1;</button>
         <button>jump vmgm menu;</button>

<post>if (g2 eq 2) {g2=0;jump title 1;} else {g4=1;jump vmgm menu;}</post>          
</pgc>
</menus>

<titles>
<pgc  pause="3">

<vob file="ZY.vob">
<cell start="00:00:00"  chapter="1">jump chapter 10;</cell>
<cell start="00:01:56"  end="00:05:27"  chapter="1"  program="1"></cell>
<cell start="00:07:43"  end="00:10:58"  chapter="1"  program="1" ></cell>
<cell start="00:12:29"  end="00:14:17"  chapter="1"  program="1" ></cell>
<cell start="00:14:47"  end="00:17:14"  chapter="1"  program="1" ></cell>
<cell start="00:21:01"  end="00:24:19"  chapter="1"  program="1" ></cell>
<cell start="00:25:18"  end="00:25:46"  chapter="1"  program="1" ></cell>
<cell start="00:26:03"  end="00:28:00"  chapter="1"  program="1" ></cell>
<cell start="00:28:31" end="00:29:49" chapter="1" program="1">jump chapter 11;</cell>
</vob>

<vob file="zh.vob">
<cell start="00:00:00" chapter="1">jump program 15;</cell>
<cell start="00:08:35" end="00:11:17" chapter="1" program="1" ></cell>
<cell start="00:12:59" end="00:15:55" chapter="1" program="1" ></cell>
<cell start="00:18:20" end="00:21:24" chapter="1" program="1" ></cell>
<cell start="00:28:37" end="00:29:58" chapter="1" program="1" ></cell>
<cell start="00:29:57" end="00:29:58" chapter="1"></cell>
</vob> 

   <post>{g8=1;call vmgm menu;}</post>

</pgc> 
</titles>
</titleset>

<titleset>
<menus>
 <pgc pause="inf">
      <vob file="menuB1.mpg"></vob>
      <button>jump title 1 chapter 1;</button>
      <button>jump title 1 chapter 2;</button>
      <button>jump title 1 chapter 3;</button>         
      <button>jump title 1 chapter 4;</button>
      <button>jump title 1 chapter 5;</button>
      <button>jump title 1 chapter 6;</button> 
              
      <button>jump title 1;</button>
      <button>jump vmgm menu;</button>
      <post>{g3=1;jump vmgm menu;}</post>
   </pgc> 
</menus>

<titles>
 <pgc pause="3">
      <vob file="yc.vob" chapters="
00:00:00,
00:02:07,
00:04:30,
00:07:01">
</vob>
     <vob file="xz.vob" chapters="00:00:00,00:02:01"></vob>
     <post>{g9=1;call vmgm menu;}</post>
 </pgc>   
</titles>
</titleset>


<titleset>
<menus>
 <pgc pause="inf">
      <vob file="menuC1.mpg"></vob>
         <button>jump title 1 chapter 1;</button>
         <button>jump title 1 chapter 2;</button>
         <button>jump title 1 chapter 3;</button>         
         <button>jump title 1 chapter 4;</button>
         <button>jump title 1 chapter 5;</button>
         <button>jump title 1 chapter 6;</button> 
         <button>jump title 1 chapter 7;</button>
         <button>jump title 1 chapter 8;</button>
         <button>jump title 1 chapter 9;</button>         
         <button>jump title 1 chapter 10;</button>
      
         <button>jump title 1;</button>
         <button>jump vmgm menu;</button>
         <post>{g5=1;jump vmgm menu;}</post>
      </pgc> 
</menus>

<titles>
 <pgc pause="3">
      <vob file="hk.vob"  chapters="
00:00:00,
00:01:05,
00:02:00,
				
00:03:41,
00:04:21,
00:05:11,
00:05:51,
00:06:44,
00:07:45,
00:08:32">
     </vob>
     <post>call vmgm menu;</post>
 </pgc>   
</titles>
</titleset>  
 
<titleset>
<titles>

 <pgc>
     <pre>g1=g1+1;</pre>
     <vob file="vmgm1.mpg"></vob>
     <button>{g6=1;call vmgm menu;}</button>
     <button>{g5=1;call vmgm menu;}</button>
     <button>{g4=1;call vmgm menu;}</button>
     <button>{g3=1;call vmgm menu;}</button>
     <button>{g7=1;call vmgm menu;}</button>
     <post>call vmgm menu;</post>
 </pgc>

</titles>
</titleset>
</dvdauthor>
(1)利用fpc特性实现VMGM 菜单循环
将VMGM 菜单视频最后一个titleset引用,成为一个独立的titleset(title 4),需要用到的变量可以在fpc中初始化。

代码: 全选

<vmgm>
  <fpc>
{g1=0;g2=0;g3=0;g4=0;g5=0;g6=0;g7=0;g8=0;g9=0;jump title 4;}</fpc>
 
    <menus>
      <pgc entry="title">
      <vob file="vmgm1.mpg"></vob>
         <button>jump titleset 1 menu;</button>
         <button>jump titleset 1 menu;</button>
         <button>jump titleset 2 menu;</button>
         <button>jump titleset 3 menu;</button>
         <button>jump title 1;</button>
<post>if (g1 eq 2) {g1=0;jump titleset 1 menu;} else jump title 4;</post> 
      </pgc>
g1代表循环播放次数,由title 4改变,在vmgm post判断g1是否等2,循环两次后进入TitleSet 索引菜单,否则继续去播放title 4
在配置文件末端设置独立TitleSet引用vmgm 菜单视频,做为单独的title 4来用,播放完成后回调vmgm menu,不设置menu标签,原有合成的按钮仍旧有效。

代码: 全选

<titleset>
<titles>
 <pgc>
     <pre>g1=g1+1;</pre>
     <vob file="vmgm1.mpg"></vob>
     <button>{g6=1;call vmgm menu;}</button>
     <button>{g5=1;call vmgm menu;}</button>
     <button>{g4=1;call vmgm menu;}</button>
     <button>{g3=1;call vmgm menu;}</button>
     <button>{g7=1;call vmgm menu;}</button>
     <post>call vmgm menu;</post>
 </pgc>
</titles>
</titleset>
(2)利用pre和post特性实现菜单或title的跳转
因为只有VMGM能够调用别的TitleSet菜单,单个TitleSet 不能调用别的TitleSet菜单,因此需要在末端titleset的button上对各菜单赋值,点下相应按钮,对应的寄存器变量被赋值,再完成vmgm menu回调,在vmgm menu的pre字段对各寄存器变量进行判断,跳转到对应的TitleSet菜单。
赋值、回调vmgm:

代码: 全选

<vob file="vmgm1.mpg"></vob>
     <button>{g6=1;call vmgm menu;}</button>
     <button>{g5=1;call vmgm menu;}</button>
     <button>{g4=1;call vmgm menu;}</button>
     <button>{g3=1;call vmgm menu;}</button>
     <button>{g7=1;call vmgm menu;}</button>
判断、条件跳转:

代码: 全选

<menus>
      <pgc entry="title">
      <pre>{if (g3 eq 1) {g3=0;jump titleset 3 menu;}
            if (g6 eq 1) {g6=0;jump titleset 1 menu;}
            if (g5 eq 1) {g5=0;jump titleset 1 menu;}
            if (g4 eq 1) {g4=0;jump titleset 2 menu;}
            if (g7 eq 1) {g7=0;jump title 1;}
            if (g8 eq 1) {g8=0;jump title 2;}
            if (g9 eq 1) {g9=0;jump title 3;}
           }
      </pre>
各寄存器使用完后尽量恢复初值,防止后续调用逻辑错乱,因为只有在fpc初始化的变量才是一次性的,fpc只在光盘插入时调用一次,VMGM 和TitleSet Menu是随时待CALL的。

2.关于TitleSet Menu的处理技巧

代码: 全选

代码示例:
<dvdauthor dest="d:\dvd1\">

<vmgm>
  <fpc>{g1=0;g2=0;g3=0;jump title 3;}</fpc>
    
   <menus>
      <pgc entry="title">
       <pre>if (g3 eq 1) {g3=0;jump title 1;}</pre>
         <vob file="vmgm1.mpg"></vob>
         <button>jump title 1;</button>
         <button>jump titleset 1 menu;</button>
      <post>if (g1 eq 2) jump titleset 1 menu; else jump title 3;</post>                 
      </pgc>
   </menus>
</vmgm>

<titleset>
  <menus>

      <pgc entry="root">
      <pre>g2=g2+1;</pre>
      <vob file="menuA1.mpg"></vob>
         <button>jump title 2 chapter 1;</button>
         <button>jump title 2 chapter 2;</button>
         <button>jump title 2 chapter 3;</button>         
         <button>jump title 2 chapter 4;</button>
         <button>jump title 2 chapter 5;</button>
         <button>jump title 2 chapter 6;</button>
         <button>jump title 1 chapter 2;</button>  
         <button>jump title 1 chapter 3;</button>
        
         <button>jump title 2 chapter 1;</button>
        
       
         <button>jump title 1 chapter 4;</button>
         <button>jump title 1 chapter 5;</button>
         <button>jump title 1 chapter 6;</button>
         <button>jump title 1 chapter 7;</button>
         <button>jump title 1 chapter 8;</button> 
         <button>jump title 1 chapter 9;</button>
         <button>jump title 1 chapter 10;</button> 
         <button>jump title 1 chapter 11;</button>
         
         <button>jump menu 2;</button>
         <post>if (g2 eq 2) {g2=0;jump title 2 chapter 1;} else jump menu 2;</post>   
      </pgc>

      <pgc>
         <vob file="menuB1.mpg"></vob>
         <button>jump title 1 chapter 12;</button>         
         <button>jump title 1 chapter 13;</button>
         <button>jump title 1 chapter 14;</button>
         <button>jump title 1 chapter 15;</button>
         <button>jump title 1 chapter 16;</button>
         <button>jump title 1 chapter 17;</button>
         <button>jump title 1 chapter 18;</button>
         
         
         <button>jump title 1 chapter 12;</button>

         <button>jump title 1 chapter 19;</button>        
         <button>jump title 1 chapter 20;</button>
         <button>jump title 1 chapter 21;</button>         
         <button>jump title 1 chapter 22;</button>
         <button>jump title 1 chapter 23;</button>
         <button>jump title 1 chapter 24;</button>
         <button>jump title 1 chapter 25;</button> 
         
         <button>jump menu 1;</button>
         <post>jump menu 1;</post>
      </pgc>   

</menus>


<titles>
   <pgc>
      <vob file="RTVII.vob"  chapters="
00:00:00,

00:28:23,
00:32:14,
				
00:35:47,
00:37:51,
00:41:57,
00:44:02,
				
00:48:19,
00:52:26,
00:55:01,
				
				
01:00:44,
01:02:54,
				
01:06:03,
01:07:47,
01:09:17,
01:10:58,
01:12:49,
01:14:55,
01:17:05,
				
01:19:02,
01:21:08,
01:22:36,
01:24:07,
01:25:58,
01:27:50
">
</vob>
      
      <post>call menu;</post>
</pgc> 


<pgc>
<vob file="RTVII.vob">
<cell start="00:01:13" end="00:04:02" chapter="1" program="1" ></cell>
<cell start="00:04:03" end="00:06:33" chapter="1" program="1" ></cell>
<cell start="00:06:34" end="00:09:02" chapter="1" program="1" ></cell>
<cell start="00:09:03" end="00:11:52" chapter="1" program="1" ></cell>
<cell start="00:12:11" end="00:14:37" chapter="1" program="1" ></cell>
<cell start="00:17:12" end="00:20:58" chapter="1" program="1" ></cell>

</vob>
      
      <post>jump title 1 chapter 2;</post>
   </pgc> 
</titles>

</titleset>

<titleset>
<titles>

 <pgc>
     <pre>g1=g1+1;</pre>
     <vob file="vmgm1.mpg"></vob>
     <button>{g3=1;call vmgm menu;}</button>
     <button>{g1=2;call vmgm menu;}</button>
     <post>call vmgm menu;</post>
 </pgc>

</titles>
</titleset>

</dvdauthor>


(1)利用pre和post特性实现菜单循环和计划播放

代码: 全选

<titleset>
  <menus>
    <pgc entry="root">
      <pre>g2=g2+1;</pre>
      <vob file="menuA1.mpg"></vob>

<post>if (g2 eq 2) {g2=0;jump title 2 chapter 1;} else jump menu 2;</post>   
    </pgc>
条件判定,循环2轮开始播放chapter 1,不满足条件调用menu 2。

代码: 全选

 <pgc>
     <vob file="menuB1.mpg"></vob>
     <post>jump menu 1;</post>
      </pgc>   
</menus>
B面菜单播放完后直接跳转到索引菜单,开始循环。

(2)利用post实现章节连续播放

代码: 全选

<pgc>
<vob file="RTVII.vob">
<cell start="00:01:13" end="00:04:02" chapter="1" program="1" ></cell>
<cell start="00:04:03" end="00:06:33" chapter="1" program="1" ></cell>
<cell start="00:06:34" end="00:09:02" chapter="1" program="1" ></cell>
<cell start="00:09:03" end="00:11:52" chapter="1" program="1" ></cell>
<cell start="00:12:11" end="00:14:37" chapter="1" program="1" ></cell>
<cell start="00:17:12" end="00:20:58" chapter="1" program="1" ></cell>

</vob>
      
      <post>jump title 1 chapter 2;</post>
   </pgc> 
Title 2播放完后直接跳转到title 1的第一章节。

3.关于chapter处理技巧
(1)利用chapter特性实现vob文件章节分割

代码: 全选

<vob file="RTVII.vob"  chapters="
00:00:00,

00:28:23,
00:32:14,
				
00:35:47,
00:37:51,
00:41:57,
00:44:02,
				
00:48:19,
00:52:26,
00:55:01
">
</vob>
用该方式的优势是较为简单,chapter 1强制从00:00:00开始,chpater 1必定会包含开场画面。DVD都是章节连续播放,本章节播放完了继续下一章节,由没有指定单章节的结束时间,无法剔除章节间的花絮和过场CG。

(2)利用cell特性实现chapter精准定位

代码: 全选

<pgc>
<vob file="RTVII.vob">
<cell start="00:01:13" end="00:04:02" chapter="1" program="1" ></cell>
<cell start="00:04:03" end="00:06:33" chapter="1" program="1" ></cell>
<cell start="00:06:34" end="00:09:02" chapter="1" program="1" ></cell>
<cell start="00:09:03" end="00:11:52" chapter="1" program="1" ></cell>
<cell start="00:12:11" end="00:14:37" chapter="1" program="1" ></cell>
<cell start="00:17:12" end="00:20:58" chapter="1" program="1" ></cell>
</vob>
用该方式能够实现准确定位,能够跳过不想播放的内容,与chapter不同,cell的章节start时间开始;和chapter一样,cell的序号从1开始。

4.关于动态菜单的一些技巧
生成动态菜单视频,合成动态菜单按钮。利用锐动天地等DVD专业制作软件可以生成同画面多视频的无按钮视频,将视频截图,导入到PS软件中绘制高亮选中方框,去除背景,保留高亮方框,用spumux合成到菜单视频是即可实现动态菜单效果。

六、一些吐槽

第一次遇到的问题是spumux不认按钮png图形,更新dvdauthor版本后顺利搞定。随后遇到更扯淡的问题,WIN版的DVDAuthor居然不认中文文件名,让我N多单MTV文件合成遇到了巨大阻力,所幸Linux原生版支持utf8中文文件名,挪到Linux下面顺利搞定,第一次感受到了来自自由软件界的深深恶意。
制作的途中由于对知识一知半解,很多时候失败而归。在合成按钮时由于没有做背景透明,结果生成了一个巨大单按钮;有时候由于图片与视频制式不符,导致按钮严重跑偏,折腾半天还找不到原因。在写逻辑控制语句时,if else按照官文的方法写,结果不卖帐,加了N把{ }和;后终于找到正确的语法;在VMGM和VTS之间跳转的时候由于没有理解跳转规则,导致跳转报错,制作失败。所以认真、仔细阅读并理解官文的那些描述、定义非常重要,官文除了对跳转规则相对模糊外,其他内容还是描述得比较准确的。
对制作DVD的新手来说,会了DVD菜单就成功了80%,能够做出一张靠谱的DVD来。但要做好DVD却非常困难,除了对PS和视频编辑有较高的要求外,还对配色、逻辑控制都有较高要求。最难的是兼容性,某知名品牌DVD在什么软件上测试效果都一样,我的DVD在不同的软件上不同的解读,差异较大,菜单还时不时卡死。对制作DVD的专业人员来说,做好DVD的兼容性就算是成功100%了吧。最后要推荐是仍是DVDRemakPro,它可以看到任意DVD影视光盘的结构和逻辑,可以借助它理解DVD组织结构和逻辑,学习优秀DVD光盘的制作经验。
回复