Howto author AVI->DVD with menus using Linux only !

Try this pretty sweet DVD Authoring tool for Winders.

AUTHORING PC MEDIA TO DVD USING THE LINUX OPERATING SYSTEM

Author: Rick Harris
Location: Adelaide, Australia
Email: rickfharris@yahoo.com.au

This howto is written in the attempt to help those reading to:

1) Accomplish transferring a video media file (.avi, .mpg, .wmv, .mov, etc.) to DVD media in a format that will allow it to be played on a standalone DVD player.

2) Create professional style menus with audio to allow selection of Titles, Chapters & other menus.

Tools needed:

Tools optional:

To make things easier to read, I will be using some real filenames, always keeping them with any created files & saved config files in the same directory.

Note any copyright issues for your location if you intend to use these for anything other than private use.

Encoding the movie

$ transcode -i matrix.avi -y ffmpeg --export_prof dvd-ntsc --export_asr 3 -o matrix -D0 \ 
-s2 -m matrix.ac3 -J modfps --export_fps 29.97

The above will produce 2 files, 'matrix.m2v' and 'matrix.ac3' which have been split from the original into video & audio files. The video(.m2v) has now been re-encoded into a DVD compliant mpeg2 format & the audio(.ac3) has been encoded into an AC3 DVD audio stream.

Aspect Ratio

The above transcode lines will convert & encode to an aspect ratio of 16:9. If an aspect ratio of 4:3 is desired then replace '--export_asr 3' with '--export_asr 2' in your transcode line. Dvdauthor will only work correctly on files with aspect ratios of either 4:3 or 16:9

Convert 2-channel stereo audio track to 5.1 surround sound (optional)

Using the above transcode lines will result in a 2-channel stereo audio track.

Depending on the brand of 5.1 surround sound entertainment system, this usually results in the audio only being present on the centre & sub channels.

Find out if the original .avi/.mpg file already contains a 5.1 AC3 audio track:

$ mplayer -vo dummy -identify original.avi 2> /dev/null | grep 5.1

A positive output would look something like:

AC3: 5.1 (3f+2r+lfe)  48000 Hz  384.0 kbit/s

If it does, then extract it using 'tcextract' (part of the transcode package) & use it in your mplex line below instead. In this way, front to rear panning will not be lost on true 5.1 audio tracks, & no added conversion is necessary:

$ tcextract -d2 -i matrix.avi -a0 -x ac3 | tcextract -d2 -x ac3 -t raw > matrix.ac3

If it doesn't, then using the existing 2-channel audio track, it is possible to create a 5.1 surround sound track so that the audio will be present on all 6 channels (front to rear panning is lost).

See here -> http://mightylegends.zapto.org/dvd/dvdauthor_howto_surround.html

Combine the new audio & video files into one DVD mpg.

$ mplex -f8 -o matrix_dvd.mpg matrix.m2v matrix.ac3

Test the files in mplayer or xine. eg. 'mplayer -vo xv matrix_dvd.mpg'

Alternatively, transcode has a preview option available so that the movie can be watched (video only) as it's being encoded with the '-J pv=cache=30' option, like so (note that this will incur a slight performance hit & encoding will be slower as a result):

$ transcode -i matrix.avi -y ffmpeg --export_prof dvd-ntsc --export_asr 3 -o matrix -D0 \ 
-s2 -m matrix.ac3 -J pv=cache=30,modfps --export_fps 25

To preview whether AV sync is going to be correct, only encode a small amount of the movie by adding '-c 0-00:05:00' to the end of your transcode line. This will encode just the first 5 minutes of the movie, then you will need to merge(mux) the two AV streams as mentioned above using mplex. Preview the resultant .mpg file in mplayer/xine.

Creating the menus

It may seem complex & time consuming first time through, but once it's been done a couple of times it becomes very quick & easy.

You can now add the mpg to QDVDAuthor or Klvemkdvd authoring programs and create your DVD or use dvdauthor from the command line as such:

- Notice the -c "00:00:00.000,00:00:38.066" These are chapter markers. 00:00:00.000 is HH:MM:SS.SSS

To get file length in seconds, run this:

$ mplayer -vo dummy -identify matrix.mpg 2> /dev/null | grep ID_LENGTH | \ 
gawk -F= {'print $2'}

Can use this little perl script I wrote to generate chapter info at 5 minute intervals chapgen.pl and generate your chapter string like this:

$ chapgen.pl `mplayer -vo dummy -identify matrix.mpg 2> /dev/null | \
grep ID_LENGTH | gawk -F= {'print $2'}`

- Create DVD filesystem & Create DVD information (IFO) files:

$ dvdauthor -c "00:00:00.000,00:00:38.066,00:02:40.699,00:08:39.865,00:10:40.465" \ 
-o newdvd final.mpg; dvdauthor -o newdvd -T

More info on dvdauthor

Burn the Video_TS and Audio_TS created with K3B DVD Video mode.

Happy authoring!

Some nice progress is also currently being made on a complete GUI based DVD authoring tool for Linux.

Two that stand out are:

Credits

Scott T. Smith - creator of dvdauthor
Thomas Oestrich & Tilmann Bitterberg - creators of transcode
The ffmpeg team
The mjpeg team
Wolfgang Wershofen - for precise & detailed help
Ian Pointer - for his article at linuxjournal.com, Issue# 116
James A. Pattie - for his 'DVDs under Linux' presentation
James Tappin - for his dvdauthor tutorial

Links