keshavdv / unifi-cam-proxy

Enable non-Ubiquiti cameras to work with Unifi NVR
MIT License
1.6k stars 226 forks source link

Can't get EZViz (Hikvision) cams working with Hik plugin nor RTSP URL #210

Closed bookemdano08 closed 2 years ago

bookemdano08 commented 2 years ago

Trying to run unifi-cam-proxy directly on a UDMP via podman. Already downgraded Protect to version 1.21.2, so should not be affected by the streaming bugs in 1.21.3+.

The cameras are EZVIZ C3N, which are Hikvision under the hood, 1080p and are H265 by default. However, I changed them to H264 using Hikvision's Batch Configuration Tool. The RTSP streaming URL is: rtsp://admin:password@ipaddress/Streaming/Channels/101 and I tested it in Blue Iris and in VLC--both audio and video play fine.

Here is the ffprobe output for the RTSP stream: ffprobe rtsp://admin:password@192.168.1.197/Streaming/Channels/101 ffprobe version 5.0 Copyright (c) 2007-2022 the FFmpeg developers built with Apple clang version 13.0.0 (clang-1300.0.29.3) configuration: --prefix=/usr/local/Cellar/ffmpeg/5.0 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox libavutil 57. 17.100 / 57. 17.100 libavcodec 59. 18.100 / 59. 18.100 libavformat 59. 16.100 / 59. 16.100 libavdevice 59. 4.100 / 59. 4.100 libavfilter 8. 24.100 / 8. 24.100 libswscale 6. 4.100 / 6. 4.100 libswresample 4. 3.100 / 4. 3.100 libpostproc 56. 3.100 / 56. 3.100 Input #0, rtsp, from 'rtsp://admin:password@192.168.1.197/Streaming/Channels/101': Metadata: title : Media Presentation Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080, 30 tbr, 90k tbn Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp

After starting unifi-cam-proxy, the cam shows up as connected in Unifi Protect and thumbnails work, but the stream is just black.

Here are the commands I've tried:

podman run --net=host --name test-cam-proxy -v "./client.pem:/client.pem" docker.io/keshavdv/unifi-cam-proxy unifi-cam-proxy --verbose --ip 192.168.1.197 --host 192.168.1.1 --mac 'AA:BB:CC:DD:EE:FF' --cert /client.pem --token xyz rtsp -s rtsp://admin:password@192.168.1.197/Streaming/Channels/101

Log (I think I scrubbed all identifying info)

podman run --net=host --name test-cam-proxy -v "./client.pem:/client.pem" docker.io/keshavdv/unifi-cam-proxy unifi-cam-proxy --verbose --ip 192.168.1.197 --host 192.168.1.1 --mac 'AA:BB:CC:DD:EE:FF' --cert /client.pem --token xyz hikvision -u admin -p password

Log

Guessing maybe the Hikvision plugin requires the cam to have ONVIF. Despite being Hikvision made and having a standard Hik RTSP URL, these cams do no have ONVIF. In addition, they have no web UI--the only way I can configure them is using Hikvision's batch configuration tool.

But seems like the rtsp method should be working? Not sure why it's not.

Much appreciate any help. Ideally I would like to use ffmpeg settings to minimize the CPU load by avoiding transcoding.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.