|
|
|
Transcoding Windows Mobile Media |
|
|
|
Transcoding videos to Windows Mobile Format (.3gp)
Windows Mobile Phones with cameras record video using MP4 with AMR audio.
Once you have this video, you might want to do something else with it, like transcode it to a flash video.
You also might want to take an existing AVI file and convert it to a format that Windows Mobile Media Player will play.
These steps will take you through the process using a PC running Ubuntu. I have tested this with 7.10 (Gutsy) and 8.04LTS (Hardy)
If you use other Linux Distributions, the steps should be similar. If you don't run Linux, you can download and Burn an Ubuntu install
disc from www.ubuntu.com. You can use CDBurnerXP to burn the ISO
file to a disc. The installer will walk you through repartitioning your hard drive
to make room for Ubuntu. If you don't have the nerve for repartitioning, you can either install Ubuntu as a Windows Application
using the wubi Ubuntu Installer or if you have plenty (1GB+) of memory, you can use the
excellent VMWare Player and download an
Ubuntu Virtual Appliance.
So, you have Ubuntu running and you are ready to start transcoding. In order to do so, you will need a few things.
MP3Lame, svn & build-essential
First, you will most
likely want MP3 support so let's grab that. Since we are going to be compiling stuff, lets get build-essential also.:
sudo apt-get install lame liblame0 liblame-dev build-essential svn
AMR
Next, you are going to need AMR Support. I grabbed the most recent NB and WB files from http://ftp.penguin.cz/pub/users/utx/amr/ :
cd /usr/local/src
mkdir amr
cd amr
wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.1.tar.bz2
wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.2.tar.bz2
tar xvjf *bz2
cd amrnb-7.0.0.1
./configure --prefix=/usr
make
sudo make install
cd ../amrwb-7.0.0.2
./configure --prefix=/usr
make
sudo make install
FFMPEG
Now we need to download and build the latest ffmpeg. Sure, Ubuntu comes with ffmpeg, but not with amr.
cd /usr/local/src
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-libamr-nb --enable-libamr-wb --enable-libmp3lame --enable-nonfree --prefix=/usr
make
sudo make install
If all went well, we should have a shiny new ffmpeg ready to transcode videos.
To make life easier, I use a bash script:
vid2phone:
#!/bin/bash
until [ -z "$1" ]
do
BASENAME=`basename "$1" | tr [:space:] _ | tr . -`
ffmpeg -i "$1" -r 15 -s 320x240 -vcodec mpeg4 -acodec libamr_nb -ar 8000 -ab 4.75k -ac 1 $BASENAME.3gp
shift
done
This takes any number of video files as command line parameters and attempts to create MPEG4 15fps amr mono files
with the same base name and a .3gp extension.
|
|