用户名和密码在Android中的RTSP流 [英] RTSP stream in android with username and password

查看:678
本文介绍了用户名和密码在Android中的RTSP流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的任务是在android中创建一个Android应用程序来检查城市的一些IP摄像头。使用现有的 RTSP 网址 rtsp:// admin:pms7112@xxx.xx.xx.xxx:554 / cam / realmonitor?channel = 1& subtype = 0 我可以在VLC播放器中获得流,但在android中没有运气。我尝试过videoview原生播放器和媒体播放器

几乎每个解决方案都给了我


My task is to create an android application in android to check some IP cameras of the city. Using the existing RTSP url which is rtsp://admin:pms7112@xxx.xx.xx.xxx:554/cam/realmonitor?channel=1&subtype=0 I can get the stream in VLC player but no luck in android. I have tried videoview native player and media player.
Almost every solution gave me


MediaPlayer:setDataSource IOException events:
java.io.FileNotFoundException :没有内容提供商:rtsp:// ...

MediaPlayer: setDataSource IOException happend : java.io.FileNotFoundException: No content provider: rtsp://...

如果因为用户名和密码在<$ c中而发生此问题$ C>字符串?你如何添加用户名和密码作为查询字符串

Should this problem happen because the username and password is in the string? how could you add the username and password as query string?

编辑

媒体播放器版本

MediaPlayer mediaPlayer = new MediaPlayer();

EDIT
Mediaplayer version
MediaPlayer mediaPlayer = new MediaPlayer();

    try
    {
        mediaPlayer.setDataSource("rtsp://admin:pms7112@iphere:554/cam/realmonitor?channel=1&subtype=0");
        mediaPlayer.prepare();
        mediaPlayer.start();
    }
    catch (IOException ex)
    {
        ex.printStackTrace();
    } 


更新:

所以......似乎这是我可以使用网址的唯一方法......我无法通过其他方式验证用户身份。拥有相机并为城市设置的公司不允许我们使用其他格式。他们说,vlc浏览器插件播放得很好,他们不会改变任何东西......所以有没有任何库通过身份验证实现rtsp流。我听说客户端和服务器之间的握手


Update:
So...it seems that this is the only way I could use the url...I cannot authenticate the user other way. The conpany which owns the camera and setted up for the city do not let us to use other formats. They said, vlc browser addon plays just fine and they will not change anything... So is there any library that implements the rtsp stream with authentication. I heard about a handshake that is made between the client and the server

推荐答案

我刚发现这个项目o github使用vlc库打开rtsp streams.This解决了我的问题解决了我的问题

I just have found this project o github that uses vlc library to open rtsp streams.This solved my problem solved my problem

这篇关于用户名和密码在Android中的RTSP流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆