Archive

Posts Tagged ‘Convert DVD’

Convert DVD to Windows Mobile AVI

December 24th, 2009

As part of my work, I occasionally travel, and often find myself getting stranded at either the airport, hotel, restaurant, etc.. With any travel there is down time, and Linux Journal will generally tide me over, once I have gotten caught up on Dave Yates’s LottaLinuxLinks(.com) podcast (no I don’t know Dave, but I am just a huge fan of his show). Well being both an AT&T customer, and corporate email user for my cell phone needs I am stuck with Windows Mobile as a my Phone of “choice” (though admittedly I would just soon skip corporate email if AT&T offered an Android). Nevertheless, the Windows Mobile Media Player doesn’t seem to support large AVI files, nor .OGG files (which means no lottalinuxlinks.com podcast), so I needed a solution. After a lot of digging I was able to find a successfully compiled version of TCPMP for my HTC pure. This is a good (not perfect) open source media player for anyone not familiar with it. Well back to the problem at hand I needed more to entertain me, so I did some digging and put together this quick (as in fast to write, no execute) script to convert a DVD movie into an AVI. This is by no means perfect, and could use some tweaking to keep the file size down and the scale more appropriate, but I thought this might be useful.
Pre-requisites:
TCPMP or some other pocket player that can handle larger AVI files     TCPMP
External storage (the end result is usually a couple of hundred MB).
mencoder (my initial experience of this encoding application, is that it has an insurmountable number of options, and that is specifically why it is incredibly powerful, and why I needed a script).     MPlayer and Mencoder Home

Next save this as a script appropriate to your OS. Mine is for Linux, but you can convert the lines to appropriate to any distribution. Just as a reminder prepare for this to take some time to run this is honestly a four pass encoding to allow for me to half the full video, and a mobile version.

#!/bin/sh
# This requires two command line parameters this can be preset as appropriate.
if [ $# -eq 2 ];
then
# Audio stream is separated from the DVD.
# WARNING THIS IS SET TO THE CURRENT WORKING DIRECTORY, I WOULD DISCOURAGE THIS AND SET IT TO ANY DIRECTORY YOU WANT TO STORY THESE FILES IN.
    rm -f ./frameno.avi
    mencoder $1 -ovc frameno -o ./frameno.avi -oac mp3lame -lameopts vbr=3
# First Pass encoding
    mencoder $1 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o ./$2
# Second Pass encoding
    mencoder $1 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o ./$2
    ## Comment out the next line for standard AVI or non-mobile this also creates the mobile version with the name mob_xxxx
    mencoder ./$2 -vf scale=400:240 -oac mp3lame -ovc lavc -o ./mob_$2
else
    echo Usage:
    echo convertVideoToAVI.sh \(file or dvd:////dev/sr0\) \(outputfilename.avi - mob_ is tacked on for the mobile file\)
    echo “\t$0 FILE”
fi

As always thank you for reading, and happy holidays,
- - tekgnu - -

tekgnu General, OpenSource , , , ,