keshavdv / unifi-cam-proxy

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

Reolink RLC-820A - not working #183

Closed nmummau closed 2 years ago

nmummau commented 2 years ago

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:

  1. Buy a Reolink RLC-820A
  2. Follow docs for unifi-cam-proxy
  3. Get errors

Expected behavior Stream is available for RLC-820A

Screenshots Blurry photo in the unify protect dashboard while I let the container run: image

Camera

Additional context Reolink lists on their support site that

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“.

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:

``` #:~/Code/Docker/unify-cam-proxy$ sudo docker-compose up Starting unify-cam-proxy_unifi-cam-proxy_1 ... done Attaching to unify-cam-proxy_unifi-cam-proxy_1 unifi-cam-proxy_1 | 2022-02-16 13:32:53 cce1f2e0439a RTSPCam[1] INFO Spawning stream for snapshots: ffmpeg -nostdin -y -re -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h265Preview_01_main" -r 1 -update 1 /tmp/tmpy83gvn2p/screen.jpg unifi-cam-proxy_1 | 2022-02-16 13:32:53 cce1f2e0439a Core[1] INFO Creating ws connection to wss://192.168.1.1:7442/camera/1.0/ws?token= unifi-cam-proxy_1 | 2022-02-16 13:32:53 cce1f2e0439a RTSPCam[1] INFO Adopting with token [] and mac [AABBCCDDEEFF] unifi-cam-proxy_1 | 2022-02-16 13:32:53 cce1f2e0439a RTSPCam[1] INFO Processing [ubnt_avclient_hello] message unifi-cam-proxy_1 | 2022-02-16 13:32:53 cce1f2e0439a RTSPCam[1] INFO Processing [ubnt_avclient_hello] message unifi-cam-proxy_1 | 2022-02-16 13:32:54 cce1f2e0439a RTSPCam[1] INFO Processing [ubnt_avclient_paramAgreement] message unifi-cam-proxy_1 | 2022-02-16 13:32:54 cce1f2e0439a RTSPCam[1] INFO Processing [ubnt_avclient_paramAgreement] message unifi-cam-proxy_1 | 2022-02-16 13:32:54 cce1f2e0439a RTSPCam[1] INFO Processing [StartService] message unifi-cam-proxy_1 | 2022-02-16 13:32:54 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-16 13:32:54 cce1f2e0439a RTSPCam[1] INFO Spawning ffmpeg for video1 (GRDhrvHttS3O92Dq): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h265Preview_01_main" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=GRDhrvHttS3O92Dq -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | 2022-02-16 13:32:54 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-16 13:32:54 cce1f2e0439a RTSPCam[1] INFO Spawning ffmpeg for video2 (rdNwNf0hs6c2iIzr): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h265Preview_01_main" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=rdNwNf0hs6c2iIzr -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | 2022-02-16 13:32:54 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-16 13:32:54 cce1f2e0439a RTSPCam[1] INFO Spawning ffmpeg for video3 (mUBOGbfU1PVcXByW): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h265Preview_01_main" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=mUBOGbfU1PVcXByW -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | 2022-02-16 13:32:54 cce1f2e0439a RTSPCam[1] INFO Processing [UpdateFirmwareRequest] message unifi-cam-proxy_1 | 2022-02-16 13:32:55 cce1f2e0439a RTSPCam[1] INFO Reconnecting... unifi-cam-proxy_1 | 2022-02-16 13:32:55 cce1f2e0439a RTSPCam[1] INFO Cleaning up instance unifi-cam-proxy_1 | 2022-02-16 13:32:55 cce1f2e0439a RTSPCam[1] INFO Stopping stream video1 unifi-cam-proxy_1 | 2022-02-16 13:32:55 cce1f2e0439a RTSPCam[1] INFO Stopping stream video2 unifi-cam-proxy_1 | 2022-02-16 13:32:55 cce1f2e0439a RTSPCam[1] INFO Stopping stream video3 unifi-cam-proxy_1 | 2022-02-16 13:32:55 cce1f2e0439a Core[1] INFO Backing off connect(...) for 2.0s (True) unifi-cam-proxy_1 | 2022-02-16 13:32:57 cce1f2e0439a Core[1] INFO Creating ws connection to wss://192.168.1.1:7442/camera/1.0/ws?token= unifi-cam-proxy_1 | 2022-02-16 13:32:57 cce1f2e0439a RTSPCam[1] INFO Adopting with token [] and mac [AABBCCDDEEFF] unifi-cam-proxy_1 | 2022-02-16 13:32:57 cce1f2e0439a RTSPCam[1] INFO Processing [ubnt_avclient_hello] message unifi-cam-proxy_1 | 2022-02-16 13:32:57 cce1f2e0439a RTSPCam[1] INFO Processing [ubnt_avclient_hello] message unifi-cam-proxy_1 | [flv @ 0x558428a05680] Video codec hevc not compatible with flv unifi-cam-proxy_1 | Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented unifi-cam-proxy_1 | Error initializing output stream 0:1 -- unifi-cam-proxy_1 | 2022-02-16 13:32:57 cce1f2e0439a RTSPCam[1] INFO Processing [ubnt_avclient_paramAgreement] message unifi-cam-proxy_1 | [flv @ 0x5600df059240] Video codec hevc not compatible with flv unifi-cam-proxy_1 | Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented unifi-cam-proxy_1 | Error initializing output stream 0:1 -- unifi-cam-proxy_1 | 2022-02-16 13:32:57 cce1f2e0439a RTSPCam[1] INFO Processing [ubnt_avclient_paramAgreement] message unifi-cam-proxy_1 | 2022-02-16 13:32:57 cce1f2e0439a RTSPCam[1] INFO Processing [StartService] message unifi-cam-proxy_1 | [flv @ 0x564ab9a3d540] Video codec hevc not compatible with flv unifi-cam-proxy_1 | Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented unifi-cam-proxy_1 | Error initializing output stream 0:1 -- unifi-cam-proxy_1 | 2022-02-16 13:32:58 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeDeviceSettings] message unifi-cam-proxy_1 | 2022-02-16 13:32:58 cce1f2e0439a RTSPCam[1] INFO Processing [NetworkStatus] message unifi-cam-proxy_1 | 2022-02-16 13:32:58 cce1f2e0439a RTSPCam[1] INFO Processing [GetSystemStats] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [GetRequest] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Spawning stream for snapshots: ffmpeg -nostdin -y -re -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h265Preview_01_main" -r 1 -update 1 /tmp/tmpy83gvn2p/screen.jpg unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] WARNING Snapshot file /tmp/tmpy83gvn2p/screen.jpg is not ready yet, skipping upload unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [NetworkStatus] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [GetSystemStats] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeIspSettings] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeOsdSettings] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeAudioEventsSettings] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeSoundLedSettings] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeSmartMotionSettings] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [EnableLogging] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeDeviceSettings] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeDeviceSettings] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [SmartMotionTest] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [UpdateUsernamePassword] message unifi-cam-proxy_1 | 2022-02-16 13:33:03 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | 2022-02-16 13:33:04 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-16 13:33:04 cce1f2e0439a RTSPCam[1] WARNING Previous ffmpeg process for video1 died. unifi-cam-proxy_1 | 2022-02-16 13:33:04 cce1f2e0439a RTSPCam[1] INFO Spawning ffmpeg for video1 (GRDhrvHttS3O92Dq): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h265Preview_01_main" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=GRDhrvHttS3O92Dq -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | [flv @ 0x561864050800] Video codec hevc not compatible with flv unifi-cam-proxy_1 | Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented unifi-cam-proxy_1 | Error initializing output stream 0:1 -- unifi-cam-proxy_1 | 2022-02-16 13:33:13 cce1f2e0439a RTSPCam[1] INFO Processing [NetworkStatus] message unifi-cam-proxy_1 | 2022-02-16 13:33:13 cce1f2e0439a RTSPCam[1] INFO Processing [GetSystemStats] message unifi-cam-proxy_1 | 2022-02-16 13:33:13 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-16 13:33:13 cce1f2e0439a RTSPCam[1] WARNING Previous ffmpeg process for video2 died. unifi-cam-proxy_1 | 2022-02-16 13:33:13 cce1f2e0439a RTSPCam[1] INFO Spawning ffmpeg for video2 (rdNwNf0hs6c2iIzr): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h265Preview_01_main" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=rdNwNf0hs6c2iIzr -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | 2022-02-16 13:33:13 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-16 13:33:13 cce1f2e0439a RTSPCam[1] WARNING Previous ffmpeg process for video3 died. unifi-cam-proxy_1 | 2022-02-16 13:33:13 cce1f2e0439a RTSPCam[1] INFO Spawning ffmpeg for video3 (mUBOGbfU1PVcXByW): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h265Preview_01_main" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=mUBOGbfU1PVcXByW -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | [flv @ 0x55df1d752080] Video codec hevc not compatible with flv unifi-cam-proxy_1 | Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented unifi-cam-proxy_1 | Error initializing output stream 0:1 -- unifi-cam-proxy_1 | [flv @ 0x558fd5b232c0] Video codec hevc not compatible with flv unifi-cam-proxy_1 | Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented unifi-cam-proxy_1 | Error initializing output stream 0:1 -- unifi-cam-proxy_1 | 2022-02-16 13:33:17 cce1f2e0439a RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-16 13:33:17 cce1f2e0439a RTSPCam[1] WARNING Previous ffmpeg process for video1 died. unifi-cam-proxy_1 | 2022-02-16 13:33:17 cce1f2e0439a RTSPCam[1] INFO Spawning ffmpeg for video1 (GRDhrvHttS3O92Dq): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h265Preview_01_main" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=GRDhrvHttS3O92Dq -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 ^CGracefully stopping... (press Ctrl+C again to force) Stopping unify-cam-proxy_unifi-cam-proxy_1 ... Killing unify-cam-proxy_unifi-cam-proxy_1 ... done ERROR: 2 ``` details
keshavdv commented 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)?

nmummau commented 2 years ago

Yes the RLC-820A camera does support an h264 stream. Both of these work in VLC for example:

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    

Logs as a result

``` #:~/Code/Docker/unify-cam-proxy$ sudo docker-compose up Recreating unify-cam-proxy_unifi-cam-proxy_1 ... done Attaching to unify-cam-proxy_unifi-cam-proxy_1 unifi-cam-proxy_1 | 2022-02-16 20:22:02 61b82fb3e517 RTSPCam[1] INFO Spawning stream for snapshots: ffmpeg -nostdin -y -re -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h264Preview_01_sub" -r 1 -update 1 /tmp/tmpq7164ih5/screen.jpg unifi-cam-proxy_1 | 2022-02-16 20:22:02 61b82fb3e517 Core[1] INFO Creating ws connection to wss://192.168.1.1:7442/camera/1.0/ws?token= unifi-cam-proxy_1 | 2022-02-16 20:22:02 61b82fb3e517 RTSPCam[1] INFO Adopting with token [] and mac [AABBCCDDEEFF] unifi-cam-proxy_1 | 2022-02-16 20:22:02 61b82fb3e517 RTSPCam[1] INFO Processing [ubnt_avclient_hello] message unifi-cam-proxy_1 | 2022-02-16 20:22:02 61b82fb3e517 RTSPCam[1] INFO Processing [ubnt_avclient_hello] message unifi-cam-proxy_1 | 2022-02-16 20:22:02 61b82fb3e517 RTSPCam[1] INFO Processing [ubnt_avclient_paramAgreement] message unifi-cam-proxy_1 | 2022-02-16 20:22:02 61b82fb3e517 RTSPCam[1] INFO Processing [ubnt_avclient_paramAgreement] message unifi-cam-proxy_1 | 2022-02-16 20:22:02 61b82fb3e517 RTSPCam[1] INFO Processing [StartService] message unifi-cam-proxy_1 | 2022-02-16 20:22:02 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-16 20:22:03 61b82fb3e517 RTSPCam[1] INFO Spawning ffmpeg for video1 (GRDhrvHttS3O92Dq): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h264Preview_01_sub" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=GRDhrvHttS3O92Dq -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | 2022-02-16 20:22:03 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-16 20:22:03 61b82fb3e517 RTSPCam[1] INFO Spawning ffmpeg for video2 (rdNwNf0hs6c2iIzr): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h264Preview_01_sub" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=rdNwNf0hs6c2iIzr -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | 2022-02-16 20:22:03 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-16 20:22:03 61b82fb3e517 RTSPCam[1] INFO Spawning ffmpeg for video3 (mUBOGbfU1PVcXByW): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h264Preview_01_sub" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=mUBOGbfU1PVcXByW -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | 2022-02-16 20:22:03 61b82fb3e517 RTSPCam[1] INFO Processing [UpdateFirmwareRequest] message unifi-cam-proxy_1 | 2022-02-16 20:22:03 61b82fb3e517 RTSPCam[1] INFO Reconnecting... unifi-cam-proxy_1 | 2022-02-16 20:22:03 61b82fb3e517 RTSPCam[1] INFO Cleaning up instance unifi-cam-proxy_1 | 2022-02-16 20:22:03 61b82fb3e517 RTSPCam[1] INFO Stopping stream video1 unifi-cam-proxy_1 | 2022-02-16 20:22:03 61b82fb3e517 RTSPCam[1] INFO Stopping stream video2 unifi-cam-proxy_1 | 2022-02-16 20:22:03 61b82fb3e517 RTSPCam[1] INFO Stopping stream video3 unifi-cam-proxy_1 | 2022-02-16 20:22:03 61b82fb3e517 Core[1] INFO Backing off connect(...) for 2.0s (True) unifi-cam-proxy_1 | 2022-02-16 20:22:05 61b82fb3e517 Core[1] INFO Creating ws connection to wss://192.168.1.1:7442/camera/1.0/ws?token= unifi-cam-proxy_1 | 2022-02-16 20:22:05 61b82fb3e517 RTSPCam[1] INFO Adopting with token [] and mac [AABBCCDDEEFF] unifi-cam-proxy_1 | 2022-02-16 20:22:05 61b82fb3e517 RTSPCam[1] INFO Processing [ubnt_avclient_hello] message unifi-cam-proxy_1 | 2022-02-16 20:22:05 61b82fb3e517 RTSPCam[1] INFO Processing [ubnt_avclient_hello] message unifi-cam-proxy_1 | 2022-02-16 20:22:06 61b82fb3e517 RTSPCam[1] INFO Processing [ubnt_avclient_paramAgreement] message unifi-cam-proxy_1 | 2022-02-16 20:22:06 61b82fb3e517 RTSPCam[1] INFO Processing [ubnt_avclient_paramAgreement] message unifi-cam-proxy_1 | 2022-02-16 20:22:06 61b82fb3e517 RTSPCam[1] INFO Processing [StartService] message unifi-cam-proxy_1 | 2022-02-16 20:22:06 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeDeviceSettings] message unifi-cam-proxy_1 | 2022-02-16 20:22:06 61b82fb3e517 RTSPCam[1] INFO Processing [NetworkStatus] message unifi-cam-proxy_1 | 2022-02-16 20:22:06 61b82fb3e517 RTSPCam[1] INFO Processing [GetSystemStats] message unifi-cam-proxy_1 | Traceback (most recent call last): unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main unifi-cam-proxy_1 | return _run_code(code, main_globals, None, unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code unifi-cam-proxy_1 | exec(code, run_globals) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 167, in unifi-cam-proxy_1 | main() unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 161, in main unifi-cam-proxy_1 | write(read_bytes(source, payload_size)) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 87, in write unifi-cam-proxy_1 | sys.stdout.buffer.write(data) unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | av_interleaved_write_frame(): Broken pipe unifi-cam-proxy_1 | Last message repeated 1 times unifi-cam-proxy_1 | Error writing trailer of pipe:: Broken pipe unifi-cam-proxy_1 | Traceback (most recent call last): unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main unifi-cam-proxy_1 | return _run_code(code, main_globals, None, unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code unifi-cam-proxy_1 | exec(code, run_globals) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 167, in unifi-cam-proxy_1 | main() unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 157, in main unifi-cam-proxy_1 | write(read_bytes(source, payload_size)) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 87, in write unifi-cam-proxy_1 | sys.stdout.buffer.write(data) unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | av_interleaved_write_frame(): Broken pipe unifi-cam-proxy_1 | Traceback (most recent call last): unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main unifi-cam-proxy_1 | return _run_code(code, main_globals, None, unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code unifi-cam-proxy_1 | exec(code, run_globals) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 167, in unifi-cam-proxy_1 | main() unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 161, in main unifi-cam-proxy_1 | write(read_bytes(source, payload_size)) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 87, in write unifi-cam-proxy_1 | sys.stdout.buffer.write(data) unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | Last message repeated 1 times unifi-cam-proxy_1 | Error writing trailer of pipe:: Broken pipe unifi-cam-proxy_1 | av_interleaved_write_frame(): Broken pipe unifi-cam-proxy_1 | Last message repeated 1 times unifi-cam-proxy_1 | Error writing trailer of pipe:: Broken pipe unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [GetRequest] message unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Spawning stream for snapshots: ffmpeg -nostdin -y -re -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h264Preview_01_sub" -r 1 -update 1 /tmp/tmpq7164ih5/screen.jpg unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] WARNING Snapshot file /tmp/tmpq7164ih5/screen.jpg is not ready yet, skipping upload unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeIspSettings] message unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeOsdSettings] message unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeAudioEventsSettings] message unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeSoundLedSettings] message unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeSmartMotionSettings] message unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [EnableLogging] message unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeDeviceSettings] message unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeDeviceSettings] message unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [SmartMotionTest] message unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [UpdateUsernamePassword] message unifi-cam-proxy_1 | 2022-02-16 20:22:11 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | 2022-02-16 20:22:14 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-16 20:22:14 61b82fb3e517 RTSPCam[1] WARNING Previous ffmpeg process for video2 died. unifi-cam-proxy_1 | 2022-02-16 20:22:14 61b82fb3e517 RTSPCam[1] INFO Spawning ffmpeg for video2 (rdNwNf0hs6c2iIzr): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h264Preview_01_sub" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=rdNwNf0hs6c2iIzr -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | 2022-02-16 20:22:14 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-16 20:22:14 61b82fb3e517 RTSPCam[1] WARNING Previous ffmpeg process for video1 died. unifi-cam-proxy_1 | 2022-02-16 20:22:14 61b82fb3e517 RTSPCam[1] INFO Spawning ffmpeg for video1 (GRDhrvHttS3O92Dq): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h264Preview_01_sub" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=GRDhrvHttS3O92Dq -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | 2022-02-16 20:22:14 61b82fb3e517 RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-16 20:22:14 61b82fb3e517 RTSPCam[1] WARNING Previous ffmpeg process for video3 died. unifi-cam-proxy_1 | 2022-02-16 20:22:14 61b82fb3e517 RTSPCam[1] INFO Spawning ffmpeg for video3 (mUBOGbfU1PVcXByW): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://:@192.168.40.11:554/h264Preview_01_sub" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=mUBOGbfU1PVcXByW -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | 2022-02-16 20:22:14 61b82fb3e517 RTSPCam[1] INFO Processing [NetworkStatus] message unifi-cam-proxy_1 | 2022-02-16 20:22:14 61b82fb3e517 RTSPCam[1] INFO Processing [GetSystemStats] message unifi-cam-proxy_1 | Traceback (most recent call last): unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main unifi-cam-proxy_1 | return _run_code(code, main_globals, None, unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code unifi-cam-proxy_1 | exec(code, run_globals) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 167, in unifi-cam-proxy_1 | main() unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 153, in main unifi-cam-proxy_1 | write(create_script_tag("onClockSync", data, timestamp)) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 87, in write unifi-cam-proxy_1 | sys.stdout.buffer.write(data) unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | av_interleaved_write_frame(): Broken pipe unifi-cam-proxy_1 | Last message repeated 1 times unifi-cam-proxy_1 | Error writing trailer of pipe:: Broken pipe unifi-cam-proxy_1 | Traceback (most recent call last): unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main unifi-cam-proxy_1 | return _run_code(code, main_globals, None, unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code unifi-cam-proxy_1 | exec(code, run_globals) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 167, in unifi-cam-proxy_1 | main() unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 157, in main unifi-cam-proxy_1 | write(read_bytes(source, payload_size)) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 87, in write unifi-cam-proxy_1 | sys.stdout.buffer.write(data) unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | Traceback (most recent call last): unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main unifi-cam-proxy_1 | return _run_code(code, main_globals, None, unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code unifi-cam-proxy_1 | exec(code, run_globals) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 167, in unifi-cam-proxy_1 | main() unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 157, in main unifi-cam-proxy_1 | write(read_bytes(source, payload_size)) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 87, in write unifi-cam-proxy_1 | sys.stdout.buffer.write(data) unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | av_interleaved_write_frame(): Broken pipe unifi-cam-proxy_1 | av_interleaved_write_frame(): Broken pipe unifi-cam-proxy_1 | Last message repeated 1 times unifi-cam-proxy_1 | Error writing trailer of pipe:: Broken pipe unifi-cam-proxy_1 | Last message repeated 1 times unifi-cam-proxy_1 | Error writing trailer of pipe:: Broken pipe ^CGracefully stopping... (press Ctrl+C again to force) Stopping unify-cam-proxy_unifi-cam-proxy_1 ... ``` details
nmummau commented 2 years ago

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?

nmummau commented 2 years ago

@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.

keshavdv commented 2 years ago

Can you share the output of ffprobe on the h264 version of the stream?

nmummau commented 2 years ago

@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'

Full Logs can be seen here:

``` # sudo docker-compose up Starting unify-cam-proxy_unifi-cam-proxy_1 ... done Attaching to unify-cam-proxy_unifi-cam-proxy_1 unifi-cam-proxy_1 | 2022-02-27 18:28:40 2e47ed7bd132 Core[1] INFO Creating ws connection to wss://192.168.1.1:7442/camera/1.0/ws?token= unifi-cam-proxy_1 | 2022-02-27 18:28:40 2e47ed7bd132 Reolink[1] INFO Adopting with token [] and mac [AABBCCDDEEFF] unifi-cam-proxy_1 | 2022-02-27 18:28:40 2e47ed7bd132 Reolink[1] INFO Connecting to motion events API: http://192.168.40.11:554/api.cgi?cmd=GetMdState&user=admin&password= unifi-cam-proxy_1 | 2022-02-27 18:28:40 2e47ed7bd132 Reolink[1] INFO Processing [ubnt_avclient_hello] message unifi-cam-proxy_1 | 2022-02-27 18:28:40 2e47ed7bd132 Reolink[1] INFO Processing [ubnt_avclient_hello] message unifi-cam-proxy_1 | 2022-02-27 18:28:40 2e47ed7bd132 Reolink[1] INFO Processing [ubnt_avclient_paramAgreement] message unifi-cam-proxy_1 | 2022-02-27 18:28:40 2e47ed7bd132 Reolink[1] INFO Processing [ubnt_avclient_paramAgreement] message unifi-cam-proxy_1 | 2022-02-27 18:28:40 2e47ed7bd132 Reolink[1] INFO Processing [StartService] message unifi-cam-proxy_1 | 2022-02-27 18:28:40 2e47ed7bd132 Reolink[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-27 18:28:40 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://admin:@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 unifi-cam-proxy_1 | 2022-02-27 18:28:40 2e47ed7bd132 Reolink[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-27 18:28:40 2e47ed7bd132 Reolink[1] INFO Spawning ffmpeg for video2 (zNumwNRN6mUN9R0l): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://admin:@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=zNumwNRN6mUN9R0l -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | 2022-02-27 18:28:40 2e47ed7bd132 Reolink[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-27 18:28:41 2e47ed7bd132 Reolink[1] INFO Spawning ffmpeg for video3 (IEPEL8v6SmKflBPa): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://admin:@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=IEPEL8v6SmKflBPa -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | 2022-02-27 18:28:41 2e47ed7bd132 Reolink[1] INFO Processing [UpdateFirmwareRequest] message unifi-cam-proxy_1 | 2022-02-27 18:28:41 2e47ed7bd132 Reolink[1] INFO Reconnecting... unifi-cam-proxy_1 | 2022-02-27 18:28:41 2e47ed7bd132 Reolink[1] INFO Cleaning up instance unifi-cam-proxy_1 | 2022-02-27 18:28:41 2e47ed7bd132 Reolink[1] INFO Stopping stream video1 unifi-cam-proxy_1 | 2022-02-27 18:28:41 2e47ed7bd132 Reolink[1] INFO Stopping stream video2 unifi-cam-proxy_1 | 2022-02-27 18:28:41 2e47ed7bd132 Reolink[1] INFO Stopping stream video3 unifi-cam-proxy_1 | 2022-02-27 18:28:41 2e47ed7bd132 Core[1] INFO Backing off connect(...) for 2.0s (True) unifi-cam-proxy_1 | 2022-02-27 18:28:43 2e47ed7bd132 Core[1] INFO Creating ws connection to wss://192.168.1.1:7442/camera/1.0/ws?token= unifi-cam-proxy_1 | 2022-02-27 18:28:43 2e47ed7bd132 Reolink[1] INFO Adopting with token [] and mac [AABBCCDDEEFF] unifi-cam-proxy_1 | 2022-02-27 18:28:43 2e47ed7bd132 Reolink[1] INFO Connecting to motion events API: http://192.168.40.11:554/api.cgi?cmd=GetMdState&user=admin&password= unifi-cam-proxy_1 | 2022-02-27 18:28:43 2e47ed7bd132 Reolink[1] INFO Processing [ubnt_avclient_hello] message unifi-cam-proxy_1 | 2022-02-27 18:28:43 2e47ed7bd132 Reolink[1] INFO Processing [ubnt_avclient_hello] message unifi-cam-proxy_1 | 2022-02-27 18:28:44 2e47ed7bd132 Reolink[1] INFO Processing [ubnt_avclient_paramAgreement] message unifi-cam-proxy_1 | 2022-02-27 18:28:44 2e47ed7bd132 Reolink[1] INFO Processing [ubnt_avclient_paramAgreement] message unifi-cam-proxy_1 | 2022-02-27 18:28:44 2e47ed7bd132 Reolink[1] INFO Processing [StartService] message unifi-cam-proxy_1 | 2022-02-27 18:28:44 2e47ed7bd132 Reolink[1] INFO Processing [ChangeDeviceSettings] message unifi-cam-proxy_1 | 2022-02-27 18:28:44 2e47ed7bd132 Reolink[1] INFO Processing [NetworkStatus] message unifi-cam-proxy_1 | 2022-02-27 18:28:44 2e47ed7bd132 Reolink[1] INFO Processing [GetSystemStats] message unifi-cam-proxy_1 | 2022-02-27 18:28:46 2e47ed7bd132 Reolink[1] INFO Processing [NetworkStatus] message unifi-cam-proxy_1 | 2022-02-27 18:28:46 2e47ed7bd132 Reolink[1] INFO Processing [GetSystemStats] message unifi-cam-proxy_1 | Traceback (most recent call last): unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main unifi-cam-proxy_1 | return _run_code(code, main_globals, None, unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code unifi-cam-proxy_1 | exec(code, run_globals) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 167, in unifi-cam-proxy_1 | main() unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 157, in main unifi-cam-proxy_1 | write(read_bytes(source, payload_size)) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 87, in write unifi-cam-proxy_1 | sys.stdout.buffer.write(data) unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | Traceback (most recent call last): unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main unifi-cam-proxy_1 | return _run_code(code, main_globals, None, unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code unifi-cam-proxy_1 | exec(code, run_globals) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 167, in unifi-cam-proxy_1 | main() unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 157, in main unifi-cam-proxy_1 | write(read_bytes(source, payload_size)) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 87, in write unifi-cam-proxy_1 | sys.stdout.buffer.write(data) unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | Traceback (most recent call last): unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main unifi-cam-proxy_1 | return _run_code(code, main_globals, None, unifi-cam-proxy_1 | File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code unifi-cam-proxy_1 | exec(code, run_globals) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 167, in unifi-cam-proxy_1 | main() unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 157, in main unifi-cam-proxy_1 | write(read_bytes(source, payload_size)) unifi-cam-proxy_1 | File "/app/unifi/clock_sync.py", line 87, in write unifi-cam-proxy_1 | sys.stdout.buffer.write(data) unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> unifi-cam-proxy_1 | BrokenPipeError: [Errno 32] Broken pipe unifi-cam-proxy_1 | av_interleaved_write_frame(): Broken pipe unifi-cam-proxy_1 | Last message repeated 1 times unifi-cam-proxy_1 | Error writing trailer of pipe:: Broken pipe unifi-cam-proxy_1 | av_interleaved_write_frame(): Broken pipe unifi-cam-proxy_1 | Last message repeated 1 times unifi-cam-proxy_1 | Error writing trailer of pipe:: Broken pipe unifi-cam-proxy_1 | av_interleaved_write_frame(): Broken pipe unifi-cam-proxy_1 | Last message repeated 1 times unifi-cam-proxy_1 | Error writing trailer of pipe:: Broken pipe unifi-cam-proxy_1 | 2022-02-27 18:28:49 2e47ed7bd132 Reolink[1] INFO Processing [ChangeIspSettings] message unifi-cam-proxy_1 | 2022-02-27 18:28:49 2e47ed7bd132 Reolink[1] INFO Processing [ChangeOsdSettings] message unifi-cam-proxy_1 | 2022-02-27 18:28:49 2e47ed7bd132 Reolink[1] INFO Processing [ChangeAudioEventsSettings] message unifi-cam-proxy_1 | 2022-02-27 18:28:49 2e47ed7bd132 Reolink[1] INFO Processing [ChangeSoundLedSettings] message unifi-cam-proxy_1 | 2022-02-27 18:28:49 2e47ed7bd132 Reolink[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | 2022-02-27 18:28:49 2e47ed7bd132 Reolink[1] INFO Processing [ChangeSmartMotionSettings] message unifi-cam-proxy_1 | 2022-02-27 18:28:49 2e47ed7bd132 Reolink[1] INFO Processing [EnableLogging] message unifi-cam-proxy_1 | 2022-02-27 18:28:49 2e47ed7bd132 Reolink[1] INFO Processing [ChangeDeviceSettings] message unifi-cam-proxy_1 | 2022-02-27 18:28:49 2e47ed7bd132 Reolink[1] INFO Processing [ChangeDeviceSettings] message unifi-cam-proxy_1 | 2022-02-27 18:28:49 2e47ed7bd132 Reolink[1] INFO Processing [SmartMotionTest] message unifi-cam-proxy_1 | 2022-02-27 18:28:49 2e47ed7bd132 Reolink[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | 2022-02-27 18:28:49 2e47ed7bd132 Reolink[1] INFO Processing [UpdateUsernamePassword] message unifi-cam-proxy_1 | 2022-02-27 18:28:49 2e47ed7bd132 Reolink[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | 2022-02-27 18:28:56 2e47ed7bd132 Reolink[1] INFO Processing [NetworkStatus] message unifi-cam-proxy_1 | 2022-02-27 18:28:56 2e47ed7bd132 Reolink[1] INFO Processing [GetSystemStats] message unifi-cam-proxy_1 | 2022-02-27 18:29:02 2e47ed7bd132 Reolink[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-27 18:29:02 2e47ed7bd132 Reolink[1] WARNING Previous ffmpeg process for video1 died. unifi-cam-proxy_1 | 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://admin:@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 unifi-cam-proxy_1 | 2022-02-27 18:29:02 2e47ed7bd132 Reolink[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers unifi-cam-proxy_1 | built with gcc 8.3.0 (Alpine 8.3.0) unifi-cam-proxy_1 | 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 unifi-cam-proxy_1 | libavutil 56. 22.100 / 56. 22.100 unifi-cam-proxy_1 | libavcodec 58. 35.100 / 58. 35.100 unifi-cam-proxy_1 | libavformat 58. 20.100 / 58. 20.100 unifi-cam-proxy_1 | libavdevice 58. 5.100 / 58. 5.100 unifi-cam-proxy_1 | libavfilter 7. 40.101 / 7. 40.101 unifi-cam-proxy_1 | libavresample 4. 0. 0 / 4. 0. 0 unifi-cam-proxy_1 | libswscale 5. 3.100 / 5. 3.100 unifi-cam-proxy_1 | libswresample 3. 3.100 / 3. 3.100 unifi-cam-proxy_1 | libpostproc 55. 3.100 / 55. 3.100 unifi-cam-proxy_1 | 2022-02-27 18:29:02 2e47ed7bd132 Reolink[1] WARNING Previous ffmpeg process for video3 died. unifi-cam-proxy_1 | 2022-02-27 18:29:02 2e47ed7bd132 Reolink[1] INFO Spawning ffmpeg for video3 (IEPEL8v6SmKflBPa): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://admin:@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=IEPEL8v6SmKflBPa -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.1.1 7550 unifi-cam-proxy_1 | 2022-02-27 18:29:06 2e47ed7bd132 Reolink[1] INFO Processing [NetworkStatus] message unifi-cam-proxy_1 | 2022-02-27 18:29:06 2e47ed7bd132 Reolink[1] INFO Processing [GetSystemStats] message ``` details
nmummau commented 2 years ago

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:

The "sub" stream does work, but is very choppy and sometimes freezes in VLC.

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.

dick1980 commented 2 years ago

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.

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.

matjahs commented 1 year ago

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...

JakubSukenik91 commented 5 months ago

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!

dick1980 commented 5 months ago

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.

TheLazyGeekGuy commented 4 months ago

@dick1980 : thank you for the feedback. despite trying sub channel with low res quality did not work at all. Will proxy with Frigate.