Find the answer to your Linux question:
Results 1 to 6 of 6
Like Tree5Likes
  • 3 Post By gruven
  • 2 Post By gruven
I have been looking for this stuff for a while, and while it is out there, the documentation is fragmented. I am posting here the steps that I am using ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Enthusiast gruven's Avatar
    Join Date
    Dec 2004
    Location
    Arkansas
    Posts
    541

    How to convert a video file to an iso to burn to dvd


    I have been looking for this stuff for a while, and while it is out there, the documentation is fragmented. I am posting here the steps that I am using to create dvds from regular video files with completely free software. I use Linux, and I don't know if the tools are available in Windows or not. This tutorial is for linux. There are probably gui tools to do all of this stuff, but I have found that the command line tools are much more efficient and just work a lot better. They don't crash near as often, and give you a lot better errors if you have errors.

    Use your package manager to install ffmpeg, dvdauthor, growisofs and genisoimage. You may want to install vlc just to test that the iso file is what you want before you burn it. I use debian, so my commands would be like this:
    Code:
    sudo apt-get install ffmpeg dvdauthor genisoimage growisofs vlc
    Now, you have all the tools you need to convert your video file to an iso to burn to a dvd and it will play on regular dvd players.

    Before you begin, it is best to do a
    Code:
    export VIDEO_FORMAT=NTSC
    so that you don't get errors from dvdauthor. You can set this in /etc/profile if you want. Of course, if your default video format is PAL, replace NTSC with PAL.

    There is a trick that I have found to getting widescreen movies to format right for the dvd, and that is to pass the "-aspect 16:9" option to ffmpeg. It will make the .mpg file look squished, but the dvd will burn correctly. This is why I recommend installing vlc to test the .iso file before you waste a dvd.

    Ok, lets get to it!
    Get you a video file. I have used all kinds, but mostly I convert .mkv files to mpg to use. I don't really care how you got the video file either.

    Now that you have a video file, you want to convert it to a dvd readable format, which is .mpg. We will use ffmpeg to do this, and this is how:
    Code:
    ffmpeg -i yourfile.mkv -target ntsc-dvd yournewfile.mpg
    First, we call the program, "ffmpeg". The "-i" just declares your input file, and the "-target ntsc-dvd" defines the type of dvd we are making.

    Depending on the size of the file you are converting, it could take a while. I usually convert 8+ GB files so it takes an hour or so.

    If you have a widescreen movie, then you will want to declare "-aspect 16:9" in the command so that it will keep the widescreen format when you convert it to iso.

    Code:
    ffmpeg -i yourfile.mkv -target ntsc-dvd -aspect 16:9 yournewfile.mpg
    We have that down now. We can convert regular and widescreen movies to a dvd friendly format. We aren't done with ffmpeg just yet. There is one more trick that has come up for me, and that is "-map".

    When you have more than one audio track, ffmpeg will use the first one as default. It doesn't matter if it is your native tongue, it still uses it. We can change that with "-map".

    Let's say we have a file with two audio tracks. One is german, one is english, and german is the first one. The video track is usually the first one (0.0), so we will define two maps because ffmpeg wants you to define all the maps that are being output, which is usually two.

    The german audio will be (0.1) and the english audio will be (0.2). By default, with no specification, ffmpeg will use the german audio track because it is first. Here is how we specify for ffmpeg to use english:
    Code:
    ffmpeg -i yourfile.mkv -target ntsc-dvd -aspect 16:9 -map 0.0 -map 0.2 yournewfile.mpg
    You notice that we defined the video track (0.0) and the english audio track (0.2). If your video only has one video track and one audio track, you don't need to use map at all.

    Now, run the command (whichever one you need) and wait. When it is done, you should have a nice new .mpg file to play with. You should know that ffmpeg does much more than this, but that would exceed the scope of this tutorial. Maybe when I experiment more with video editing, I will explain more of ffmpeg in other tutorials.

    We can move on to dvdauthor now.

    Dvdauthor takes the .mpg files and creates a dvd file structure suitable for playing in dvd players. To create a simple structure from one of your .mpg files, you need to create a directory to put your dvd file structure in. I usually make a folder with the same name as the project I am working on.
    Code:
    mkdir dvd
    dvdauthor -o dvd -t yournewfile.mpg
    The "-o" switch defines the output folder, and the "-t" switch defines the title file. You will do this command for every file you want to put on your dvd. You can put as many as you want, as long as you have enough space on your disk.

    When you add your files, you can then create a TOC (table of contents) so that genisoimage can read it to create the .iso file. That command is:
    Code:
    dvdauthor -o dvd -T
    The "-o" switch once again defines the output folder, and the "-T" switch defines a TOC.

    We are now ready to convert your dvd to an .iso file to burn.

    The command we use to convert all of that is:
    Code:
    genisoimage -dvd-video -o yourimage.iso dvd
    The "-dvd-video" switch tells genisoimage to create a dvd video image, and the "-o" switch is once again the output file. The last bit at the end is the folder that genisoimage will read from to create the .iso image.

    Now, use vlc and open the file and see if it is what you wanted it to be. If not, go through the steps and see if you can't change something to get it right.

    Once you have created the .iso image, you can use whatever you want to burn it, but I have been happy with growisofs. I find that command line burners are faster and just more convenient.

    Code:
    growisofs -dvd-compat -Z /dev/sr0=yourimage.iso
    The "-dvd-compat" switch means maximum compatibility with dvd video players, and the "-Z" switch means open an initial session to burn onto. /dev/sr0 is your dvd burner, and yourimage.iso is the file you created.

    Now, go watch your movie!
    rokytnji, jayd512 and Jonathan183 like this.

    Linux User #376741
    Code is Poetry

  2. #2
    Just Joined!
    Join Date
    Jun 2011
    Posts
    18
    We have a excellent GUI to do that, the program is devede.

  3. #3
    Linux Guru rokytnji's Avatar
    Join Date
    Jul 2008
    Location
    Desert
    Posts
    4,037
    We have a excellent GUI to do that, the program is devede.
    Gruven said:

    There are probably gui tools to do all of this stuff, but I have found that the command line tools are much more efficient and just work a lot better. They don't crash near as often, and give you a lot better errors if you have errors.
    But in the spirit of your post I will post the link since you are a new member.

    DeVeDe

    Happy Trails, Rok
    Linux Registered User # 475019
    Lead,Follow, or get the heck out of the way. I Have a Masters in Raising Hell
    Tech Books
    Free Linux Books
    Newbie Guide
    Courses at Home

  4. #4
    Linux User zenwalker's Avatar
    Join Date
    Feb 2010
    Location
    Inland Empire
    Posts
    292

  5. #5
    Linux Enthusiast gruven's Avatar
    Join Date
    Dec 2004
    Location
    Arkansas
    Posts
    541
    Yeah, I know about these programs, but for some reason, the gui programs LOVE to crash in the middle of doing something.

    Honestly, if I wanted a gui to do these things, I would have used Windows.

    Sorry for the helpful post guys. I just thought I would help a few of the people who enjoy using the command line as much as me.

    And for dvid who said devede, yes I use it sometimes. It likes to add static to my audio when I encode to dvd on most .mkv files. I am converting 8 - 16 GB files, and most of the gui programs crash about 2 GB into the files.

    k9copy crashes when I start to convert just about anything.

    You know, these gui tools you guys keep recommending are just visual frontends to the commands I am using. Why not cut out the middleman?

    Oh, and thank you rokytnji for the like.

    Wow.
    Last edited by gruven; 06-17-2011 at 05:25 AM.
    Jonathan183 and MikeTbob like this.

    Linux User #376741
    Code is Poetry

  6. #6
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    I just now saw this...
    gruven, that's an awesome tutorial
    Simple and to the point.
    You get a
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •