I whipped up a script to convert VOBs to AVIs for storage on ym NFS backend. I'm using mencoder on CentOS5 to do the conversion.
For 9 out of 10 videos, this works great. There is the occasional 1 that will not have the correct audio stream however. I've tried -alang, -slang, aid, etc. to no avail. Here is my script (also in case anyone else finds it useful), but can anyone offer any suggestions on how to get the correct audio in my avi? When I open the vob in mplayer, I get English. When I run it through mencoder, I get Spanish.
Anyway, here's the script:
Code:
#!/bin/sh
# Get the filename into a managable format for saving and convert to lowercase if needed
name=$1
ext=${name##*.}
if [ "$ext" != "vob" ]
then
if [ "$ext" != "VOB" ]
then
echo "Not a VOB movie!"
exit 1
fi
convertname="${name%.VOB}"
echo "Changing file extention to lowercase"
mv "$name" "$convertname".vob
fi
#echo "${name%.vob}"
newmovie="${name%.vob}"
finalname="$newmovie".vob
echo "Pass 1...."
mencoder -ovc frameno -o frameno.avi -oac mp3lame -lameopts abr:br=128 -alang en "$finalname"
echo
echo "Pass 2...."
mencoder -oac copy -o /dev/null -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1200:vhq:vpass=1:vqmin=1:vqmax=31 -vop scale -zoom -xy 720 "$finalname"
echo
echo "Pass 3...."
mencoder -oac copy -o "$newmovie".avi -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1200:vhq:vpass=2:vqmin=1:vqmax=31 -vop scale -zoom -xy 720 "$finalname"
echo
echo "Clean up temp files...."
rm -f frameno.avi
rm -f divx2pass.log
echo
echo "All done."
echo