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
errors.
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:
http://developer.android.com/guide/appendix/media-formats.html
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
clearly.
http://www.adobe.com/devnet/video/articles/mp4_movie_atom.html
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.