Your Ad Here

AVI to DVD Script (Linux - Ubuntu)

Yesterday, after I got a movie in an AVI format, I was getting really annoyed trying to find out how to make it play on a dvd player. After a while, I found out!

Crazy!

I would like to share my discovery with the world.

Not only do that, but I made my first script to do it all. It asks you where the file is, what it’s called and then you can press enter and wait.


Firstly, you’ll need to download a few things.

mencoder (sudo apt-get install mencoder)

ffmpeg (sudo apt-get install ffmpeg)

dvdauthor (sudo apt-get install dvdauthor)

Now make a new file and paste this in:

#!/bin/bash
## Movie - AVI to DVD Script
## Created by Paul (realtimeedit.com/blog/), 7th October 2007.
echo "Directory?"
read output_file_directory
echo "AVI file name for conversion?"
read input_file_one

##START
cat $input_file_one > dvd.avi
mencoder -o finalmovie.avi -noidx -oac copy -ovc copy dvd.avi
ffmpeg -i finalmovie.avi -y -target ntsc-dvd -sameq -aspect 16:9 finalmovie.mpg
dvdauthor --title -o dvd -f finalmovie.mpg
dvdauthor -o dvd -T
mkisofs -dvd-video -o dvd.iso dvd/
echo "Now burn dvd.iso to a DVD"
##END

Save that as dvd_script in the same folder as the AVI

Now open terminal and use this command to go to the folder you just saved dvd_script in.

cd /path/of/movie/folder/

Then we can run the script.
Type this in terminal:

./dvd_script

It should say “Directory?”, then enter where the file is eg, “/home/user/movie/”

Then press enter and put in the file name eg, “thematrix.avi”

Now let it go. It should take some time, unless you’re on a computer from the future.

After that you can put “dvd.iso” onto a DVD with the program of your choice.

Thanks to Movabletripe for helping me make this.

Note: dvd_script will make the dvd files in the folder it is in.

34 Responses to “AVI to DVD Script (Linux - Ubuntu)”

  1. joe Says:

    you could use a program in the repositories called DeVeDe which is pretty good

  2. Paul Says:

    I’ve never used that before, I’ll give it a look later :)
    Thanks

  3. Ford Prefect Says:

    Why do you make two steps?

    mencoder -o finalmovie.avi -noidx -oac copy -ovc copy dvd.avi

    ffmpeg -i finalmovie.avi -y -target ntsc-dvd -sameq -aspect 16:9 finalmovie.mpg

    What happens if you give the original avi file directly to ffmpeg?

    Thanks!

  4. Paul Says:

    That’s there for people who want to put more than one AVI file into the final movie.
    For example, cat $input_file_one $input_file_two > dvd.avi

    mencoder -o finalmovie.avi -noidx -oac copy -ovc copy dvd.avi
    Will sync the sound with the video.
    I suppose you could take out the ‘mencoder’ line, but I haven’t tried it yet.

    Thanks :)

  5. Mr.C Says:

    if u remove the mencoder line and put your avi streight into ffmpeg u will have really poor fps while converting in my experience

  6. JohnsonFarms Says:

    how do you input more than 1 .avi at a time?

  7. Paul Says:

    ##AFTER
    echo “AVI file name for conversion?”
    read input_file_one

    ##ADD
    echo “Second file?”
    read input_file_two

    ##ON LINE
    cat $input_file_one > dvd.avi

    ##CHANGE TO
    cat $input_file_one $input_file_two > dvd.avi

    Basically you just a space on that line and type in the new file name.

  8. Stig Says:

    What about PAL dvds? And 4:3 aspect ratios, for that matter?

  9. Paul Says:

    on line 12: ffmpeg -i finalmovie.avi -y -target pal-dvd -sameq -aspect 4:3 finalmovie.mpg

    -target pal-dvd

    -aspect 4:3

  10. Video To Dvd Transfer Says:

    I thought that DVD format in Linux Ubuntu Script | Realtimeedit was very interesting. I found you searching on Video To Dvd Transfer Thursday Thanks for the nice post!

  11. Copy Dvd Movies Says:

    Hey!, I fell blessed that I found your post while searching for copy dvd movies. I agree with you on the subject DVD format in Linux Ubuntu Script | Realtimeedit. I was just thinking about this matter last Tuesday.

  12. KA Says:

    Help, the command line returns Permission denied.

    Thank You

  13. Dvd To Dvd Copy Says:

    Hi, what entice you to post an article on DVD format in Linux Ubuntu Script | Realtimeedit? This article was extremely interesting, especially since I was searching for thoughts on this subject last Thursday.

  14. Greg Says:

    Awesome. Just what I was looking for.
    DeVeDe is cool, but it wants mplayer and other things I DON’T want to have to install - I’m a minimalist kind of guy.

  15. Burn Dvd Video Says:

    It\’s Friday, and I thought that you would like to know I really really really liked this article (DVD format in Linux Ubuntu Script | Realtimeedit). I wasn\’t really looking for this (I was searching on \’burn dvd video\’), but I\’m glad I found your blog as a result. Keep up the great blogging!! I\’ve bookmarked you.

  16. Adonis Says:

    Adonis…

    Interesting stuff. I had a weird experience while movie downloading recently….

  17. Greg Says:

    It seems to make too big of an MPG file for standard DVD (4.7Gb) how can I reduce the resolution or richness to squeeze 800Mb AVI file onto normal DVD media?

  18. How To Copy Dvd Says:

    Hey!, I fell blessed that I found your post while searching for how to copy dvd. I agree with you on the subject DVD format in Linux Ubuntu Script | Realtimeedit. I was just thinking about this matter last Friday.

  19. alexand Says:

    how I put subtitles?
    I have move.avi and move.srt

  20. Rob Scott Says:

    I got permission denied as well? Any takers?

  21. professional Says:

    Hello. I think you are eactly thinking like Sukrat. I really loved the post.

  22. jonny rocket Says:

    i will try devede. when i’m in windows i use nero vision express. it works great. the nero part, not the windows part. lol.

  23. Daniel Says:

    Hey, Have used this script a few times now, works great. the DeVeDe doesn’t work for me.

    Great to have found your script was soo easy to you.

    Daniel

  24. kris Says:

    If you have problems with permission denied make shore you are in the correct directory and then type in sh dvd_script.

    Kris

    (thanks for the script much appreciated)

  25. Subzero22 Says:

    Well I just installed WineHQ and then installed ConvertXtoDVD. makes it much easier.

  26. Jamie Says:

    for the guys that are getting

    permission denied

    try

    sudo chmod 755 dvd_script

  27. yarn Says:

    if it says file permission denied then you have to right click on the original dvd_script file and go to permissions…then check allow file to execute progarm or something to that effect.

  28. Hans Says:

    He Paul, great stuff, many thanks. It leaves me with only one question: how to take subtitles into account? I have for example cd.avi and cd.srt, the latter containing Dutcj subtitles. Any help appreciated!

  29. Legal Movie Downloads Says:

    Cool, I was getting that error, thanks for the fix

  30. Legal Movie Downloads Says:

    Interesting, I’ll use this to convert my movies for sure

  31. linuxcrypt Says:

    Awesome script! Thanks for taking the time to post it.

  32. kjm Says:

    WHY NOT JUST LOAD WINFF AND DO IT FROM THE GUI?

  33. KronicDreamer Says:

    Very nice article! :)

    got ubuntu up and wanted to try a few dvd burns…

    ty

  34. ironjade Says:

    The latest version of DeVeDe has a disc usage button which will automatically fit the image to the disc so no more messing with bitrates etc. DeVeDe is one of the most useful Linux apps ever.

Leave a Reply