FFMPEG convertion not working on android

2 replies [Last post]
eu
eu's picture
User offline. Last seen 44 weeks 2 days ago.
Joined: 07/11/2011
Points: 7

Hi,

Im using Kaltura HTML5 player, and usign ffmpeg on my server to convert videos to webm/ogv/m4v, the commands that im using are:

$ ffmpeg -i foo.avi foo.webm
$ ffmpeg -i foo.avi foo.ogv
$ ffmpeg -i foo.avi foo.m4v

This videos are working in all browsers(IE/,IE8,IE9, Safari, Crome, Opera..), just on android doesnt work.

There are some paramater there i must add to the command to make it compatible with mobile phones(Android/iphone/ipad)? Im sure that the problem is the convertion, because i downloaded the videos from the kaltura example and uploaded them to my server, and tested with my phone and worked just fine. But when im using the files converted on my server, doesnt work on android(Didnt test on ipad and iphone).

Any ideas?

Thanks
Bruno

Joined: 05/13/2009
Points: 164

You need to use baseline profile mpeg4 for Android and iOS (and there are going to be devices where this doesn't work, but baseline mp4 is the most supported).

here's an good command to start with, that may get you up and running on Android (but you may need to add something make sure the video is scaled no wider than 640px)

ffmpeg -i input.avi -threads 0 -vcodec libx264 -acodec libfaac -vpre hq -vpre baseline -ab 128k -b 600k output.mp4

* I didn't have a lot of time to research this, a google for "ffmpeg basline x264 iPhone" will help you out.

source for this simple example: http://wiki.maemo.org/Manual_video_encoding#ffmpeg

the kitchen sink: http://www.klopfenstein.net/lorenz.aspx/using-ffmpeg-to-encode-videos-fo...

eu
eu's picture
User offline. Last seen 44 weeks 2 days ago.
Joined: 07/11/2011
Points: 7

Thanks for the fast reply.

Already tried that lots of commands and simply doesnt work on Android. Its working on Iphone, just not on android.

Here some of the commands that i used:

 
ffmpeg -i twister_2010_12_29.flv -threads 0 -vcodec libx264 -acodec libfaac -vpre ipod320 -vpre baseline -ab 128k -b 600k output.mp4

ffmpeg -i twister_2010_12_29.flv -s 320x240 -r 30000/1001 -b 200k -bt 240k -vcodec libx264 -vpre ipod320 -acodec libfaac -ac 2 -ar 48000 -ab 192k output.mp4

ffmpeg -i twister_2010_12_29.flv -s 320x240 -r 30000/1001 -b 200k -bt 240k -vcodec libx264 -vpre ipod320 -vpre baseline -acodec libfaac -ac 2 -ar 48000 -ab 192k output.mp4

ffmpeg -i twister_2010_12_29.flv -vcodec libx264 -s 480x320 output1-temp.mp4 && qt-faststart output1-temp.mp4 output1.mp4 && rm output1-temp.mp4 && ffmpeg -i twister_2010_12_29.flv -acodec libvorbis -ac 2 -ab 96k -ar 44100 -b 345k -s 640x360 output1.ogv && ffmpeg -i twister_2010_12_29.flv -acodec libvorbis -ac 2 -ab 96k -ar 44100 -b 345k -s 640x360 output1.webm

I also checked the presets folder and this are the presets available(HQ not available):

-rw-r--r-- 1 root root 200 Jul 13 11:09 libvpx-1080p50_60.ffpreset
-rw-r--r-- 1 root root 200 Jul 13 11:09 libvpx-1080p.ffpreset
-rw-r--r-- 1 root root 192 Jul 13 11:09 libvpx-360p.ffpreset
-rw-r--r-- 1 root root 200 Jul 13 11:09 libvpx-720p50_60.ffpreset
-rw-r--r-- 1 root root 200 Jul 13 11:09 libvpx-720p.ffpreset
-rw-r--r-- 1 root root 43 Jul 13 11:09 libx264-baseline.ffpreset
-rw-r--r-- 1 root root 83 Jul 13 11:09 libx264-ipod320.ffpreset
-rw-r--r-- 1 root root 93 Jul 13 11:09 libx264-ipod640.ffpreset
-rw-r--r-- 1 root root 270 Jul 13 11:09 libx264-lossless_fast.ffpreset
-rw-r--r-- 1 root root 296 Jul 13 11:09 libx264-lossless_max.ffpreset
-rw-r--r-- 1 root root 270 Jul 13 11:09 libx264-lossless_medium.ffpreset
-rw-r--r-- 1 root root 295 Jul 13 11:09 libx264-lossless_slower.ffpreset
-rw-r--r-- 1 root root 284 Jul 13 11:09 libx264-lossless_slow.ffpreset
-rw-r--r-- 1 root root 261 Jul 13 11:09 libx264-lossless_ultrafast.ffpreset

Have no idea what is the problem. Any help?

Thanks
Bruno