Liss is More feed 08月16日
Turning a Decommissioned iPhone into a UniFi Protect Camera
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文分享了如何将闲置的旧iPhone通过RTSP协议接入Ubiquiti UniFi Protect生态系统,实现第三方摄像头的监控功能。作者首先尝试寻找原生支持ONVIF的App但未果,随后发现ONVIF主要为握手协议,实际视频流传输依赖RTSP。通过IP Camera Lite App将iPhone摄像头设置为RTSP流,并利用ffmpeg验证了视频流的可用性。接着,作者使用Docker部署了一个ONVIF包装器/代理,并详细说明了配置过程,包括网络接口、IP地址、流路径以及分辨率的设置。最终,成功将旧iPhone摄像头添加到UniFi Protect中,取代了原有的Surveillance Station和Scrypted方案,为用户提供了一种经济高效的监控解决方案。

📱 **旧iPhone接入UniFi Protect的可行性与技术路径**:文章的核心在于探讨如何将旧iPhone作为第三方摄像头接入Ubiquiti UniFi Protect系统。作者通过实践发现,虽然UniFi Protect原生支持ONVIF协议的第三方摄像头,但可以直接利用iPhone的RTSP流,并通过一个ONVIF包装器/代理来实现兼容。这一过程为用户提供了将闲置设备升级为监控摄像头的创新方案。

📹 **RTSP流的实现与验证**:为了实现iPhone视频流的传输,作者选择了IP Camera Lite这款App,尽管其界面不够直观,但提供了免费测试版本,并最终能够稳定输出RTSP流。通过ffmpeg工具中的ffplay命令,作者成功验证了iPhone摄像头生成的RTSP流能够被正常读取和播放,为后续的ONVIF包装奠定了基础。

🐳 **Docker化ONVIF包装器配置详解**:文章详细介绍了使用Docker部署ONVIF包装器(如GitHub上的相关项目)的关键配置步骤。作者强调了修改`config.yaml`文件的重要性,包括指定正确的网络接口(如`eth4`)、设置iPhone RTSP流的IP地址和路径,以及精确匹配视频的宽度和高度。这些细节对于确保包装器能够成功连接并传递视频流至关重要。

🛡️ **UniFi Protect中的第三方摄像头添加与故障排除**:在完成ONVIF包装器的配置后,作者指导了如何在UniFi Protect中启用第三方摄像头发现功能,并进行“Adopt”操作。文中提到了初始设置可能遇到的“无限加载”问题,并指出这是由于配置不当,特别是视频流未能正确加载。通过反复调试和参考GitHub文档,最终成功解决了问题,将旧iPhone摄像头集成到UniFi Protect中。

💡 **替代方案与系统整合**:通过此次实践,作者成功将旧iPhone摄像头接入UniFi Protect,从而能够淘汰之前使用的Surveillance Station和Scrypted。这不仅简化了监控系统的管理,也进一步巩固了UniFi生态的统一性,展示了DIY解决方案在智能家居和安防领域的潜力。

I’ve recently become a Ubiquiti UniFi disciple, including replacing our builder-basicdoorbell from 1998 with Ubituiti G4 Doorbell Pro. This has brought me into theUniFi Protect ecosystem.

Protect is absolutely designed to work with UniFi cameras — as one wouldexpect — but they do have some basic support for third-partycameras that support ONVIF.

It occurred to me that I have a small collection of minicomputers in the housethat I’m not using anymore. Further, those minicomputers all have cameras built-in.So that got me thinking, can I use one of these old iPhones as a third-partycamera in Protect?


My first step was to see if I could find an app on the App Store that nativelysupports streaming via ONVIF. If one exists, I couldn’t find it.

However, while researching how to handle this, it became apparent that, tomy limited understanding, ONVIF is more of a handshaking protocol. When itcomes to video streaming, the assumption is that RTSP will handlethe actual streaming.

Which got me wondering if I could do some combination of

RTSP app → some sort of ONVIF wrapper/proxy → Protect

In principle, that should work.


I started by casting about to find an app that would stream RTSP from thephone. I found a couple, but the one that seemed to work best for me isIP Camera Lite. It’s not intuitive, but it has a free tier for meto test with, and once I got my head around how the app works, it wasreasonably simple.

However, I needed to prove to myself that it was working. So, I turnedto my dear old friend ffmpeg, ffplay. Once I hadthe app running and configured, I tried to play the stream:

ffplay rtsp://admin:admin@192.168.17.189:8554/live

Sure enough, I had a stream of the phone’s camera (and microphone).


Sometime recently I had stumbled upon a Reddit post that explored aperson going down a vaguely similar path. They made mention of tryingto get a Docker container working to do the ONVIF side of things,but couldn’t make heads nor tails of it.

I figured it couldn’t hurt to see if I could get it to work, as I’vebeen using Docker for a few years now.

At first, I was running things attached/live in the console, to seelogs and error messages as they came in. After beating my head againstthe wall for a while, I got the container to the point that it wasn’terroring on startup.

I had to make a few changes to the config.yaml:

    I switched to eth4, which happens to be the 10GbE daughter card thatI installed in my Synology. You can determine this using ifconfig.I set the correct IP address and path for the iPhone’s streamI absolutely had to set the correct width/height, otherwise it wouldn’twork. To do so, I just took a look at the ffplay console output fromearlier and cribbed the values from there.

After getting things to the point that they seemed okay, I loaded UniFi Protecton my computer, and navigated to SettingsSystemAdvanced, where Ihad to tick on Discover 3rd-Party Cameras.

Then, in the UniFi Devices section (found in the left sidebar), I would seethe new device. I clicked on Click to Adopt, and was challenged for ausername and password. I used admin for both, which appears to be the defaultfor the IP Camera app.

At first, I was presented with an endless spinner, as I hadn’t configured thingsproperly. The documentation on Github is enough, but frustratingly, the failuremode I ran into was the video just… not loading. However, I eventually gotit nailed down, and now I have a new camera in Protect.

Thanks to this, I can now retire both Surveillance Station and Scrypted,which I was using previously before I moved to Protect.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

UniFi Protect iPhone RTSP ONVIF Docker
相关文章