HLS streaming on Android - android

The HLS is supported on Android since version 3.0. Until the Honeycomb the H.264 and AAC was supported, but there was only RTSP streaming protocol. The HLS and MPEG-2 TS not (see here) were not supported.
Porting the ffmpeg to the Android platform could be a solution for that (LGPL sources ara available). I am however looking for a ready made solution with SDK, customizable HLS player, etc. There is one here, but I would like to know if you do not know about other solutions.
Thanks
STEN

You may find the http://vov.io/vitamio/ libraries very useful. They allow you to use HLS feeds (I've tested and use the library in production apps).
One thing to note however, don't try testing on an Emulator device, as it will not work, you will need a real device for your testing.
Hope that helps.
Warm Regards,
Shabbir
-- EDIT --
Just editing this answer to let people know that the Vitamio url has changed - and also now you don't need to download a separate "helper app" from the PlayStore or the vov.io website - you can now just incorporate everything from the downloads/instructions they provide.
The new site is http://vitamio.org/

MPEG TS is there in the codebase since 2.3 ( Gingerbread ) but it is not advertised. Actually HLS is supported in the 2.3 release but you need a small fix to enable it. You need to prefix httplive to the streams and make a small fix in the code to accept it.
Vibgyor

Finally we have made our own player with use of the FFMPEG libraries and now we are integrating there also HW decoding with use of the stagefright (http://freepine.blogspot.cz/2010/01/overview-of-stagefrighter-player.html).
BR
STeN

Related

Android VLC Embed vs Android VideoView

=== BACKGROUND SUMMARY===
At this moment, we are using Android VideoView to perform video play black. Everything seems to be working great until we encounter Live Streaming.
VideoView tends to have 10-15 seconds delay from the live stream within a local network (LAN).
While attempting to solve this issue, we came across VLC Embed for Android. After searching on the Internet, it seems there isn't any article compare pros and cons of using Android VLC Embed vs. Android VideoView.
=== QUESTION ===
What's the advantage (pros) and disadvantage (cons) of using Android
VLC Embed vs. Android VideoView?
Is VLC Embed stable?
Anything I should be careful when switching existing VideoView to VLC?
Thank you all in advanced
My view may not be very professional but it's about what I've experienced so far.
First, Android VideoView is good since it comes with the Android SDK so it does not require external library. But this one has some limits. For example, as far as I know, it doesn't support MMS and MMSH protocols and some others I didn't quote. Which is not the case for Android VLC SDK. This library is complete and supports almost all media formats I know so far.
It just increases your apk on size, on my side that's the only disadvantage.
Is the Android VLC SDK stable? Yes it's stable and maintained by a huge community.
Anything I should be careful when switching existing VideoView to VLC?
You should keep your sources same and care about aspect ratio.
What's the advantage (pros) and disadvantage (cons) of using Android VLC Embed vs. Android VideoView?
Advantage:
More features. VLC supports almost all media formats, hardware decoding. audio tracks, subtitles, chapter are also supported.
More integrated, simpler logic. You can easily get media information and cache them. The playback engine will proactively notify state changes and events, just register player event listening.
Disadvantage:
APK file size increas. If both arm64-v8a and armeabi-v7a are supported, it will increase more than 30MB.
Multiple instances are not perfect. For example, playing 2 videos at the same time is a hassle.
Is VLC Embed stable?
Stable. Starting with VLC 2.0.x (now 3.0.x), I use the VLC library in my Android App. It runs steadily from Android 5.1 to Android 8.0. A small number of 4k h265 video playback is not normal, but can be resolved by displaying "Can not play".
Anything I should be careful when switching existing VideoView to VLC?
To use LibVLC on Android The Medialibrary(org.videolan.medialibrary) is also required. You also need to note the licenses.
VLC for Android is licensed under GPLv3
This may be a concern for you if your project uses a different license.

Library to support H.264 AVC .mp4 on Android 2.2, 2.3?

I am working on a video application and we are generating videos in H.264 AVC Codec. As per Android Media Formats this codec is supported in Android 3.0+ versions.
I wonder if there is any free library that help us to play this format on 2.2 or 2.3. I found a library but it is not free.
I want to support HTTP live streaming for our application and the issue is same.
I have used ServeStream in my project you can find the description from http://sourceforge.net/projects/servestream/files/
And you can also check faplayer-android.
Servestream is another opensource ffmpeg based media player.
It plays mms streams such as mms://streaming.radionz.co.nz/national-mbr.
It has a FFMpegMediaPlayer class that looks just like a regular MediaPlayer.
It plays videos too.
There's definitely no such library. If you're willing to accept software decoding, you can probably build something around ffmpeg/libav and NDK.
Suggest you these porting Libraries 。
ffmpeg ,vlc ,gstreamer
faplayer-android open source url :faplayer-android

Decoding h264 raw stream on Android 2.3.3

I'm trying to decode a raw h264 stream on "older" Android versions.
I've tried MediaPlayer class and does not seem to support the stream format.
I can see the stream on other Cam Viewer apps from the market, so I figure there must be a way to do it, probably using the NDK.
I've read about OpenMAX and Stagefright, but couldn't find a working example about streaming.
Could someone please point me in the right direction?
Also, I'm reading in several places about "frameworks/av/include/media/stagefright/MediaSource.h" and other sources, but they don't seem to be either in the regular SDK or the NDK.
Where is this source located? is there another sdk?
Thanks in advance.
Update: I'm receiving a rtsp connection.
If you wish to perform only a simple experiment to verify certain functionality, you can consider employing the command line stagefright utility. Please do consider this condition where your streaming input may not be supported.
If you wish to build a more comprehensive player pipeline, you can consider the handling for rtsp as in here or http as in here. Please note that NuCachedSource2 implementation is essential for streaming input as this provides a page cache implementation which acts as a jitter for the streaming data.
Please do note one critical point: Command line stagefright utility doesn't render to the screen. Hence, if you wish to render, you will to implement the complete playback pipeline with rendering.
On a related note, if your input is streaming input, the standard player implementation does have support for streaming inputs as can be observed here. Did you face any issues with the same?
As fadden has already pointed out, your work is made far more simpler with the introduction of MediaCodec in Android 4.x.
You should use third-party libs like android-h264-decoder which uses JNI for increasing the performance! Also look at this lib Intel
Update: Media codec wasn't exposed until API 16 (Android 4.1), so that won't work for a 2.3.3 device.
Stagefright and OpenMAX IL were (and still are) internal components of Android. You can find the code (including MediaSource.h) at https://android.googlesource.com/platform/frameworks/av/+/master Note that the media framework has moved to a separate "tree" frameworks/av only recently. Before it was part of 'frameworks/base', e.g. https://android.googlesource.com/platform/frameworks/base/+/gingerbread/media/

Playing HLS without Android OS support for .ts files

I have developed an HLS player for Android 2.3. It works. However, I am finding that certain Android devices lack support for .ts files. On these phones my player does not work. So, my question is this: Is there a way that I can include support for these files within my app (perhaps a codec or a library of some sort)? After exhaustive searching, I'm really not sure where to go.
Thanks.
Try to port FFMPEG to Android with the NDK, I think that's the best solution for your playing issues. I'm now in that way, I could report you my advances .
You can take a look at vitamio. I think that your player will work if vitamio is installed on the the devices that don't already support the ts files.

develop video player on android to support HLS

I am trying to develop own video player that supports HLS(http live streaming) from 2.1.
I have tried vitamio but it requires that we install vitamio plugin which is around 3.2 MB.So trying to develop own video player.
I have been searching android source code to check how m3u8 file format is being supported on 3.0 onwards but have been unsuccessful so far.
It would be helpful if someone points me in the right direction. What classes do I have to check?
VLC Supports HLS but just barely. There is a product called NexPlayer which supported HLS all the way down to 1.6, but its paid only.
It would be helpful if someone points me in the right direction. What
classes do I have to check?
I'm sure you have definitely found the HLS source code by now,
but this is also for others who will attend this page.
HLS source code on Android 4.4.2, written in C++.

Categories

Resources