open source

How To Burn a DVD From The Command Line in Linux.


I have put together a guide on creating your own DVD recording using only the terminal in Linux.

I will go through the steps one by one,

To get started, you will need to install a few tools as root:

apt-get install ffmpeg dvdauthor genisoimage rename

ffmpeg is the swiss army knife of this operation, providing both the codecs and the ability to transcode videos from one format to another.
Dvdauthor creates the titles and such in DVD format.
Genisoimage creates the DVD.
Im keeping this simple. For more information on these programs check the man page for each or Google.

You will need to create a new directory ‘Videos’ and a text file that will be used to string your videos together before transcoding.
1, Create a text file ‘cam.txt’ using whatever editor works for you! I use geany.

geany cam.txt

This will be used by ffmpeg to string all of your videos together into one movie.
Inside cam.txt place:

# this is a comment
file ’01.mp4′
file ’02.mp4′
file ’03.mp4′
file ’04.mp4′
file ’05.mp4′
file ’06.mp4′
file ’07.mp4′
file ’08.mp4′
file ’09.mp4′
file ’10.mp4′
file ’11.mp4′

During the proccess of making a DVD this file will be copied to ‘Videos’ to be adjusted for use there.
2. Next create the directory ‘Videos’ if not already there:

mkdir ~/Videos

Now we are ready to get started!

3.  Copy any videos from your GoPro or TomTom to ~/Videos. (or any other camera!) These will all need to be the same format for this tutorial, i.e. .mp4. Change as needed

4. Open a terminal and cd to ~/Videos:

cd ~/Videos

5. Use the program rename to put all your newly transferred files in numbered order:

rename 's/.+/our $i; sprintf("%02d.mp4", 1+$i++)/e' *

6. Copy cam.txt to ~/Videos (we do this new every time because the values change from project to project:

cp ~/cam.txt ~/Videos

After copying over cam.txt to ~/Videos, open it up and change the number of lines to the same number of videos in ~/Videos and save. This will allow ffmpeg to use the cam.txt list as a reference.

7. The command below will string all your videos together into one movie:

ffmpeg -f concat -i cam.txt -c copy Movie.mp4

8. Now we are ready to change the format from mp4 to mpeg2, which is still the standard for creating a DVD. The below command also pads the video on your television, creating a black border around the movie.  Because the quality is reduced when making a DVD,  Adding the padding is a wonderful thing if you have a large screen television.

The ‘-b:v 8600k’ will increase the bitrate of your video allowing for a higher quality.

ffmpeg -i Movie.mp4 -vf “pad=5/4*iw:5/4*ih:(ow-iw)/2:(oh-ih)/2” -b:v 8600k -target ntsc-dvd movievideo.mpg

Feel free to add the addition of -aspect 16:9 if desired:

ffmpeg -i Movie.mp4 -vf “pad=5/4*iw:5/4*ih:(ow-iw)/2:(oh-ih)/2” -b:v 8600k -target ntsc-dvd -aspect 16:9 movievideo.mpg

9. While still in ~/Videos, Make the directory to perform the work for dvdauthor and genisoimage:

mkdir dvd

10. Move your newly transcoded movie to ~/Videos/dvd:

mv ~/Videos/movievideo.mpg ~/Videos/dvd

11. Change directory over to~/Videos/dvd:

cd ~/Videos/dvd

12. You will need to set the variable for your television screen. Either NTSC or PAL. For the United States, use NTSC:


13. Now we let dvdauthor set up the movie for dvd production:

dvdauthor -o dvd/ -t movievideo.mpg

14. And set the titles:

dvdauthor -o dvd/ -T

15. Use genisoimage to create the iso you will use to burn to disk:

genisoimage -dvd-video -V HOMEVIDEO -o dvd.iso dvd/

16. Move your iso up one level:

mv ~/Videos/dvd/dvd.iso ~/Videos/dvd.iso

17. If you are short of hard drive space, you may want to remove all of the production parts prior to burning:

rm -r ~/Videos/dvd &
rm ~/Videos/*.mp4 &
rm ~/Videos/cam.txt

18. Go up one level:

cd ~/Videos

19. Burn your dvd!

growisofs -dvd-video -Z /dev/sr0=dvd.iso

There you go! This is just one of several tutorials online on the creation of a dvd. Hopefully this is the one you have been looking for.  Please leave comments for improvements and such!


latest Fluxbox Tips, Tricks, and Hints

I have yet to find a window manager better than fluxbox.
Very few window managers do as much with so little, or are so easy to configure. Good job Fluxbox team. Thank you for your dedication. I never fail to find more hidden uses and features. Maybe someday I’ll be able to return in kind.

Anyway, I have updated all of my guides here as of 5-17-09.

Fluxbox with style Deepflux, and GTK theme Deepcyan

Fluxbox with style Deepflux, and GTK theme Deepcyan