Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
Site Navigation
Linux Forums
Linux Articles
Product Showcase
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Free Publications

This is yet another article that can tell you how to create your ownDVD with linux command line tools.

I hope this is the fastest and the simplest way to create a no frills bare bones iso that can play on any standard DVD player.

I am obviously talking of video. DVD can play several other media and it is a rich standard. But we are going to concern ourselves with just the most critical thing for us. We want to be able to play the video files in our hard drive using the DVD player.

It could either be from a video camera or downloaded from youtube or some p2p software.

You don't need a DVD drive even to do any of the things I mention in this article. You can do everything necessary to create a DVD iso and even test that it works. After that you can transfer it to a machine with DVD burner and if all goes well, your DVD should just play fine.

Alright. Let us begin. We are going to be needing at least these tools.

1. dvdauthor
2. mjpegtools
3. ffmpeg
4. mencoder
5. mkisofs

I am sure the list is incomplete but it is a good start. mjpegtools have several executables like lav2yuv, mpeg2enc, mp2enc, mplex and so on.

And of course, our friendly mplayer and mencoder programs from the mplayer project. mplayer is the ultimate media player that supports a wide variety of output drivers, filters and what not. mencoder, its companion program can crop videos, do format conversions, concatenate videos, remove unwanted portions from a video and so on.

Let us get down to business now.

Say we have videos in avi container format or flv format. Or any other.

First we have to convert it into motion jpeg format -- mjpeg. This command line will do.

$ mencoder video.avi -o video.mjpeg -ovc lavc -lavcopts vcodec=mjpeg

Next we need to create a MPEG2 video that conforms to DVD standards. This long line will do it for us.

$ lav2yuv +n video.mjpeg | mpeg2enc -f 8 -s -r 16 -a2 -o video.m2v

Good. If you have come so far without any problem, then you should consider yourself lucky since the end is nigh!

We now have the raw picture frames in the right format. What about audio? For that a simple ffmpeg command can be used to extract the audio from the video in the AC3 format.

$ ffmpeg -i video.avi -ab 224 -ar 48000 video.ac3

DVD players expect audio to be sampled at 48000 Hz and not 44.1 kHz.

Now, we have two files. video.m2v sans the audio and video.ac3 sans the video. We have to combine them now.

$ mplex -f 8 video.m2v video.ac3 -o video.mpg

You can test if the final output is as expected by playing the video.mpg file with mplayer. All we have to do now is create a VOB file that consumer DVD players can understand.

This is where you need to use dvdauthor, dvdstyler or any of the DVD authoring tools. We are going to use the simplest command line tool, dvdauthor.

It is possible to create DVD without using any XML file with dvdauthor but we shall use a simple file. We will need to use a config file for doing anything useful with dvdauthor anyway. Take a look.

<dvdauthor dest="dvd">
<vob file="video1.mpg" chapters="0,0:30,1:00,1:30,2:30,3:00,3:30,4:00" />
<vob file="video2.mpg" chapters="0,0:30,1:00,1:30,2:30,3:00,3:30,4:00" />

You should of course replace video1.mpg and video2.mpg with the appropriate video created with the above steps. And the chapters parameter can be tweaked to suit your taste. If you wish to fast forward to rewind in steps of 30 seconds , and if the video length is 4 minutes you could use the above config.

Now, we shall create a DVD file structure with dvdauthor.

$ dvdauthor -x dvd.xml 

If all goes well and dvdauthor does not throw the dangerous "ERROR" line, we are safe.

If you enter the dvd/ directory, you will find a VIDEO_TS and an AUDIO_TS directory created.

We can taste the fruits of our labor by simply typing this.

$ mplayer dvd:// -dvd-device dvd/

If it plays your first video, you can check the other ones by specifying dvd://4 to play the 4th video for instance.

You can either straight away burn this to a DVD using growisofs or use mkisofs to create an iso file that can be burnt on some other computer if required.

$ mkisofs -dvd-video -udf -R  -o ~/dvd.iso dvd/

You can loopback mount the dvd.iso file and play it with xine or ogle. Once you are sure that the iso is fine, go ahead and burn it!

Enjoy your DVD!

Rate This Article: poor excellent
Comments about this article
writen by: bestsoft666 on 2008-04-24 22:57:04
You can use one software to do all work! It is devede! --------------------- [url=http://www.free-star.org/free-dvd-ripper-freeware.html]free dvd ripper freeware[/url]
RE: Suggest written by bestsoft666:
writen by: nathan on 2008-07-16 11:57:25
i want the software
RE: west written by nathan:
writen by: Sarah Cain on 2009-02-05 15:08:51
Thanks, that was very helpful.
RE: written by Sarah Cain:

Comment title: * please do not put your response text here