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.
Related
=== 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.
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
I know we can play mp3 file in MediaPlayer.
But can we play mp3+g on android??
I saw in the documentation on android, but i didn't see it.
http://developer.android.com/guide/appendix/media-formats.html
Is there any work around or library to do this?
Thanks
I don't "think" that Android is going to support mp3+g playback anytime soon. That being said an mp3+g "file" should either be one zipped file(with two files inside) or two separate files named the same with exception of the file extension. So other then playing the MP3 there is really nothing else that MediaPLayer can do, and changing MediaPlayer int the android framework to get this to work would not be portable from device to device.
Workaround 1
Use FFMPEG to transcode and mux these files to a different format that is supported such as mp4. Here is an example of someone using ffmpeg to mux mp3+g into FLV.
Workaround 2
Another option would be to use Android For VLC which is in pre-alpha found here. Now I'm not sure that VLC for android will support mp3+g, but libvlc does support decoding of the two files so I'm guessing it would work, or you could alter the code a bit to get it to work. I have checked out the VLC for Android code recently and I have to say its a cpu hog but since mp3 and cdg are generally smaller less cpu intensive files I think that android devices could handle the work load using VLC.
Workaround 3
Now as far as more complex options you could utilize the Android NDK and create a decoder yourself (This would take you a lot of time).
Hope some of this helps you.
I have found the solution..
http://code.google.com/p/cdg-toolkit/
It was written in java so we should porting it first to Android if you want to use it.
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
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++.