ENTRY
[ESC]How to Burn a DVD on Linux
Preface
Recently, I have been burning some of the media that I get off of the Internet to physical discs (is it disc or disk? I'm going to use disc when referring to CD's or DVD's). I started a few months ago after I was curious how it would work, and now I have a small binder completely filled with DVD's and CD's holding my favorite movies, TV shows and music. I need more space already.
The process is ever so slightly complicated by the fact that Linux (CachyOS/Arch btw) is my main operating system. Discs are a medium that have been around for a long time, so there is already major support for them already. Despite this, most of the GUI software I have used has felt buggy and unstable. There were a few times that I had to throw away a disc because the software errored during the write. Sometimes, said software has refused to burn certain files for apparently no reason.
This inspired me to write a clear, condensed guide for performing this process manually on Linux, since I've had difficulty finding such documentation myself. I'm going to focus specifically on burning DVD's since in my experience it seems to be the more error-prone process.
CD's are a lot easier to burn using software with a GUI - Brasero and XFBurn come to mind. With those programs, you just add the tracks you want to burn, slide in the CD and press go; however, DVD's are a little more complicated.
My guide is based off of this one I found. This guide is not very well formatted (which was also part of my inspiration), but the commands in it worked for me; thus, I'll provide those same commands along with my own generalized explanations of what they do.
The following steps require basic Linux terminal knowledge. In my opinion, the commands are pretty easy to run by just copying and pasting, but you need to know how to navigate a Linux file system and make modifications to the commands as needed in order to succeed.
Supplies
In order to burn DVD's, you're going to need some on hand. Even though they have largely fallen out of mainstream use, you can buy lots of them for pretty cheap. I recommend starting with a pack of 25 in case you decide that you don't want to deal with disc burning.
Of course, you may not even have to buy some. These discs were mass-produced when they were in their heyday and used by almost everyone; ask an older, more-or-less tech-savvy relative or friend if they have some blank ones lying around.
You'll also need a USB disc reader/burner. Just search "USB disc burner" on any tech storefront and you'll be able to find one.
I recommend buying a disc binder for storage purposes. These can also be found for pretty cheap on eBay or Amazon. It's a good idea to do this because if the bottom of the discs get scratched or damaged in any way, the disc may become unusable. The idea here is to create physical media that has more longevity than its digital counterpart, so you may want to invest in their protection.
Step 0: Install the required software
There are a few software packages we're going to need before we start getting to work. A lot of GUI-based disc burners use these packages under the hood, so I had most of them installed already, but if you're completely fresh to this, you're going to need to get these packages with your distro's package manager. I'm on Arch, so, for example, I would run:
pacman -S ffmpeg dvdauthor genisoimage vlc
ffmpegis required to convert our files to a format that is readable by a DVD player.dvdauthoris the program that organizes the files into a structure recognizable by a DVD player.genisoimagecreates an ISO file, which is the actual file that is burned onto the DVD.vlcis a jack-of-all-trades media player that integrates well with CD's and DVD's. You'll need this to make sure that your discs actually work.
Step 1: Set the video format
DVD players read different formats per region, NTSC and PAL (I think there are some other minor ones, too). NTSC is the format used by most disc players in the Americas, so that's what I'm using.
In order to tell our commands to use this disc format, we need to set an environment variable to NTSC. To temporarily set that for the current terminal session, run:
export VIDEO_FORMAT=NTSC
This is only required for the dvdauthor command.
To have this variable persist across terminal sessions, you simply have to add this command to the end of the .bashrc file in your home directory.
Step 2: Convert your media
If you're a pirate like me, you'll have tons of video files waiting to be burned. Copy one of your favorites and place it in an accessible directory. cd Into that directory and run this command:
Before you run any commands, I recommend that you read both this step and the next one in their entirety to determine the complete command you want to run.
ffmpeg -i jellyfish-jam.mkv -target ntsc-dvd jellyfish-jam.mpg
This command is pretty simple: we're converting our video file to another video file format for an NTSC DVD. The -target argument tells ffmpeg to automatically set the bit rate, codec, etc. for a DVD. The target file doesn't have to be a .mkv, it can be any video format. ffmpeg Will tell you if a video format can't be converted to .mpg.
Aspect Ratio
If the video file you have is for a widescreen, or is some other undesirable aspect ratio, you can add this argument to the command: -aspect 16:9. This will set your desired aspect ratio to whatever you input. This is not a requirement for most standard 1080p videos. If you apply this to a video that doesn't need it, the video will end up looking stretched or shrunken.
Audio Tracks
I personally don't have this problem at the moment, but if you have a file that has multiple audio tracks, you'll have to perform this extra step. This usually happens when a video has multiple languages on it, so you have to pick which one is the default. If this is the case, add this argument to the command: -map 0.0 -map 0.2.
Track 0.0 is usually the video track, while 0.2 is the example desired audio track. It's up to you to inspect your video file and determine which audio track you want to be the default.
Step 3: Create the DVD file structure
Now we're moving on to using dvdauthor. I recommend that you create a separate directory for these files as it's going to create a couple of new directories. Once you're ready, run this command:
dvdauthor -o dvd -t jellyfish-jam.mpg
-o Specifies the output directory, the new one that we just created. -t Specifies the target file (based on the original guide, this might actually mean the "title" file but I think it's better to think about it as target instead). You'll want to re-run this command for each file you're burning to the disc.
Do note that you'll have to make sure that you stay within your disc's storage limits if you're adding multiple files, or one large file. You will see errors later on in the process if you try to burn an ISO that is 7 GB in size onto a disc that can only contain 4.7 GB of data. That's an advantage of the GUI applications for this process; they can show you the limits, but we're here because everything else about those apps sucks!
Validating the structure
Once this is done, take a look inside your dvd (or whatever you named it) directory. You should see something like this:
dvd/
AUDIO_TS/
VIDEO_TS/
VTS_01_0.BUP
VTS_01_0.IFO
VTS_01_1.VOB
VTS_01_2.VOB
VTS_01_3.VOB
The AUDIO_TS directory should be empty. The audio tracks are contained within the video files.
If you added multiple files to the DVD, you should see other "VTS" prefixed files, such as VTS_02_*, etc. I've observed that videos are stored on DVD's in this partitioned format. There's likely a maximum size a single file can be on a disc, so the entire title or video itself is stored across multiple individual files, sort of like how one program used to be stored on multiple floppy disks (discs?).
There's one thing still missing in this structure, and that's the info file that tells the DVD player everything about the entire disc.
Step 4: Finalizing the file structure
Once you've verified your DVD's file structure, run this command:
dvdauthor -o dvd -T
The -T argument signals that you want to create another .IFO file in the output directory. This essentially just wraps up the whole process and creates a collection of files that are in a valid DVD organization. The reason this is the last step is because all of the files need to be added before this is done, as dvdauthor needs to know everything that's there in order to create the summary file.
Step 5: Generating the ISO file
If you've ever flashed any operating system onto a USB stick, you likely used an ISO file. This is a similar process, except we're burning a much smaller ISO onto a disc. Run the following command:
genisoimage -dvd-video -o jellyfish-jam.iso dvd
-dvd-video Signals that you want to create an ISO file intended to be burned onto a DVD. -o Specifies the output file as well as the input directory. I don't know why they designed it this way, but that's how it is.
Congratulations, you now have a file containing your media that can be properly burned onto a DVD!
Step 6: Burning the ISO file
There are two ways to go about this: with a GUI program or with the command line.
I have only had success with GUI programs in this step. For me, GUI programs have failed in the process of creating the ISO file for some reason. They just cannot format the media correctly and always crash or freeze, but they usually perform fine when directly given a valid ISO.
The original guide provides a command, growisofs, that can burn the disc from the command line, but I will go over the GUI method first.
GUI
I recommend installing Brasero or XFBurn. These apps should be available through your package manager. For example, run:
pacman -S xfburn
Once it's installed, open it and choose an option such as "Burn Image" or "Burn ISO file." It will prompt you to choose which ISO you want to use, and you'll select the one you made in the previous step. Make sure the ISO does not exceed your selected disc's storage capacity then click forward or continue, and confirm everything. You should hear your disc burner start to spin the disc. Don't worry if it makes a bunch of weird sounds, it's all part of the process.
CLI
If you insist on continuing to use the command line (I don't blame you), you'll need to install growisofs:
pacman -S growisofs
In the original guide, the following command is provided:
growisofs -dvd-compat -Z /dev/sr0=jellyfish-jam.iso
The -dvd-compat signals that you want maximum compatibility with DVD players, and the -Z argument specifies the disc volume you want to burn the ISO to.
When I ran this command, it failed and rendered the disc unusable. That's why I haven't continued to try and make it work because I don't want to generate more e-waste. Proceed at your own risk!
Try not to create e-waste! Discs are only recyclable as art projects, which you'll be obligated to create if you accidentally make yours unusable. ;)
Conclusion
Once your disc is successfully burned, the disc reader should pop open. If you want to make sure it works, just push the tray back in. Your OS should show a notification similar to one when a USB is plugged in. Open that notification and try to open the DVD with VLC Media Player.
VLC should automatically interpret the DVD's data and present the video to you. If you have multiple titles on the disc, you may need to let each title finish on its own before it will proceed to the next title. You can also manually pick which title to play in VLC by going to Options > Open Disc and incrementing the title picker.
That's it! It's a sort of lengthy process, but it's not that difficult. I'm surprised how all of the GUI applications I've tried have screwed it up so badly, but I guess it's easier said than done to automate DVD burning, especially when multiple titles are involved.
I hope you produce many records of your media with these commands.
Join the conversation