How to use Stagefright in Android?

Arun Badole picture Arun Badole · Dec 19, 2012 · Viewed 8.9k times · Source

I want to play .ts video file in my application.I am not getting any way do it. I doubt it whether it is possible to do it or not in Android.

I have heard about Stagefright framework.So please tell me how I can use Stagefright in my application & whether it is able to play a .ts file or not.

Or is there any other way to play .ts file?

Thanks

Answer

user3898258 picture user3898258 · Dec 2, 2014

There are 2 frameworks in Android(Stagefright & Nu-Player)

  • For Local Playback & Progressive Download(You-Tube) - Stagefright
  • For Streaming(rtsp/HLS) - Nu-Player

Coming to TS, if it is hosted in server and if you try to stream(http:///1.ts), then it is treated as Progressive Download(PD) just like You-Tube by your Android phone.

To play a local/PD content, Stagefright loads a Parser component(MPEG2TSExtractor.cpp) to parse the TS contents. In older version, the above mentioned parser module didn't have support for Progressive Download. That's the reason playback was not successful.

In recent versions this support is added.

If you are writing an APP, then you can rely only on existing Stagefright. MXPlayer has it's own Multimedia framework to play the content.