Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play .ts video file on Android?

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. :)

like image 692
user359519 Avatar asked Oct 12 '22 15:10

user359519


2 Answers

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.

like image 50
Samuh Avatar answered Oct 17 '22 01:10

Samuh


Android stagefright in Gingerbread and prior versions does not support playback of .ts (transport stream) or elementary stream. As you have rightly pointed out, it only supports MP4/3GP/MP3 file formats.

like image 36
Oak Bytes Avatar answered Oct 17 '22 01:10

Oak Bytes