Rendering videos for the media player

Skip to first unread message

mark w

Apr 7, 2011, 8:51:29 PM4/7/11
to Android Media Developers
If you are working with Media Player to play videos, one of the first
challenges is to create videos files that are compliant.

Video that are not compliant will result in "Error, media cannot be
played." This message seems to be a very generic result that can be
displayed for everything from file not found, to .mp4 structure

For the Media Player, android specifies that supported video formats
are H.263/(mp4 and 3gp) and H.264(mp4 and 3gp). See the Android
documentation for the supported media formats:

On my Streaming video platform, BeijingGig, I have rendered out all
the videos in .flv format for website/browser visitors. If you play
these video on your android browser 2.2+, they will play in the
browser as flash is supported. To support playback for the media
player with the Android app, I had to re-render all of the videos out
in H.263/.mp4.

In Adobe Premier, I use the following settings to render out my .mp4
videos for the Android Media Player:

Export -> Media
Format = H.264
Video = NTSC
Size = 380 x 240
Fps = 15
Square Pixels
Profile = baseline
Level = 1.3
Bitrate Setting = VBR / 1 pass
Audio = AAC / Stereo / 22.05 Hz, / High

I use target bitrate of about 500kbps for the video on my site, it is
always a tradeoff between quality and size.

With .mp4 stream packaging over HTTP, every file contains a MOOV atom
that contains info about timescale and duration. For the video to
stream in android, you need to make sure that the MOOV atom is at the
top of the file.

The MOOV atom must be found before the TRACK and DATA atoms. This
allows the .mp4 to stream.

You can download the open source ATOMIC PARSLEY utility program to see
the structure of your .mp4 files.

The following article from Adobe describes this requirement very

The placement of the MOOV atom is described in various rendering
programs differently. It is often described as "fast start" or "use
streaming mode".

Hope this can help you to create .mp4 files that can stream
successfully in Android.

Shawn Van Every

Apr 8, 2011, 11:15:51 AM4/8/11
to, mark w
Thanks for sharing this Mark!  It's a great rundown. Encoding for Android can be frustrating to get right.
Reply all
Reply to author
0 new messages