keshavdv / unifi-cam-proxy

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

Not working for unifi x86 docker image as well? #271

Closed Buster14 closed 1 year ago

Buster14 commented 1 year ago

Camera

DS-2CD1323G0-IU

Firmware version of the camera

V5.5.84 build 191010

Description

So i managed to run hikvision camera using unifi x 86 docker image But the live stream doesn't work. It stucks at "loading" at the cam screenshot

Recording still works.. i think. I was able to get short timelapse. But during that time i rerun the container several times to get the right code

The unifi protect version says "Controller 1.13.3" so shouldn't it be working since the last working version from another thread was 1.2? Or is there any wrong code from my side?

The code i'm using is below :

How to reproduce

command : unifi-cam-proxy -H "192.168.100.55" --i 192.168.100.201  -c /client.pem -t MvvylUoarGPsbEffehjWxtdshZvUhPng hikvision -u admin -p pass --substream 2 

I was also using rtsp approach but the result was the same, stuck at live view

docker run -itd -v "/home/aio/UCP/client.pem:/client.pem" keshavdv/unifi-cam-proxy unifi-cam-proxy --verbose --ip "192.168.100.201" --host 192.168.100.55 --mac 'ad:bc:dd:49:5f:28' --cert /client.pem --name "Livingroom" --token 6RYSF8ArElNEje3keVUsO19TSbye4Gjo rtsp -s 'rtsp://admin:pass@192.168.100.201:201/Streaming/Channels/2/'

Expected behaviour

Hikvision cam works

Screenshots

No response

Aditional information

Log from portainer (using hikvision approach, not rtsp)

  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-12-31 01:15:14 96e748b7a358 HikvisionCam[1] WARNING Previous ffmpeg process for video1 died.
2022-12-31 01:15:14 96e748b7a358 HikvisionCam[1] INFO Spawning ffmpeg for video1 (jGZonuCee24723fb): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://admin:gowongan5@192.168.100.201:554/Streaming/Channels/101/" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=jGZonuCee24723fb -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.100.55 7550
2022-12-31 01:15:14 96e748b7a358 HikvisionCam[1] INFO Processing [ChangeVideoSettings] message
[tcp @ 0x7f0460697d40] Connection to tcp://192.168.100.201:554?timeout=15000000 failed: Connection refused
rtsp://admin:gowongan5@192.168.100.201:554/Streaming/Channels/101/: Connection refused
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-12-31 01:15:14 96e748b7a358 HikvisionCam[1] WARNING Previous ffmpeg process for video3 died.
2022-12-31 01:15:14 96e748b7a358 HikvisionCam[1] INFO Spawning ffmpeg for video3 (NWVKEeJYebfrkHdp): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://admin:gowongan5@192.168.100.201:554/Streaming/Channels/102/" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=NWVKEeJYebfrkHdp -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.100.55 7550
[tcp @ 0x7f505dbc9d40] Connection to tcp://192.168.100.201:554?timeout=15000000 failed: Connection refused
rtsp://admin:gowongan5@192.168.100.201:554/Streaming/Channels/102/: Connection refused
2022-12-31 01:15:23 96e748b7a358 HikvisionCam[1] INFO Processing [GetSystemStats] message
2022-12-31 01:15:23 96e748b7a358 HikvisionCam[1] INFO Processing [NetworkStatus] message
2022-12-31 01:15:28 96e748b7a358 HikvisionCam[1] INFO Processing [ChangeVideoSettings] message
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-12-31 01:15:29 96e748b7a358 HikvisionCam[1] WARNING Previous ffmpeg process for video1 died.
2022-12-31 01:15:29 96e748b7a358 HikvisionCam[1] INFO Spawning ffmpeg for video1 (jGZonuCee24723fb): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://admin:gowongan5@192.168.100.201:554/Streaming/Channels/101/" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=jGZonuCee24723fb -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.100.55 7550
2022-12-31 01:15:29 96e748b7a358 HikvisionCam[1] INFO Processing [ChangeVideoSettings] message
[tcp @ 0x7f505d894d40] Connection to tcp://192.168.100.201:554?timeout=15000000 failed: Connection refused
rtsp://admin:gowongan5@192.168.100.201:554/Streaming/Channels/101/: Connection refused
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-12-31 01:15:29 96e748b7a358 HikvisionCam[1] WARNING Previous ffmpeg process for video3 died.
2022-12-31 01:15:29 96e748b7a358 HikvisionCam[1] INFO Spawning ffmpeg for video3 (NWVKEeJYebfrkHdp): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://admin:gowongan5@192.168.100.201:554/Streaming/Channels/102/" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=NWVKEeJYebfrkHdp -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.100.55 7550
[tcp @ 0x7ff95f16fd40] Connection to tcp://192.168.100.201:554?timeout=15000000 failed: Connection refused
rtsp://admin:gowongan5@192.168.100.201:554/Streaming/Channels/102/: Connection refused
2022-12-31 01:15:33 96e748b7a358 HikvisionCam[1] INFO Processing [GetSystemStats] message
2022-12-31 01:15:33 96e748b7a358 HikvisionCam[1] INFO Processing [NetworkStatus] message
2022-12-31 01:15:43 96e748b7a358 HikvisionCam[1] INFO Processing [GetSystemStats] message
2022-12-31 01:15:43 96e748b7a358 HikvisionCam[1] INFO Processing [NetworkStatus] message
2022-12-31 01:15:43 96e748b7a358 HikvisionCam[1] INFO Processing [ChangeVideoSettings] message
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-12-31 01:15:44 96e748b7a358 HikvisionCam[1] WARNING Previous ffmpeg process for video1 died.
2022-12-31 01:15:44 96e748b7a358 HikvisionCam[1] INFO Spawning ffmpeg for video1 (jGZonuCee24723fb): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://admin:gowongan5@192.168.100.201:554/Streaming/Channels/101/" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=jGZonuCee24723fb -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.100.55 7550
2022-12-31 01:15:44 96e748b7a358 HikvisionCam[1] INFO Processing [ChangeVideoSettings] message
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
[tcp @ 0x7f99731ced40] Connection to tcp://192.168.100.201:554?timeout=15000000 failed: Connection refused
rtsp://admin:gowongan5@192.168.100.201:554/Streaming/Channels/101/: Connection refused
2022-12-31 01:15:44 96e748b7a358 HikvisionCam[1] WARNING Previous ffmpeg process for video3 died.
2022-12-31 01:15:44 96e748b7a358 HikvisionCam[1] INFO Spawning ffmpeg for video3 (NWVKEeJYebfrkHdp): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://admin:gowongan5@192.168.100.201:554/Streaming/Channels/102/" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=NWVKEeJYebfrkHdp -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 192.168.100.55 7550
[tcp @ 0x7f6cb7895d40] Connection to tcp://192.168.100.201:554?timeout=15000000 failed: Connection refused
rtsp://admin:gowongan5@192.168.100.201:554/Streaming/Channels/102/: Connection refused
stale[bot] commented 1 year 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.