MPEG-TS, Android and (possibly??) FFMPEG or other LGPL C/C++ library

823 views
Skip to first unread message

petr.m...@mautilus.com

unread,
Feb 14, 2012, 11:46:25 PM2/14/12
to android-ndk
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:

* MPEG-TS de-multiplexer
* AAC decoder
* H.264 decoder
* Synchronize the audio and video playback

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?

I am posting it to the NDK forum, since it might involve the porting
of come C/C++ code.

Many thanks for help!

Regards, STeN

Y J

unread,
Feb 15, 2012, 5:48:01 AM2/15/12
to andro...@googlegroups.com
> 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:
>
> * MPEG-TS de-multiplexer
> * AAC decoder
> * H.264 decoder
> * Synchronize the audio and video playback
>
> 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?
>

Demuxing is prior a question of table. I would recommend to use libdvbpsi as
it is LGPL and it does the jobs well (and it's light).

I'm not sure this is the right place if your though is to integrate it
directly in the player, android-contrib might be more appropriate.

Yann

Glenn Kasten

unread,
Feb 16, 2012, 10:27:08 AM2/16/12
to android-ndk
Petr, I'm sure you already know this as you mentioned "Android 2.x",
but for the benefit of others here ... later versions of Android do
support MPEG-2 TS to varying degrees. I believe it was 3.1 that added
support for playing .ts with android.media. MediaPlayer API and data
coming from URLs, local files, and file descriptors. 4.0 added ability
to play via Android native media based on OpenMAX AL API and .ts data
coming from an Android buffer queue.

Given that there is already support for .ts in current Android, I'm
not sure that android-contrib is the best place to propose adding .ts
to 2.x ... in general Android upstream doesn't accept backporting
features into earlier versions of the platform. However, if you have
bug fixes (for any version) or enhancements for 4.x and beyond, those
are likelier to be considered.
>  smime.p7s
> 8KViewDownload
Reply all
Reply to author
Forward
0 new messages