How To Easily Create A DVD From Just About Any Video Format (Linux CLI)

Background
Encoding DVDs seems to be a task which is often overcomplicated.  If you have a video file you would like to convert into a DVD, it turns out it is very easy to do it from the Linux command line.

I was looking for a quick way to encode video to DVD, and I found this fantastic post by vmiimu on the ffmpeg forum. His post was fantastic and gave me the basis to create this guide, so props to vmiimu!  I thought the post was a bit crowded and might be difficult for some people to follow, so I have distilled its essence into this post.

This guide will allow you to convert a wide variety of common video formats into a video DVD.  The scope of this guide is to encode 1 video to 1 DVD with no menu.   The source file can be much larger than a DVD, it will be reduced in size automatically.

Prerequisites
For this guide, you will need the following programs \ commands available.  You may need to install the package from your distribution’s package library.

  • ffmpeg (usually available as a package called ‘ffmpeg‘).
  • dvdauthor (usually available as the package ‘dvdauthor‘)
  • genisoimage (usually available as the package ‘genisoimage‘)
  • growisofs (usually available in the package ‘dvd+rw-tools‘)

Installing these programs is beyond the scope of this guide.  You are assumed to already have them installed.

Hint: If you are using a Red Hat based distro, you may need EPEL and NUX Desktop.

Filenames & Paths Used In This Guide
For ease of understanding, I will be using the following filenames in this guide.  Please substitute your own filenames as you choose.
source.mkv – The original source video file you want to burn to DVD.  This is the only file you must supply, the rest will be created.
temp.mpg – The mpeg encoded video file which will be actually burned to DVD.
dvdmovie – The directory which will store your DVD files during encoding (AUDIO_TS, VIDEO_TS)
dvd.iso – The final .ISO image which you will burn to your DVD.
/dev/dvd – The device path for your DVD burner.


The Process:
Convert the source video to an MPEG video file <4.7GB.
(This may take a long time, and is the most CPU intensive part of the process.)

For videos with 4:3 aspect ratio, use this command:

ffmpeg -i source.mkv -filter:v "scale='if(gt(a,720/480),720,-1)':'if(gt(a,720/480),-1,480)',pad=w=720:h=480:x=(ow-iw)/2:y=(oh-ih)/2" -target ntsc-dvd temp.mpg

For videos with 16:9 (widescreen) aspect ratio, use this command:

ffmpeg -i source.mkv -filter:v "scale='if(gt(a,720/480),720,-1)':'if(gt(a,720/480),-1,480)',pad=w=720:h=480:x=(ow-iw)/2:y=(oh-ih)/2" -aspect 16:9 -target ntsc-dvd temp.mpg

Assemble a DVD file structure.

export VIDEO_FORMAT=NTSC
dvdauthor --title -o dvdmovie -f temp.mpg
dvdauthor -T -o dvdmovie

Generate an ISO image file.

genisoimage -dvd-video -o dvd.iso dvdmovie

Burn the ISO to a DVD disk.
Now would be a good time to insert your blank DVD.

growisofs -dvd-compat -Z /dev/dvd=dvd.iso

That’s It!
Hopefully that went smoothly for you.  Please feel free to post in the comments section if you have any questions or suggestions for improvement of this guide.

3 Thoughts on “How To Easily Create A DVD From Just About Any Video Format (Linux CLI)

  1. Thanks for posting this great tutorial!

    I was able to take your code bits and create an automated script that I put on my own blog here: https://blog.oerkfitz.com/posts/automated-dvd-creation

    One thing I did notice however – is that your ffmpeg command scales the video so that it doesn’t fit a wide screen all the way in the sense that it has a Black boarder around the entire video.

    After doing some research I did find a solution which keeps the original input video at a 16:9 aspect ratio so that it looks good with widescreens.

    All you need to do is add a ‘-aspect 16:9’ (without the ‘ marks) after your ‘scale=’ snippet and all will be fixed.

    Thanks again!

Leave a Reply to Don Oerkfitz Cancel reply

Your email address will not be published. Required fields are marked *

Are you an intelligent human being? * Time limit is exhausted. Please reload CAPTCHA.

Post Navigation