[MPlayer-users] mencoder h264 encoding and Android telephones

Mohammad Bahathir Hashim bahathir at gmail.com
Wed Oct 27 07:57:30 CEST 2010


On 2010-10-23, Malte Gell <malte.gell at gmx.de> wrote:
> Hi there!
>
> Does anyone have experience with h264 encoding for an Android handset?
>
> I have a HTC Desire with Android 2.2 and used the following mencoder command 
> to create an MPEG4 video. But the mobile phone cannot play it. So I wonder 
> now, what the correct h264 options is to create a MPEG4 video playable on 
> Android devices.
>
> This is what I used:
>
> mencoder -ovc x264 INPUT.avi  -oac lavc -lavcopts acodec=libfaac:abitrate=128 
> -srate 48000 -af channels=2 -of lavf -ofps 25 -lavfopts format=mp4 -o 
> OUTPUT.mp4
>
> But, my Desire could not play it. Thanx for any hints!
>
> Malte



Hi.
Beside mencoder, most of the time I use ffmpeg for the convertion. If
the flv file has H264 video codec and AAC audio codec (example:
youtube's flv), simply 'copy' both stream to mp4 container. 

$ ffmpeg -i IN.flv -acodec copy -vcodec copy  OUT.mp4

In my experiences, most of the mp4 files which I converted from flv with
this method are playable on my Nexus One (FRG83)

For other codecs or format, I use this. Make sure you have the
ffpreset files installed accordingly.

$ ffmpeg -i IN.avi -vcodec libx264 -vpre baseline -vpre hq \
-acodec libfaac -ac 2 -ab 128k OUT.mp4

Recent ffmpeg (svn) already changed the preset hq (-vpre hq), and you can
try '-vpre slow' as the replacement.

Thank you.



More information about the MPlayer-users mailing list