I'm making an android app that can play audio streams from URLs.
Activity contains a simple Play/Pause button and a Seekbar.
I've managed to play the stream by running the media player as a service but now I want to achieve buffering.
Buffering in the sense that, when the mediaplayer starts, I want the stream to be saved in a buffer or a temporary location.
Also I want to show this buffered amount in the seekbar (probably as a secondary progress) & when the user drags the seekbar to any buffered point, the player should play that stream without any disruption.
So, I'm seeking a decent tutorials for this. I tried searching but not able to find a simpler solution for Version >= 2.3.
(But, if it works for 2.2 also, that be great too)
Thank You
I used the internet radio streaming posted in an answer here: Online radio streaming app for Android
And then I used some of this guy's work for implementing a visualizer: https://github.com/felixpalmer/android-visualizer
I'm having a trouble on the Samsung S3 though. Have you had any issues with streaming internet radio? It works fine on Samsung Music, Note, Note II, S II, S III mini, (even) S4 and Google Nexus phones, but supposedly because of some firmware buffer setting on the S3, it's just not streaming music on an S3.
I've gotten results like streaming after 2-5 minutes, but who wants to wait 5 minutes for a radio stream to start - no one!
I've discovered that it sometimes depends on the bitrate of the stream. For example, a 96 kb/s bitrate stream started playing instantly on the S3, while a 128 kb/s bitrate stream took 2+ minutes. Which actually just does not make sense, since one would think that the higher bitrate stream would fill the buffer quicker than the lower bitrate stream.
Do you have any advice or suggestions for me? I have questions here and here.
Related
I'm developing an android app to send the live Video & Audio stream to other PC, the app can capture the camera and mic and send the live stream and use VLC player to play it, it works very well in my htc s710e(android version 4.0.4), but in other mobile it's very choppy. I tested many mobiles, some mobile's hardware is higher than s710e, and some is lower than it, but all of them are very choppy.
I debugged it for too many time and found I cannot modify the frame rate of video, although I set the frame rate is 10 or 15, but the live video in vlc shows the frame rate is 30(H.263).
So how can I modify the frame rate? hope someone can helps me, thank you.
I'm trying to create an app to stream live TV. Currently the problem I'm facing is that after say 10 minutes of playing, the video will freeze but the audio will carry on. This is on a 1.3mbps stream. I also have lower streams, such as a 384kbps stream, that might last an hour or so, but will still do the same. I've tested this with a local video, that is high quality (file size is 2.3gb) and that has no lag and doesn't freeze at all, so it must be something to do with the way HLS is streamed to android.
Does anyone have any idea on how to solve this problem?
Thanks
We are writing an Android App on the Samsung Galaxy Tab. We have an Endoscope (Medical Surgery Camera) as DV-input and we want to live-stream the DV Video to the Tablet.
As a streaming server, we have the VLC player and a RTSP stream. The encoding works fine, and streaming over the network(rtsp) to another computer is good (< 1s). However, if we open the RTSP stream on the Galaxy Tab, there is a lag of 6-7s.
I have tried to set down the bitrate encoding (even the lowest doesn't work, the streaming lag results the same). So I think there must be some kind of network caching or video caching on the Android itself.
I googled and didn't find a way to disable or even modify caching on the videoview / mediacontroller.
Does anyone have an idea how to tweak the Android Streaming View?
Edit:
I figured out that it must be the internal buffer size that limits the video stream velocity. The LogCat tells me that AweSomePlayer is the Videoplayer in charge. So next question: How to change the awesomeplayer buffering size? I think it's written in cpp. How can I access this precompiled code via eclipse/java/android?
Ok. So there are a bagillion different Android devices. I have a video streaming service, works wonderfully for iOS. My app has a live video feature and a saved video clip playback feature (which streams to the device too). I've run some tests on different Android devices and get a whole bunch of different playback results. I am using a 640x480 h.264 base profile video. Streaming that video works only on some devices. For other devices, that same video stream can be made to stream at low resolution and that works on some devices, but still not others. The high profile streaming goes through http://www.wowzamedia.com/ (rtsp) and doesn't work on any Android device (but works on iPhone). The lowest and worst option is Motion JPEG, which works on all tested devices so far.
So my question is, how can I figure out (without having to test every device out on the market) if the device will play: 640x480 h.264 base profile - if that wont work then play the low resolution video - if that doesn't work, default to Motion JPEG.
Also, any idea why my rtsp transcoded through wowza works on the iPhone but not on any Android device (not even the Motorola Atrix)?
Streaming on android is an absolute mess. Most devices don't support anything higher than Baseline 3.0. If you encode for iPhone 3, it should generally work via RTSP. Newer versions of android support HLS, but it's hit or miss and largely dependent on specific devices.
I resolved this problem. Check RTP-realization in your streaming service and x264 profile. My RTSP-server works fine on 90% devices.
p.s
Some video frameworks in different Android versions can implement RTP and RTSP protocols with some differences.
These are some of the links/issues which I have come across, while trying to make streaming work in varied devices.
MediaPlayer seekTo doesn't work for streams
MediaPlayer resets position to 0 when started after seek to a different position
MediaPlayer seekTo inconsistently plays songs from beginning
Basic streaming audio works in 2.1 but not in 2.2
MediaPlayer.seekTo() does not work for unbuffered position
Streaming video when seek back buffering start again in videoView/Mediaplayer
Even the big shots in stackoverflow are wondering about this
If you want just streaming without seeking (which is lame), this can be achieved. But then if you receive a call while you are watching, you will end up from the start.
I'm trying to play an axis video stream over rtsp in a VideoView on my HTC Desire HD. Currently there is a delay of 7 seconds on the video when I play it on the HTC Desire HD.
Is there a way to reduce this delay?
I have tried to play the video stream on my computer with vlc and it works with a delay of 0,5 seconds. When I reduced the framerate, bitrate and resolution the delay still stays at 7 seconds. I have tried functions as prepareasync and seekto but I could not get them to work.
Has anyone got live video working with the VideoView wrapper or the MediaPlayer?
As far as I can tell from looking through the Gingerbread (Android 2.3.3) source code implementing MediaPlayer (which VideoView is based on), there is no way to change the buffer settings. MediaPlayer seems inherently designed for playback, where gaps and errors must be avoided at all costs. For live streaming like video chat, low latency is more important than gaps and errors.
There is currently an effort to port GStreamer to Android, which should provide tools for doing low-latency video streaming.