Monday, June 1, 2009

Batch script for AVI to DVD-ISO

Hey here is a script I am currently testing... it is an extention of the prevous post but it wil take the entire directory and do the conversion.. Here it is.

#!/bin/bash

for file in $(ls *.avi); do
NAME=$(echo $file | 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 $file
#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 $NAME/
rm -rf ~/conver/$NAME
cd $CURRENT_DIR
done

No comments:

Post a Comment