Streaming .m3u file in Android 3.0 - android

I am looking to develop an application where I have to stream .m3u file, this is for ANDROID 3.0 only.
I want to stream this link
dl.dropbox.com/u/2377944/test/abr_test/index.m3u8
it must work in emulator too
I searched a lot, but nothing seems to be working too good.
Please help.
Thanks in advance.

m3u is a play list format, a text file, and not actually audio/video media itself. That means it references media that you would want to stream. The distinction is important.
The contents of the m3u file is important. (Your link is dead, btw.) Show that to use and we can help more. Each of the media files contained in the m3u must be valid and point to media that is compatible with Android.
What makes the media compatable? Check the Android Supported Media Formats page.

Related

Widevine and MPEG-DASH - offline playback

I have created an Android application which is capable of playing movies, which are protected with DRM (Widevine Modular). Video are in MPEG-DASH standard. In case, that device is online, everything works fine.
Now I need to add feature for playing video in offline mode. The problem is that I do not know how can I download some file(s) for offline playback. Everything what I have is .mpd file, which contains structured data.
How can I get some file(s) for download from this manifest .mpd file? There are no direct links to some video. I see some chunk, which looks like this:
media="chunk_ctvideo_cfm4s_rid$RepresentationID$_cs$Time$_w1003607280_qaWQ9QVBsSUxIMUpaRnVfdfdfkstMDImYXdsgdreaW9pbmRleD0w_mpd.m4s
I do not know if it is useful for me, but there is nothing more "noticeable" in the manifest file.
For an example of code that processes a manifest and downloads the media chunks have a look here: https://github.com/axiomatic-systems/Bento4/blob/master/Source/Python/utils/mp4-dash-clone.py
Of particular interest you may find the ProcessUrlTemplate which shows how to pass the media elements to get a URL for a chunk

Create a demultiplexer for MPEG 2 TS in android

I have a requirement where I need to extract ID3 tags from a MPEG2 TS(HLS STREAM). MPEG2 has a limited support in android in regards to playing the file. But my concern is to extract the ID3 tags(playing the file is not necessary). Hence I am not concerned with the codecs(encoding and decoding).
I have explored the following options:
libstagefright and OpenMax : A playback engine implemented by Google from Android 2.0.
It has a MediaExtractor is responsible for retrieving track data and the corresponding meta data from the underlying file system or http stream. But according to this post Adding video codec to Android I need to build my own firmware or my own media player.I am hoping I don't have to go down that path. More info on stagefright and openMax can be found here:
An overview of Stagefright player
Android’s Stagefright Media Player Architecture
Custom Wrapper Codec Integration into Android
How to integrate a decoder to multimedia framework
Compiling and using FFMPEG: A complete, cross-platform solution to record, convert and stream audio and video. We can demultiplex ts files with this library as mentioned here:
FFmpeg - Extracting video and audio from transport stream file (.ts).
But I am not sure if I will be able to extract the ID3 tags from the HLS Stream. libavformat might be able to do this but I still need to come up with a mechanism for signaling the read metadata to my application.
Compiling vlc for android: I have compiled vlc for android and made some modifications inside the transport module in demux component for extracting the tags, but it is not able to play all the streams that I am supplying to it.
After looking through these options , I am still at a fix in how to achieve this. I don't want to create a media player as I will not be playing the files nor do I want to build my own firmware. Using ffmpeg seems to be the most viable option, but I want to try this without using any third-party or open source library. My questions are:
Is it even possible to create a demultiplexer from scratch that will work on android?
If possible then ,how to go about it ?
Any options that I have missed?
I am new to this. Any help would be greatly appreciated..Thanks
In android, there is a support to extract ID3 tags. Please refer to ID3 module for further details.
Integration of ID3 into MP3 extractor can be found here.
From a quick check, I have found that ID3 is supported from Froyo onwards.

Phonegap Android App - Display Store MP3 Media

I've been following this blog to help me make a simple music player function with an Android app (http://simonmacdonald.blogspot.com/2011/05/using-media-class-in-phonegap.html).
All works well - but I would like some way to extract a list of all music media stored on the phone so the user can click a file and play it. Does anyone know if this is possible via phone gap? I'd need to access track name/artist etc and a link to the track.
Cheers
Paul
Prognosis is not good.... PhoneGap does not have an API for accessing the media library. So, you would have to fall back to the File API to locate music files, and then... you would have to read the binary data in the actual files to extract out the track/artist metadata. Ouch. Seems pretty impractical.
[EDIT]
By the way, PhoneGap is not the only game in town. Appcelerator seems to solve the same problem, and apparently has a richer API, which includes
access to media metadata

Play .ts video file on Android?

I am pretty new at streaming video, so please bear with me. :)
I am trying to port an m3u8 stream over from iPhone to Android. Looking in the m3u8 feed, I found some .ts files. From what I can tell, .ts files are, themselves, wrappers that contain the video stream (Elementary Stream).
Is it possible to play a .ts file in Android? (The docs only list 3gp and mp4 as supported formats.)
Is there a way to extract the Elementary Stream and just process the video feed? If that is in 3gp or mp4, I should be ok.
Will Stagefright handle .ts? Is Stagefright even available? I read that there are/were some problems with it.
(As a further caveat, I am not getting much help from my server guys. They are pushing for a Flash player solution, including a proprietary player. They will not provide me with a 3gp or an mp4 feed, but I'm hoping I can find that in the .ts file.)
I'm open to other suggestions. Thanks for your patience with this newbie. :)
There is a standard for that called HTTP Live Streaming. Android 3.0 supports this protocol to some extent which means you can pass the URL of the m3u8 playlist to the MediaPlayer and the player should be able to stream it over HTTP. Stagefright is bundled with Android 3.0.
You can browse its source code here.
Also, this thread might interest you: it summarizes support for HTTP Live Streaming.
Android stagefright in Gingerbread and prior versions does not support playback of .ts (transport stream) or elementary stream. As you have rightly pointed out, it only supports MP4/3GP/MP3 file formats.
You can play .ts video file in android by using NDK based project. Dolphine player is best open source player for android and also supports various formats of video.
You got the .ts link from m3u file. Now you can fetch binary data from .ts file and store this binary data in file, then play this file by using video player.

Asx stream on Android

I have a requirement of playing a Asx stream through an Android application
I have read the Android documentation, and they don't seem to support Windows Media streams
Is there any workaround possible? Has anyone did that before? If yes, is there some source code available? Or a library that implements this
Thanks
Are you worried about asx file only or any possible outcome after this?
The asx file can be readable as simple string, read the file using byte array and you can get one or many urls that can be
pls file
m3u file
mp3 url
wma url
We don't have to worry about 1,2 and 3. 1 and 2 can have different parsing logics but at the end they will give 3 [mp3 url] and an mp3 url can be easily handled by MediaPlayer api in android . but 4 is also difficult work to be done.

Categories

Resources