Android HLS support using Media Codec, Media Extractor API - android

Hi I am writing a media player with the help of Media Codec and Media Extractor API. It is working fine, when I tested with some HTTP links. Then I tested it with HTTP live stream URL, it is not working.
ex: "http://mediamotiononline.ios.internapcdn.net/mediamotiononline/inapcms/CMS16042/flash/16042_adaptive2.mp4.m3u8"
I have tried to parse m3u8 file, but it is giving info of Bandwidth, resolution only. With VideoView widget these Http live stream URLs works fine. But I am using Surface to show decoded data. Anyone has any idea how to solve this problem?

this might be help you.
Download m3u8 parser from http://sourceforge.net/projects/m3u8parser/
Add it to your project either jar file or source files.
By using this parser you can get PlaylistInfo, elements.
Explore for playable .ts files in elements. Pass those ts files to your MediaExtractor. It worked for me. Hope it will work for you
too..

Related

Problems playing videos in Leanback example

I am trying to play my own videos in Android Leanback example (https://github.com/googlesamples/androidtv-Leanback) putting in PlaybackFragment.java line 178, in prepareMediaForPlaying(Uri.parse(...)) my own mp4 url and it doesn't work. I have an Source error and the log said that it couldn't access to this url. I know that the url that I am trying works properly, because I put it in a browser and it plays.
Could you help me please?
Try to understand which type of video are you going to play! HLS, DASH, MPEG or of which format!
after you got a basic understanding on them, look for exoplayer supporting video formats, then implement your desired one

streaming a mp4 file using RTSP?

I am developing an app. that will stream the video recorded from camera and stored as mp4 in sdcard...
I know there something called as RTSP which is used for that...
Please tell me where to start . .and is there any library that will do this for me...
I do not understand why you want to stream a local mp4 file, but maybe I misunderstood you problem. RTSP is used for live streaming, but you want to play a local mp4 file.
If you want to capture video and save it as mp4 onto a SD card, you need to use the Android MediaRecorder. Here a link to a simple example.
If you just want to playback a local mp4 file. Have a look at the Android API Demos.
These are part of the Android SDK installation and contain a good example of how to playback local media files.

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.

How to play video from ftp streaming file?

If found many tips about how to stream from classic url link, but nothing about ftp.
Is it the same way to proced ?
Thanks you.
AL.
Android's media framework only supports HTTP and RTSP for streaming. You will need to download your file and play it back, or use some alternative URL that offers HTTP or RTSP for the media file.
If you are looking for an app in android, there is a player for android which will allow streaming from a ftp server. it's called FIPE Video Player. It's free, neat and stream in high quality.
Update: another brilliant app (again if you are looking for an app) I recommend is ES File Explore, which also allows streaming from ftp server instead of downloading locally and then playing.
Just use VLC for Android and add your FTP as a source.
See : https://play.google.com/store/apps/details?id=org.videolan.vlc&hl=fr&gl=US

Categories

Resources