开发者

Problem playing media from RTSP URL in Android

开发者 https://www.devze.com 2023-03-01 17:42 出处:网络
I have made a Android streaming application that plays me开发者_StackOverflowdia from online URL\'s. For playing the media, I am using the

I have made a Android streaming application that plays me开发者_StackOverflowdia from online URL's. For playing the media, I am using the standard MediaPlayer class for playing media.

As per the Android documentation, it supports RTSP protocol for audio & video playback

http://developer.android.com/guide/appendix/media-formats.html

But when I am trying to play media from a RTSP URL, it gets connected but I am not able to hear any media

Following is one of those RTSP URL -

rtsp://sfera.live24.gr/sfera4132

Does anybody media have an idea of playing RTSP URL's through the Android MediaPlayer

Thanks


That link you provided has 3 audio tracks, with the first and last tracks appearing to be silent and don't contain any valid audio. The middle track has audio (as per VLC). I don't know how Android deals with multiple audio tracks. I imagine you may get better results if you use links that only contain 1 audio and 1 video track at most. I expect for an rtsp stream with multiple audio tracks, android is only going to play the first one as there is no user interface to select a specific audio stream, hence why you aren't hearing any audio. If this is a stream from your own server, to hear the audio you should adjust the SDP file the valid audio track first. If this is not from your server, I don't know what you're options are.

0

精彩评论

暂无评论...
验证码 换一张
取 消