Play .ts video file on Android?

user359519 picture user359519 · Mar 1, 2011 · Viewed 31.6k times · Source

I am pretty new at streaming video, so please bear with me. :)

I am trying to port an m3u8 stream over from iPhone to Android. Looking in the m3u8 feed, I found some .ts files. From what I can tell, .ts files are, themselves, wrappers that contain the video stream (Elementary Stream).

Is it possible to play a .ts file in Android? (The docs only list 3gp and mp4 as supported formats.)

Is there a way to extract the Elementary Stream and just process the video feed? If that is in 3gp or mp4, I should be ok.

Will Stagefright handle .ts? Is Stagefright even available? I read that there are/were some problems with it.

(As a further caveat, I am not getting much help from my server guys. They are pushing for a Flash player solution, including a proprietary player. They will not provide me with a 3gp or an mp4 feed, but I'm hoping I can find that in the .ts file.)

I'm open to other suggestions. Thanks for your patience with this newbie. :)

Answer

Samuh picture Samuh · Mar 1, 2011

There is a standard for that called HTTP Live Streaming. Android 3.0 supports this protocol to some extent which means you can pass the URL of the m3u8 playlist to the MediaPlayer and the player should be able to stream it over HTTP. Stagefright is bundled with Android 3.0.

You can browse its source code here.

Also, this thread might interest you: it summarizes support for HTTP Live Streaming.