Is it possible to view .mpeg stream of H.264 video in Android devices?
This is a highly theoretical question with some setup:
I've got a video encoder that wraps H.264 HD video into an .MPG transport stream for transmission. I can strip the TS packaging off -- 开发者_高级运维maybe in the encoder if Android won't give me the speed I need-- but then I'm left with an H.264 elementary stream. Would I have to repackage this into one of the supported stream formats in order for Android devices to view the stream, or can they handle an .MPG stream?
H.264 is encoding supported by android >=3.0 only, decoding is supported by most (all?) versions, with a 3gpp or MPEG-4 container. Gingerbread adds MPEG-TS.
Format / Codec H.264 AVC
Encoder (Android 3.0+)
Decoder Yes
Details Baseline Profile (BP)
Supported File Type(s) / Container Formats: 3GPP (.3gp) and MPEG-4 (.mp4). MPEG-TS (.ts, AAC audio only, not seekable, Android 3.0+)
For video content that is streamed over HTTP or RTSP, there are additional requirements:
For 3GPP and MPEG-4 containers, the moov atom must precede any mdat atoms.
For 3GPP, MPEG-4, and WebM containers, audio and video samples corresponding to the same time offset may be no more than 500 KB apart. To minimize this audio/video drift, consider interleaving audio and video in smaller chunk sizes.
The full list of media formats supported is here: http://developer.android.com/guide/appendix/media-formats.html
精彩评论