November 6, 2009 · General · Email This Post

Sponsored Link
This tutorial will explain Howto Convert AVI to DVD ISO in Ubuntu

Preparing your system

First you need to install following packages

sudo aptitude install ffmpeg mencoder lame dvdauthor lame-extras libtwolame0 genisoimage

Now create a file avi2dvd

sudo gedit /usr/bin/avi2dvd

Add the following contents

#!/bin/bash

output=$1
####################
# avi     Function #
####################

function avi {
mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf scale=352:196,expand=352:240,harddup -srate 44100 -af lavcresample=44100 -lavcopts     vcodec=mpeg1video:keyint=18:vrc_buf_size=327:vrc_minrate=1152:vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 -ofps 30000/1001 -o output.mpg "$output"
}

####################
# vcd     Function #
####################

function vcd {
ffmpeg -i output.mpg -target ntsc-dvd -aspect 4:3 output2.mpg
}

####################
# rm1mpg Function #
####################

function rm1mpg {
rm output.mpg
}

####################
# convert Function #
####################

function convert {
dvdauthor -o dvd -t output2.mpg
}

####################
# rmpg     Function #
####################

function rmpg {
rm output2.mpg
}

###################
# Rename Function #
###################

function finalize {

dvdauthor -o dvd -T

}

#####################
# ISO Function      #
#####################

function image {

mkisofs -dvd-video -o dvd.iso dvd/

}

#####################
# rm2 Function      #
#####################

function rm2 {

rm -rf dvd/

}

###############
# Script      #
###############

avi ;
vcd ;
rm1mpg ;
convert ;
rmpg ;
finalize ;
image ;
rm2 ;

exit

Save and exit the file

You can download this script from here . This file name is avi2dvd.sh script

Now change this file permissions with the following command

sudo chmod 755 /usr/bin/avi2dvd

place your avi file into a directory of your choice and cd into it

cd /home/someuser/avidirectory

run this comand

avi2dvd *

it takes about an hour but the end result is an iso to burn using your favorate cd burning software k3b, nero etc

You can also use DeVeDe to do this.
Credit goes Here

Sponsored Link

Incoming search terms:

Related posts

12 Comments to “Howto Convert AVI to DVD ISO in Ubuntu”

  1. knewell says:

    Or just use Devede :)

    [Reply]

  2. LinuxCanuck says:

    Why bother? Use Devede and you can convert from avi plus flv, mp4, divx and more. What’s more you just drag and drop the files. I don’t know why people insist that the commandline is easier. This all seems to be wasted effort.

    [Reply]

  3. nhasian says:

    thats a lot of work. DeVeDe makes it easy.

    sudo apt-get install devede

    [Reply]

  4. emike says:

    I just wanted to echo the opinion of the others above. I have found devede to be very simple to use and would highly recommend it.

    [Reply]

  5. Jgonick says:

    I’ll have to check devede out, but I also like knowing how to do this from a command line. Thanks for the article.

    [Reply]

  6. zvaral says:

    Command line is no doubt sometimes more effective than using a GUI. Imagine that you have 100 avi files in a directory and you want to convert them all to separate DVDs. What you need to do if you have the above script:

    for p in *.avi; do avi2dvd.sh $p; done

    and you go back four days later having 100 DVDs. I think it took much more time opening the 100 files separately and pressing buttons to convert.

    Do not fear of command line!

    [Reply]

  7. MarcoA says:

    Why not to add a line to burn the DVD using growisofs?

    [Reply]

  8. RoWa says:

    Great Script, because DEVEDE isn’t working for me.

    However, is it possible to put more than one avi on a dvd using the command line?
    Would be great to have a script, that puts all of the files in the directory to a dvd, shrinking them to fit on one disk and creating a dvd-menu to select them… :)

    [Reply]

  9. A_T says:

    Thanks. No gui for me! I like to use commandline so that I can feel smug.

    [Reply]

  10. zvaral says:

    I would note that a more better quality is achieved by using the following mencoder comment in avi function instead:

    mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
    -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 \
    -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\
    keyint=15:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 25 \
    -o movie.mpg movie.avi

    (source: mplayerhq.hu)

    [Reply]

  11. jonny rocket says:

    devede is what i have using for a long time. the first versions were buggy, but now it is cool.

    [Reply]

  12. Sergent says:

    Thanks to the guy who published this info, it is always useful to know how the machine works and not only be a submissive user of somebody else’s SW. At the very end of the article he says ‘…or use devede’. So what is about all those comments to recommend using devede or about feeling rhetorically snug to use the command line.
    Thank the guy who taught you something and log off.

    [Reply]

Leave a Reply