Sunday, May 31, 2009

single AVI to DVD on linux

Hey guys here is a little script I wrote with some help from here. (Gota give credit where credit is due) I write made this all enclusive script. It requires mkisofs and dvdauthor. You also need a directory in home called convert, and ofcouse a legal copy of the movie in avi format and plenty of disk space. The script will take in an AVI to an ISO. Here is it:

#!/bin/bash
#Written by Ethan Hall (ethankhall (at) gmail (dot) com
#

NAME=$(echo $1 | sed -s 's/.avi//')
#Make directory to work in (located internally)
mkdir ~/convert/$NAME
#convert to NTSF?? format
mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=18:aspect=16/9:acodec=ac3:abitrate=192 -ofps 30000/1001 -o ~/convert/$NAME/$NAME.mpg $1
#write file to convert with dvdautor
echo -e ' ' > ~/convert/$NAME/auth.xml
echo -e "" >> ~/convert/$NAME/auth.xml
echo -e '
' >> ~/convert/$NAME/auth.xml
CURRENT_DIR=pwd
cd ~/convert/$NAME
dvdauthor -o $NAME -x auth.xml
cd $NAME
mkisofs -dvd-video -o ~/$NAME.iso
echo "please press D to delete"
read deleteq
if [ $deleteq -eq 'D' ]; then
echo "Deleting $NAME"
echo "Please press enter to continue"
read deleteq
rm -rf ~/conver/$NAME
fi
#move back to origonal direcotry
cd $CURRENT_DIR

#done

Any questions please email me!

No comments:

Post a Comment