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.


October 9th, 2007 at 6:56 pm
you could use a program in the repositories called DeVeDe which is pretty good
October 9th, 2007 at 7:06 pm
I’ve never used that before, I’ll give it a look later
Thanks
October 16th, 2007 at 2:06 pm
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!
October 16th, 2007 at 5:52 pm
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
October 17th, 2007 at 8:14 pm
if u remove the mencoder line and put your avi streight into ffmpeg u will have really poor fps while converting in my experience
October 21st, 2007 at 7:53 pm
how do you input more than 1 .avi at a time?
October 21st, 2007 at 9:21 pm
##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.
October 23rd, 2007 at 3:12 pm
What about PAL dvds? And 4:3 aspect ratios, for that matter?
November 6th, 2007 at 7:35 pm
on line 12: ffmpeg -i finalmovie.avi -y -target pal-dvd -sameq -aspect 4:3 finalmovie.mpg
-target pal-dvd
-aspect 4:3
November 15th, 2007 at 8:50 pm
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!
December 4th, 2007 at 11:43 am
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.
December 6th, 2007 at 3:04 am
Help, the command line returns Permission denied.
Thank You
December 6th, 2007 at 11:48 pm
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.
December 8th, 2007 at 3:22 am
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.
December 22nd, 2007 at 1:59 am
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.
December 27th, 2007 at 5:37 pm
Adonis…
Interesting stuff. I had a weird experience while movie downloading recently….
January 7th, 2008 at 4:34 pm
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?
January 11th, 2008 at 11:46 am
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.
May 21st, 2008 at 5:35 am
how I put subtitles?
I have move.avi and move.srt
July 5th, 2008 at 10:42 pm
I got permission denied as well? Any takers?
July 19th, 2008 at 3:36 am
Hello. I think you are eactly thinking like Sukrat. I really loved the post.
July 27th, 2008 at 3:33 am
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.
August 18th, 2008 at 4:13 am
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
August 30th, 2008 at 6:42 am
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)
September 3rd, 2008 at 3:30 am
Well I just installed WineHQ and then installed ConvertXtoDVD. makes it much easier.
September 9th, 2008 at 4:04 pm
for the guys that are getting
permission denied
try
sudo chmod 755 dvd_script
September 12th, 2008 at 8:08 pm
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.
October 11th, 2008 at 9:58 pm
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!
October 27th, 2008 at 8:09 pm
Cool, I was getting that error, thanks for the fix
November 2nd, 2008 at 7:53 am
Interesting, I’ll use this to convert my movies for sure
November 21st, 2008 at 2:55 pm
Awesome script! Thanks for taking the time to post it.
November 24th, 2008 at 6:25 pm
WHY NOT JUST LOAD WINFF AND DO IT FROM THE GUI?
December 29th, 2008 at 5:05 pm
Very nice article!
got ubuntu up and wanted to try a few dvd burns…
ty
January 13th, 2009 at 4:48 pm
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.