简体   繁体   English

如何在Android中使用RTSP链接直播视频?

[英]How to live stream a video using RTSP link in android?

I try to develop an application for live video streaming, and it's work for certain links. 我尝试开发一个用于实时视频流的应用程序,并且它适用于某些链接。 But some other links are doesn't work. 但是其他一些链接不起作用。

Here is my code 这是我的代码

Uri stream = Uri.parse("rtsp://208.77.20.52:1935/dmm1/ten");
Intent videointent = new Intent(Intent.ACTION_VIEW,stream); 
startActivity(videointent);

It shows can't play this video. 显示无法播放此视频。 But when I use "rtsp://cdn.m.yupptv.tv/liveorigin/we2" Url it's works fine. 但是,当我使用"rtsp://cdn.m.yupptv.tv/liveorigin/we2"网址时,它工作正常。 Actually what is the problem?? 其实是什么问题? the Link or my code?? 链接还是我的代码??

I also use Video view with and without mediacontroller to do this but the result is same, and I try to Play this video in VLC player in my PC, then also the first link doesn't work, and the other works. 我也使用带有和不带有mediacontroller的“视频”视图来执行此操作,但是结果是相同的,并且我尝试在PC上的VLC播放器中播放此视频,然后第一个链接不起作用,其他链接也起作用。

If this link ("rtsp://208.77.20.52:1935/dmm1/ten") is expired, then anybody know how to get the working rtsp link for Ten cricket channel..?? 如果此链接(“ rtsp://208.77.20.52:1935 / dmm1 / ten”)已过期,那么任何人都知道如何获取十个板球频道的有效rtsp链接。 I get this links from http://rtsp-links-free-forum-mobile-tv-and-pc-tv-streaming-vlc.39851.x6.nabble.com/RTSP-Links-Indian-Channel-List-for-Mobile-TV-and-PC-TV-Streaming-VLC-td8.html 我从http://rtsp-links-free-forum-mobile-tv-and-pc-tv-streaming-vlc.39851.x6.nabble.com/RTSP-Links-Indian-Channel-List-for获得此链接-Mobile-电视和PC-TV-流-VLC-td8.html

Please give me a solution. 请给我一个解决方案。 Is there is any other protocol to do this?? 还有其他协议可以做到这一点吗?

Thanks in advance and sorry for my poor English. 在此先感谢您,我的英语不好。

I think that URL is expired. 我认为该网址已过期。 and there is no problems in your program... please change that url. 并且您的程序没有问题...请更改该网址。 Try this URL for live cricket 尝试使用此网址进行实时板球比赛

rtsp://85.25.199.31:1935/rtp-live/willow.stream

Please note that this url will also change at any time... So keep updating 请注意,此网址也会随时更改...因此请继续更新

try this, 尝试这个,

video1=(VideoView)findViewById(R.id.videoview);
video1.setVideoURI(Uri.parse("rtsp://208.77.20.52:1935/dmm1/ten"));
video1.requestFocus();
video1.start();

If it is showing same error message, post error log, so I can help you more... 如果显示相同的错误消息,请发布错误日志,以便我为您提供更多...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM