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.
Related
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.
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
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.
Does anybody have any luck streaming a high quality video (over 1000kbps) to Android through RTSP?
We currently have low quality video streams (around 200kbps) that work wonderfully over 3G. Now we are trying to serve a high-quality stream for when the user has a faster connection. The high quality videos play smoothly in VLC, but the Android playback seems to drop frames and get blocky, even on a 4 megabit connection.
It seems like the YouTube app uses a plain HTTP download for their high quality videos. This works well and plays smoothly, but will not work for streaming live videos. Has anybody had luck streaming high quality videos to Android through RTSP?
The videos are encoded using H.264, 1500kbps, 24fps, and a 720x480 resolution. In the app, we are using a VideoView to play the videos. We are using Darwin Streaming Server, but we are open to other options if necessary.
Update 6/23/2011
Looking through Darwin some more today. So far, I am just logging the request and session information in a Darwin module.
The original Droid tries to use these settings: 3GPP-Adaptation:...size=131072;target-time=4000. Although that means it wants 4 seconds of buffer, 131Kb only holds about a second of playback at 1200kbps. I understand that 1200kbps is large, but it is necessary for a high quality video (minimal compression on 720x480).
I am trying to force the client to buffer more, but I haven't figured out how to do that yet. I'm just looking through the Darwin Streaming Server source and trying to figure out how they do things. Any Darwin experts out there?
Update 6/24/2011
As it turns out, using plain old HTTP for viewing videos on demand works well with no loss of quality. When we get to live streaming, we will have to look more into RTSP.
Well even if the network is able to transmit at that rate, you still need to decode it. What are you using for decoding? You will probably need to use a NEON accelerated video decoder so you can have a proper framerate, and a decent size buffer... the graphics processor is only as good as the bus that it is in... Also what are your encoding settings and resolution?
Edit: You are encoding those at much to high bitrate, half of that will do fine. Also you need to make sure where the issue lies. Is the mediaPlayer getting the data and failing to stream at a decent framerate, in that case you have to replace the MediaPlayer code with your own player. Is it's network issue then only solution is to lower the bitrate, 600Kbps would be just fine (or 500Kbps video, 128Kbps audio), it's 3x your 200k stream and on a screen this small, the difference is not noticeable.
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.