pondělí 17. května 2010

Video encoding for Nokia 5310

I needed to encode some video clip to be played on a Nokia 5310 cell phone. After some short research and tuning I have used mencoder. Mencoder is a part of the mplayer package. Mencoder is able to use target profiles for encoding. I have created following profile to create file for Nokia 5310.

[nokia]
profile-desc="MPEG4/AAC"
vf=scale=176:-3,harddup
ovc=lavc=yes
oac=lavc=yes
lavcopts=aglobal=1:vglobal=1:vcodec=mpeg4:vbitrate=65:acodec=libfaac
af=lavcresample=44100
ofps=15
of=lavf=yes
lavfopts=format=mp4

Unfortunately I was not able to run the encoding on Linux (Fedora 12) due to limited support for licensed codecs. Running the task on Windows did the magic. After creating the configuration following commandline did the work:
mencoder source.mp4 -profile nokia -o result.mp4
Video clip playable on Nokia phone was created.

For Windows port of mplayer searches the config in following location:
%MPLAYER_INSTALATION_DIR%\mplayer\mencoder.conf