xcode 带有 iOS 8 的 RTSP
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31577527/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
RTSP with iOS 8
提问by Shack
My partner and I are developing an app for a client where they have a camera that connects to the app. Currently it is running in http but we want to use RTSP. We scraped the internet today to look for possible ideas, but they all seem outdated.
我和我的合作伙伴正在为客户开发一个应用程序,他们有一个连接到该应用程序的相机。目前它在 http 中运行,但我们想使用 RTSP。我们今天在互联网上搜索可能的想法,但它们似乎都过时了。
We tried incorporating DFURTSPPlayerbut kept getting compile errors that were related to the actual SDK.
我们尝试合并DFURTSPPlayer,但不断收到与实际 SDK 相关的编译错误。
We want to use something like VideoStreamSDK.
我们想使用类似VideoStreamSDK 的东西。
Does anyone have any ways they can point us towards?
有没有人可以向我们指出任何方法?
Thanks!
谢谢!
采纳答案by Shack
SOLVED
解决了
We found a RTSP playeressentially that we were able to just incorporate it easily into our project.
我们基本上找到了一个RTSP 播放器,我们可以轻松地将它整合到我们的项目中。
[edit: This requires to purchase their license :( , currently it is not working and throws error: Error Domain=com.imoreapps.avplayer.errordomain Code=-149]
[编辑:这需要购买他们的许可证:(,目前它无法正常工作并抛出错误:Error Domain=com.imoreapps.avplayer.errordomain Code=-149]
回答by Rémy Virin
Have you tried with MobileVLCKit
? it's really easy and work well!
I wrote a small example here: https://github.com/rvi/ONVIFCamera
你试过MobileVLCKit
吗?这真的很容易,而且效果很好!我在这里写了一个小例子:https: //github.com/rvi/ONVIFCamera
If you want to try it, just type pod try ONVIFCamera
in your terminal.
如果您想尝试一下,只需pod try ONVIFCamera
在您的终端中输入即可。
Here is how to do it:
这是如何做到的:
var mediaPlayer = VLCMediaPlayer()
// Associate the movieView to the VLC media player
mediaPlayer.drawable = self.movieView
let url = URL(string: "rtsp://IP_ADDRESS:PORT/params")
let media = VLCMedia(url: url)
mediaPlayer.media = media
mediaPlayer.play()
回答by radya
I successfully compiled and used DFURTSPPlayer but it crashed on some iOS devices.
我成功编译并使用了 DFURTSPPlayer,但它在某些 iOS 设备上崩溃了。
Some days ago I have integrated this solution for playing rtsp video stream from IP-cameras: https://github.com/Bilibili/ijkplayer
几天前,我已经集成了这个解决方案来播放来自 IP 摄像机的 rtsp 视频流:https: //github.com/Bilibili/ijkplayer
The only issue I have is not stable connection. Player established connection only after few attempts.
我唯一的问题是连接不稳定。播放器仅在几次尝试后才建立连接。