Closed nmummau closed 2 years ago
h265 is not supported by Protect, so unless your camera supports a h264 stream, you'll be forced to transcode the source which will be rather expensive. Have you tried using the substream which seems like it can be set up to use h264 (rtsp://<username>:<password>@192.168.40.11:554/h264Preview_01_sub
)?
Yes the RLC-820A camera does support an h264 stream. Both of these work in VLC for example:
rtsp://<username>:<password>@192.168.40.11:554/h264Preview_01_sub
rtsp://<username>:<password>@192.168.40.11:554/h265Preview_01_main
I always use the main stream since the quality is much better after some testing. However I am very willing to use the h264 stream if that's what it'll take to get the camera into Protect!
I tried this, with results below: docker-compose.yaml
version: "3.9"
services:
unifi-cam-proxy:
restart: unless-stopped
image: keshavdv/unifi-cam-proxy
volumes:
- "./client.pem:/client.pem"
command: unifi-cam-proxy --host 192.168.1.1 --cert /client.pem --token <token> rtsp -s rtsp://<username>:<password>@192.168.40.11:554/h264Preview_01_sub
I did notice that the Documentation does list some special known Reolink configurations to try. Is it possible my docker-compose file should be modified to something like those docs describe for Reolink?
@keshavdv do you have any ideas on this? I've tried every combination of what was listed on the docs, and nothing seems to be working for me.
Can you share the output of ffprobe on the h264 version of the stream?
@keshavdv I think this is what you mean by the "output of ffprobe". If it's not, can you tell me how to get what you need? Below is the docker-compose that I'm using now with Reolink recommendations from the documentation. Also the full logs can be viewed if needed.
ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 8.3.0 (Alpine 8.3.0)
configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --disable-debug
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
2022-02-27 18:29:02 2e47ed7bd132 Reolink[1] WARNING Previous ffmpeg process for video1 died.
2022-02-27 18:29:02 2e47ed7bd132 Reolink[1] INFO Spawning ffmpeg for video1 (FkTLcDQpkK23Mhkf): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://<username>:<password>@192.168.40.11:554:554//h264Preview_01_sub" -c:v copy -bsf:v "h264_metadata=tick_rate=60000/1001" -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=FkTLcDQpkK23Mhkf -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550
my docker-compose file looks like this now:
version: "3.9"
services:
unifi-cam-proxy:
restart: unless-stopped
image: keshavdv/unifi-cam-proxy
volumes:
- "./client.pem:/client.pem"
command: >
unifi-cam-proxy --host 192.168.1.1 -i 192.168.40.11:554 --cert /client.pem --token <token>
reolink -u <admin> -p <password> -s sub --ffmpeg-args='-c:v copy -bsf:v "h264_metadata=tick_rate=60000/1001" -ar 32000 -ac 1 -codec:a aac -b:a 32k'
I'm giving up on this. From Reolink's docs on this page they do say:
Note: Since the Video Format for the new 8mp model RLC-810A , RLC-820A& RLC-1220A is H.265, if you want to see main RTSP stream, please change ‘’h264“to “h265“.
I previously stated that the h264 streams did work for me using VLC to test. However after retrying, it seems that the "main" stream does not work:
rtsp://<username>:<password>@192.168.40.11:554/h264Preview_01_main
The "sub" stream does work, but is very choppy and sometimes freezes in VLC.
rtsp://<username>:<password>@192.168.40.11:554/h264Preview_01_sub
So if unify does not support h265, and Reolink claims that this camera uses the h265 format, there is probably no hope to get this camera to work with the proxy. At least not that I can see. Hope this thread helps someone else at least.
Feel free to close this issue if you agree that it's not feasible to use the proxy to get this camera into unifi.
Have you tried using the Reolink-specific method? I've had some succes using the h264 sub-stream of an RLC-811A with the following setup (even supporting motion detection):
unifi-cam-proxy -H <NVR IP> -i <camera IP> -c client.pem -t <Adoption token> reolink -u {username} -p {password} -s "sub" --ffmpeg-args='-c:v copy -vbsf "h264_metadata=tick_rate=50000/1001" -ar 32000 -ac 1 -codec:a aac -b:a 32k'
The above automatically connects to the h264Preview_01_sub stream. It's a bit choppy at times, but it's quite acceptable.
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.
Have you tried using the Reolink-specific method? I've had some succes using the h264 sub-stream of an RLC-811A with the following setup (even supporting motion detection):
unifi-cam-proxy -H <NVR IP> -i <camera IP> -c client.pem -t <Adoption token> reolink -u {username} -p {password} -s "sub" --ffmpeg-args='-c:v copy -vbsf "h264_metadata=tick_rate=50000/1001" -ar 32000 -ac 1 -codec:a aac -b:a 32k'
The above automatically connects to the h264Preview_01_sub stream. It's a bit choppy at times, but it's quite acceptable.
@dick1980 Do you have to modify any settings on your 811A? I am trying to get this working but struggling to do so...
Have you tried using the Reolink-specific method? I've had some succes using the h264 sub-stream of an RLC-811A with the following setup (even supporting motion detection):
unifi-cam-proxy -H <NVR IP> -i <camera IP> -c client.pem -t <Adoption token> reolink -u {username} -p {password} -s "sub" --ffmpeg-args='-c:v copy -vbsf "h264_metadata=tick_rate=50000/1001" -ar 32000 -ac 1 -codec:a aac -b:a 32k'
The above automatically connects to the h264Preview_01_sub stream. It's a bit choppy at times, but it's quite acceptable.@dick1980 Do you have to modify any settings on your 811A? I am trying to get this working but struggling to do so...
Has anyone managed to crack unifi-cam-proxy for Reolink RLC 811a?
Im trying this docker-compose.yaml
version: "3.9"
services:
unifi-cam-proxy:
restart: unless-stopped
image: keshavdv/unifi-cam-proxy
volumes:
- "./client.pem:/client.pem"
command: unifi-cam-proxy --host 192.168.41.1 --cert /client.pem --token k4WBNvHjgqcDUgEiDeAdCK9k1N86WxgE rtsp -s rtsp://admin:password@192.168.41.107:554 --ffmpeg-args='-c:v copy -bsf:v "h264_metadata=tick_rate=50000/1001" -ar 32000 -ac 1 -codec:a aac -b:a 32k'
But the image is frozen and I can't seem to get it to be somewhat fluid. Thanks!
After 6 months of trying to get this to work, I've completely dropped this. It's fully unsupported and out of development. I've succesfully been using Frigate on Home Assistant for the non-Unifi cameras.
@dick1980 : thank you for the feedback. despite trying sub channel with low res quality did not work at all. Will proxy with Frigate.
Describe the bug Stream not working for Reolink RLC-820A camera. I believe I have followed the setup instructions correctly because I'm able to see a blurry still image of the RTSP stream in the unify protect dashboard. However, the logs indicate a recurring problem, with an error of "Error initializing output stream". Despite the blurry image, the stream never works. Full logs are below captured for about a minute where it seems it is looping through an error and attempting to restart after each failure.
To Reproduce Steps to reproduce the behavior:
Expected behavior Stream is available for RLC-820A
Screenshots Blurry photo in the unify protect dashboard while I let the container run:
Camera
Additional context Reolink lists on their support site that
This is why the RTSP stream is:
rtsp://<username>:<password>@192.168.40.11:554/h265Preview_01_main
This RTSP stream is tested to work in other applications.Full Logs can be seen here: