Dvdauthor

0 views
Skip to first unread message

Cameron Fluet

unread,
Aug 4, 2024, 8:40:07 PM8/4/24
to progivaspluc
Lastyear I wrote a script to make DVDs and it worked fine but now it no longer works. I haven't edited it or anything so I figure it must be a change in the software it uses. I looked through the man pages but couldn't make sense of it enough to fix it myself. Any help or constructive criticism is appreciated (Note - Prepare for what is probably terrible code, sorry).

Hey thanks for the reply, I'm trying that right now. I'll post back later to let you know if it works. Also, I'm glad you might be able to get some use out of my script, although I think a few of the steps could probably be put together into one command.


I'm using a single command for the dvdauthor step, but then you need an .xml control file I think, so I'm interested to see how you handled that with the two calls to dvdauthor. Otherwise much the same process for me, ffmpeg, dvdauthor, mkisofs and growisofs neatO


Hi, I have noticed a weird little quirk in my script that never used to happen. If I try to burn the disc right after its done, it won't make the iso image, but if I take the DVD out before I tell it to burn it works fine. I just have to issue the 'growisofs -dvd-compat -Z /dev/sr0=$ISOIMAGE' command manually. Any ideas. And sorry if that didn't make sense.


However, for some videos, the DVD starts not at 00:00:00, but further along. One some DVD players I can rewind, on others I cannot. If I use dvdauthor to put multiple files on the disk, the chapters (by default at the beginning of each file) are also not placed correctly.


My best guess is that the original source video is corrupted in some subtle way, probably something timestamp or framerate related, and needs to be sanitized first in some way. I tried some extra conversions and remuxing, but that doesn't really seem to help.


I've resorted to using mkisofs to create the ISO image, and this seems to fix the problem. Creating the ISO in another way (e.g. on a Mac with hdiutil, or directly burning it to disc with Finder) creates malfunctioning DVDs. Apparently there are some restrictions on the ISO format for DVDs. If these are not respected, the DVDs have incorrect chapters and might even start in the middle of the video. These restrictions are best explained in mkisofs' man page:


-dvd-video Generate DVD-Video compliant UDF file system. This is done by sorting the order of the content of the appropriate files and by adding padding between the files if needed. Note that the sorting only works if the DVD-Video filenames include upper case characters only.


To turn the mpeg file to an DVD compatible folder structure, you need a tool like dvdauthor. There are probably some frontends to it, but the first example from the book, chapter 1.2, is probably sufficient for you. Put that example into file dvdauthor.xml and your video to video.mpg and execute dvdauthor -o DVD -x dvdauthor.xml.


This will result in a directory structure under folder DVD, which you can turn in to an iso file with genisoimage -dvd-video -o my.iso -v DVD. You can then copy my.iso to some other system and burn on a disc with wodim or some other tool.


The resulting disc should be playable in standalone players, but due to DVD limitations you may run into problems with arbitrary mpeg streams. Some of the problems may be fixed with dvdauthor and others with mplex from package mjpegtools. If you want subtitles, you'll need to learn how to use spumux.


In this article I will describe the actions to be taken to create a video DVD that contains only a single title with just one video, no menus, no chapters, no extras. If you want to add chapters, menus or more titles please refer to the dvdauthor man page.


The -o option specifies the output folder and -t adds a title to the DVD in that folder. You can add multiple titles with this command. It might be that dvdauthor outputs some warnings during the authoring process, but you can ignore them.


Before we finalize the DVD we need to set the video format. In this case we will use the PAL standard. If your video and TV standard are NTSC, please replace it accordingly. Since I have found no working way to set the video standard using command line options of dvdauthor we will set an environment variable which will be read by dvdauthor when it finalizes the DVD.

$ export VIDEO_FORMAT=PAL


The option -dvdcompat makes the resulting DVD compatible to video DVD standard, -Z specifies the output device, e.g. your optical drive, and input image file. After the DVD is finished, test it with VLC media player and your DVD player, if you have one. If your tests are successful you can give the DVD to the family member who asked for the video.


You can create far more complex video DVDs with menus, multiple titles, chapters and all with dvdauthor. The structure of the DVD is described in an XML file that you can pass to dvdauthor via command line options. Please refer to the man pages for more details.


DVD is an acronym of Digital Versatile Disc. The word versatile isimportant: DVD comes in many different forms appropriate fordifferent types of media; e.g. DVD ROM, DVD Audio, DVD Video. Formore information about DVD formats, see reference #1. Thispresentation focuses on DVD Video.


A DVD Video disc contains one video manager menu (vmgm). The videomanager menu may also be called the top menu or disc menu. Your DVDremote control should have a top menu or disc menu button. Later Iwill describe exactly what a menu may contain. When the disc startsit will usually start with the video manager menu. If no videomanager menu is defined, then the DVD player will (usually?) move tothe first title set menu.


Every title set may have one or more menu. You don't need to havea menu. If no menu is found, then the DVD player should go directlyto title 1. So if you have a single video file, MYMOVIE.MPG, that youwant to burn to DVD, you can define it as title 1, burn it to DVDwith no menus, and when you press play you will see MYMOVIE.MPG.


As you can see, the vmgm is empty. There is one titleset containingone title. The title consists of one program chain. If you create aDVD using this structure it will work, but there will be no menus, nochapters (actually dvdauthor automatically creates a chapter at thebeginning of the video stream), and you will need to burn a separateDVD for each of your mpg files. Suppose you wanted to put severalmpeg files on one DVD:


This dvdauthor.xml file puts N mpeg files onto a single DVD.dvdauthor automatically adds a chapter marker at the beginning ofeach file, so you can use the next and prev buttons to skip from onevideo to the next.


A menu consists of some buttons on top of a background. First letsconsider the background. In the computer world we typically think ofa background image as static, but for DVD video the background is anmpeg video clip. It can be very short, for instance two seconds long,or it can be very long. The background mpg will automatically loop,giving the appearance of a continuous video. You might convert avideo clip from your collection to mpeg for use as a background usingtechniques described in the next section. But right now I will showhow to use a still image as a menu background.


Notice that this image is a jpeg file and I have already convertedit's resolution to 720x480 pixels. NTSC D1 resolution is actually 720x486, but for some reason I did all myDVDs at 720x480 and they worked. Maybe I misread the documents. Another thing to consider is that the pixels on a DVD are notsquare, which means that the images will look a little different on the TV. But for now we won't worry about these details. Instead we will use this command (thanks to Bertrand Petit) which takes any size image, converts it to theNTSC DVD resolution, then turns that image into a short mpeg video stream:


This is actually four commands, each piped to the next. The firstcommand converts the jpeg image to pnm (piped to stdout), then thesecond command converts the pnm image to an uncompressed NTSCformatted yuv4mpeg2 stream of 60 frames. The third command scales the yuv4mpeg2 stream and the fourth commandperforms motion compression on the stream and saves the compressedstream in menu_background.m2v. So now we have an mpeg2 video clip.But it won't work as a background because menu backgrounds must havea sound channel. We can add a silent sound channel like this:


The first line creates a mp2 audio file containing two seconds ofsilence. The second line multiplexes the mp2 audio file and the mpeg2video file. Now we have a audio/video mpeg clip that we can use as abackground. Now it's time for the hard part: we have to make thebuttons.


In this case, the entire word or pair of words was the menubutton. And each menu button has three states: normal, selected andactivated. We create a bitmap of the screen for each of these states.Here's are some examples I made using The Gimp. Notice that most ofeach image is transparent, that each image uses a colourmap of onlytwo colours, and that the only difference between the images is thecolour selected in the colourmap.


Ok, so we have an image representing each state of the buttons. Sowhat do we do with these images? DVD video implements buttons usingthe subtitle channels built into DVD video mpeg stream, so we use thesubtitle multiplexer program, like this:


In this case I have decided to use the automatic features of spumuxto detect rows of buttons. Read the man page for more informationbecause honestly, I don't know that much about spumux. I used it asshown above and it worked, so let's move on.

3a8082e126
Reply all
Reply to author
Forward
0 new messages