AVI to DVD


Page 1 of 4 1234 LastLast
Results 1 to 15 of 47

Thread: AVI to DVD

  1. #1
    Join Date
    Dec 2003
    Location
    USA
    Posts
    150

    AVI to DVD

    here's the 6 basic steps to convert a .AVI to DVD so you can watch your movies on your home player, not just your computer. . .But first we need to figure out if it's a fullscreen movie or letterbox movie. . .Movies normally come in two sizes: 4:3 (fullscreen) or 16:9 (letterbox) which they call aspect ratio. . .They also come in two formats PAL (Non-US) and NTSC (US). . .The following examples are for NTSC Only!

    what you need first:
    transcode
    mplayer
    Mjpegtools
    ffmpeg
    dvd+rw-tools
    Dvdauthor
    some hardrive space

    in this example I will be using a 16:9 movie.avi for our conversion. . .

    1.) Split the .avi file into 2 seperate files, one for video and one for audio:

    Code:
    transcode -i movie.avi -y ffmpeg --export_prof dvd-ntsc --export_asr 3 -o movie -D0 -s2 -m movie.ac3 -J modfps=clonetype=3 --export_fps 29.97
    this will make:
    movie.m2v (video)
    movie.ac3 (audio)

    note: if you're doing a fullscreen (4:3) movie then simply change --export_asr 3 to --export_asr 2

    2.) (optional) Extract 5.1 Audio:

    Code:
    tcextract -d2 -i movie.avi -a0 -x ac3 | tcextract -d2 -x ac3 -t raw > movie.ac3
    This is an extra step if you know your .avi file actually has 5.1 surround sound. (Step one only produces a stereo .ac3 file !)
    How can you tell? Do this first:

    Code:
    mplayer -vo dummy -identify movie.avi 2> /dev/null | grep "5.1 ("
    if you get this output then you have 5.1:

    Code:
    AC3: 5.1 (3f+2r+lfe) 48000 Hz 384.0 kbit/s
    if you don't, just ignore this step!

    3.) Put the video & audio file back together:

    Code:
    mplex -f 8 -o dvd_movie.mpg movie.m2v movie.ac3
    this will make dvd_movie.mpg ready for DVD authoring. . .

    4.) open your favorite text editor and paste the following:

    Code:
    <dvdauthor dest="DVD">
      <vmgm />
       <titleset>
         <titles>
           <pgc>
             <vob file="dvd_movie.mpg" chapters="0,15:00,30:00,45:00,1:00:00"/>
           </pgc>
          </titles>
       </titleset>
     </dvdauthor>
    save the file as: dvdauthor.xml
    in the same directory as your movie files
    (you can also change the chapters to fit the times of your movie)

    5.) Create a DVD directory where your movie files are and do this:

    Code:
    dvdauthor -x dvdauthor.xml
    this will create two AUDIO_TS and VIDEO_TS directories in your DVD directory. . .

    6.) Test it & Burn it:

    to test it:
    Code:
    xine dvd:/full/path/to/DVD/VIDEO_TS/
    to burn it:
    Code:
    growisofs -Z /dev/dvd -dvd-video DVD/
    note: I like to use DVD-RW discs for a test before I use a real disc. . .
    If all goes well, the above will produce movie with no menus, just the movie that should play when you put in your disc. . .and if there's more than one .avi then simply do this in your dvdauthor.xml file:

    Code:
    <dvdauthor dest="DVD">
      <vmgm />
       <titleset>
         <titles>
           <pgc>
             <vob file="dvd_movie_part1.mpg" chapters="0,15:00,30:00,45:00,1:00:00"/>
             <vob file="dvd_movie_part2.mpg" chapters="0,15:00,30:00,45:00,1:00:00"/>
           </pgc>
         </titles>
       </titleset>
     </dvdauthor>

    GOOD LUCK!
    Last edited by philtesone; 08-30-2005 at 08:40 PM.

  2. #2
    Join Date
    Oct 2002
    Location
    Republic of Texas
    Posts
    5,898
    Cool deal!
    I never understood why you split the movie, only to rejoin it later...
    Take a look here at a couple of mencoder scripts you might find useful to get around that, unless there's a reason that I don't know about...

    http://jeffrey.homelinux.org/RRweb/ files/mencoder.html

    [EDIT] Oh, I get it...because it's an avi!!! [/EDIT]
    Last edited by je_fro; 06-11-2006 at 02:55 AM.
    Need help in realtime? Visit us at #linuxnewbie on irc.libera.chat

    Few of us will do as much for our fellow man as he has done.
    --Andrew Morton on RMS

  3. #3
    Join Date
    Apr 2003
    Location
    UK
    Posts
    1,180
    Quote Originally Posted by philtesone
    and if there's more than one .avi then simply do this in your dvdauthor.xml file:

    Code:
    <dvdauthor dest="DVD">
      <vmgm />
       <titleset>
         <titles>
           <pgc>
             <vob file="dvd_movie_part1.mpg" chapters="0,15:00,30:00,45:00,1:00:00"/>
           </pgc>
           <pgc>
             <vob file="dvd_movie_part2.mpg" chapters="0,15:00,30:00,45:00,1:00:00"/>
           </pgc>
         </titles>
       </titleset>
     </dvdauthor>
    This will create two seperate titles on the disc, one for each movie file, if that is what you want it's fine. However, if the two files are part of the same movie, you may want them to be joined in the same title, you would then want to use this instead.
    Code:
    <dvdauthor dest="DVD">
      <vmgm />
       <titleset>
         <titles>
           <pgc>
             <vob file="dvd_movie_part1.mpg" chapters="0,15:00,30:00,45:00,1:00:00"/>
             <vob file="dvd_movie_part2.mpg" chapters="0,15:00,30:00,45:00,1:00:00"/>
           </pgc>
         </titles>
       </titleset>
     </dvdauthor>

  4. #4
    Join Date
    Dec 2003
    Location
    USA
    Posts
    150
    Yes! Thank-you, that's what I meant to put up there. . .!

  5. #5
    Join Date
    Sep 2003
    Location
    Rochester, MN
    Posts
    3,604
    Quote Originally Posted by je_fro
    Cool deal!
    I never understood why you split the movie, only to rejoin it later...
    Take a look here at a couple of mencoder scripts you might find useful to get around that, unless there's a reason that I don't know about...

    http://jeffrey.homelinux.org/RRweb/files/mencoder1.txt

    [EDIT] Oh, I get it...because it's an avi!!! [/EDIT]
    Actually, as of pre7 MEncoder can take any format MPlayer will play and convert it to a DVD-compliant MPEG2. I've had a few minor problems with artifacting for a few seconds using that method, but it's really easy and faster than any other way I've seen. If my computer ever stops crashing I'll probably see if I can get the minor issues worked out (they might be fixed in MPlayer CVS too, I don't know).

    More information is here: http://mplayerhq.hu/DOCS/HTML-single...c-feat-vcd-dvd

    IIRC, when I used the -af lavcresample option they list there it crashed on me. I don't know if that's a general problem or just me, but it's something to be aware of.

  6. #6
    Join Date
    Oct 2002
    Location
    Binghamton NY
    Posts
    2,435
    Can't wait to try this! One less reason to boot up the old Windows partition!

  7. #7
    Join Date
    Dec 2003
    Location
    USA
    Posts
    150
    Yea, the transcoding process is the longest step but after that it goes pretty quick. . .
    The reason I've posted this method is:
    1.) it's extremely easy
    2.) it's consistant and it works!
    3.) I had much better results then using TMPEGenc in windows, which you have to pay for
    4.) the 5.1 is awesome!

    I've even added subtitles and chapter menus to some of the movies.
    (I use qdvdauthor or dvdstyler for the menus).
    Here's how I did the subs:

    1.) download the correct subtitle from http://eXTratitles.to

    2.) use a program from dvdauthor called Spumux to add the subtitle text into the DVD video. Just make sure you have a .spumux dir in your home dir and put your fav .tff font in it. I used Vera.tff but any True Type font will do. Open your fav text editor and paste this:

    Code:
    <subpictures>
      <stream>
        <textsub filename="movie.srt" characterset="ISO8859-1"
             fontsize="18.0" font="Vera.ttf" horizontal-alignment="center"
             vertical-alignment="bottom" left-margin="60" right-margin="60"
             top-margin="20" bottom-margin="30" subtitle-fps="29.97"
             movie-fps="29.97" movie-width="720" movie-height="478"/>
      </stream>
    </subpictures>
    save as 'subtitle.xml'

    3.) Merge the subtitles into the DVD video:

    Code:
    spumux -s0 subtitle.xml < dvd_movie.mpg > dvd_movie.mpg.temp
    mv dvd_movie.mpg.temp dvd_movie.mpg
    when complete you should now have subtitles in your dvd_movie.mpg

    I goto http://cdcovers.cc for all my printing and menu needs. . .

  8. #8
    Join Date
    Aug 2001
    Location
    Somewhere, Texas
    Posts
    9,627
    I have to say thanks philtesone, this is the first method I've tried that actually created a perfectly playing DVD for me. All the others I have tried ended up giving me choppy video playback on DVD players.

    I'm going to take what you have here and start a script that can be started and ending up with a DVD for the player, I've got a start on it and kicked it off when I left for work so I'll see if it worked on a generic level when I get home

    Next trick is getting nice menus which there are plenty of nice GUI apps that can help with that (qdvdauthor, dvdstylist)

    Thanks for this! I'll post the script here once I get it 'nice' because right now it's just a kludge

  9. #9
    Join Date
    Dec 2003
    Location
    USA
    Posts
    150
    Thanx! But I can't actually take credit for it, I actually got it from a gentoo forum:
    http://forums.gentoo.org/viewtopic.php?t=117709

    and just posted the steps I used, which in turn I think they got from here:
    http://www.transcoding.org/cgi-bin/t...C_Media_To_DVD

    . . .and like you said it's the only thing that has actually worked right!

    There is another guy who has a script out threre called avitovob here:
    http://inferno.slug.org/cgi-bin/wiki?AviToVob

    which I have tried and it works good, too. But I prefer to use the above method instead. . .

    There is also KMediafactory for creating menus as well, which I have not tried. . .YET!

    And on one movie I did, which was split into two parts with 5.1 surround sound, turned out to be just over 4.5 gigs, too big for a regular DVD disc so I used DVDShrink to get it back down to size without losing much quality. . .But I had to use an earlier version for it to work, I think it was version 1.2 or something. . .The latest version just errored out on me. . .

  10. #10
    Join Date
    Oct 2002
    Location
    Binghamton NY
    Posts
    2,435
    I'm trying to work with half-hour TV episodes. This method seems to require a single avi file, and I'm wondering if there's a way that I could paste several smaller files into one continuous avi file.

  11. #11
    Join Date
    Dec 2003
    Location
    USA
    Posts
    150
    You could do that with Virtual Dub, that would be the easiest. . .The avitovob script also allows you to do more than one video at a time. . .
    But with half hour TV episodes I would simply do each one and just add them individually to the DVD and use either dvdstyler or qdvdauthor to make a DVD menu with links to each seperate episode, that way instead of having one large video with chapters you could have 5 or 6 videos with chapters. . .
    Last edited by philtesone; 09-02-2005 at 06:04 PM.

  12. #12
    Join Date
    Aug 2001
    Location
    Somewhere, Texas
    Posts
    9,627
    I think that would be the best way to do it, and the final result is much nicer being orginized.

    But if you want to join a bunch of AVIs into one file and they are all the same resolution and sample rates, avimerge handles that very well (installed with transcode)

  13. #13
    Join Date
    Oct 2002
    Location
    Binghamton NY
    Posts
    2,435

    Thumbs up

    YES! YES! YES! Just authored my first ever DVD in Linux-- and I really don't miss having a menu. What's wrong with just putting it in and having it play? Not a damn thing.

    The hard part for me was the home stretch. The file tested just fine, but I had only burned CDs and DVDs with K3b, and that wasn't working. So I tried CD/DVD Creator. Copying the files into the window and hitting the burn button was so simple I was sure it couldn't possibly be working, but it was.

    I'm watching the DVD now (Showtime's "Weeds", starring the always talented and always delicious Mary-Louise Parker). There were a few glitches in the playback. Where does that sort of thing usually originate? I'm guessing the problem is in the DVD's themselves.

    Thanks for the tip. Like I said before, one less thing I need Windows for! Next, I hope to learn how to make video CD's!

    BTW, I love the aspect ratio adjustment. As far as I can tell, the Windows software I've been using doesn't have that setting.

    I've got three years of avi files around here, and I intend to keep encoding and burning DVDs until I no longer have to return to this page to rememember how to do it.
    Last edited by blackbelt_jones; 09-02-2005 at 09:24 PM.

  14. #14
    Join Date
    Aug 2001
    Location
    Somewhere, Texas
    Posts
    9,627
    You can adjust the encoding of the file with transcode to make the final file smaller so you can fit more vids on a single disk. Read the man page for more details

    # Added "-Z 352,fast" to test compression
    # Added "-G .7" lighten with compression

    transcode -i "$FILE" -y ffmpeg --export_prof dvd-ntsc --export_asr 2 -Z 352,fast -G 0.7 -o movie -D0 -s2 -m movie.ac3 -J modfps=clonetype=3 --export_fps 29.97

  15. #15
    Join Date
    Oct 2002
    Location
    Binghamton NY
    Posts
    2,435
    Quote Originally Posted by Icarus
    You can adjust the encoding of the file with transcode to make the final file smaller so you can fit more vids on a single disk. Read the man page for more details

    # Added "-Z 352,fast" to test compression
    # Added "-G .7" lighten with compression

    transcode -i "$FILE" -y ffmpeg --export_prof dvd-ntsc --export_asr 2 -Z 352,fast -G 0.7 -o movie -D0 -s2 -m movie.ac3 -J modfps=clonetype=3 --export_fps 29.97
    When I made my DVD from a half hour show, it was less than 900 mb. Is there any reason why, if I got it down under 700 mb, I couldn't put it on a CD?

    Here is the Transcode Wiki by the by:

    http://www.transcoding.org/cgi-bin/transcode

    (edit)
    Looking back after some sleep, I can see that there's a lot from this thread that I didn't quite comprehend right away, especially the prescription for putting multiple files on 1 DVD which I am trying right now, and the command for burning DVDs at the cli, which I somehow missed the first time, and I am also trying right now. I guess I can't help it if I'm a little slow, but I've got a lot of blank DVDs, so I'm gonna keep practicing this weekend, until I can comprehend every nuance.
    Last edited by blackbelt_jones; 09-03-2005 at 10:16 AM.

Posting Permissions

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