STeN
STeN

Reputation: 6268

MPEG-TS, Android and FFMPEG

I am receiving the MPEG-TS (MPEG transport stream) packets with the multiplexed H.264 video and AAC audio streams. I need to be able to show the audio and video on the Android phone. My assumption is that I need:

Assuming that I am right then (in Android 2.x) MPEG-TS de-multiplexer is not part of the OS and must be ported, both AAC and H.264 decoder are part of the Android OS, but I am not sure if they have interface, which allows passing the data in buffers and if they allow mutual timing synchronization. In the worst case those components must be ported here as well.

Can you give me some advices where to start? I was thinking about the FFMPEG porting. Are there any other ways?

Regards, STeN

Upvotes: 3

Views: 8379

Answers (4)

Jaromil
Jaromil

Reputation: 76

(DISCLAIMER: I'm personally involved in developing the free and open source program linked below)

A static version of FFMpeg (both library and commandline) is provided by ZShaolin http://dyne.org/software/zshaolin also contains other media conversion tools.

Its use can facilitate scripting experiments without having to compile FFMpeg from scratch.

Upvotes: 0

Dmitry
Dmitry

Reputation: 2887

Android 4.x has OpenMAX which can play TS with H264 and AAC. You don't even need to worry about synchronisation of audio and video.

Look at the nativemedia sample in the NDK.

If you want to support previous versions of Android, then ffmpeg might be a good choice, but it the maximum it can give you is just decoded video frames in RGB or any other format and decoded audio in PCM. Then you will have to implement renderer and audio playback yourself. I would recommend reading this tutorial - http://dranger.com/ffmpeg/. It is not android specific but it will give you idea how video play works.

Upvotes: 2

Mukesh
Mukesh

Reputation: 242

In Gingerbread ( 2.3 ), actually there is a MPEG TS parser in the stagefright framework that you could use. Also, I believe it is well integrated with H264 and AAC decoders. MPEG TS parser is not advertised anywhere but the support is silently sitting there. I believe they have brought it to support Apple HTTP Live streaming in HC or later version but the code is sitting there in the Gingerbread ( 2.3 ) codebase as well. With a minor modification in the framework, you can playback http live streaming ( which actually sends TS packets). I guess the above information would be helpful for you.

Vibgyor

Upvotes: 1

ciphor
ciphor

Reputation: 8288

You may refer to the android-ffmpeg project on github.

https://github.com/guardianproject/android-ffmpeg

Upvotes: 1

Related Questions