keshavdv / unifi-cam-proxy

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

Get broken pipe exceptio #344

Open loungelizard2018 opened 7 months ago

loungelizard2018 commented 7 months ago

Camera

Dafang (Wyze V3

Firmware version of the camera

running on custom firmware /EliasKotlyar/Xiaomi-Dafang-Hacks

Description

Hi, I managed to get the docker up and running in unraid and it is sporadically updating the video image on the UDM Pro. It is shown as a G3 but strangely with a completely wrong IP address (192.168.1.10 which is nowhere in use in my setup). The camera itself is running under 10.1.100.254.

I see broken ffmpeg messages in the log which are probably the reason the picture is updated sporadically only. When I view the livestream of the camera via vlc it works fine.

Any pointers as to what I can try to get it up and running smoothly?

cheers, Florian


`2023-12-02 23:16:39 63910d932a7e RTSPCam[1] INFO Spawning ffmpeg for video2 (d10LqkTTbP3LsNVk): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://10.1.110.254:8554/unicast" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=d10LqkTTbP3LsNVk -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 10.1.100.1 7550
[mp3float @ 0x14fef5ec3680] Header missing
2023-12-02 23:16:41 63910d932a7e RTSPCam[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
2023-12-02 23:16:42 63910d932a7e RTSPCam[1] WARNING Previous ffmpeg process for video1 died.
2023-12-02 23:16:42 63910d932a7e RTSPCam[1] INFO Spawning ffmpeg for video1 (cQV9TDczEgC67NnO): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://10.1.110.254:8554/unicast" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=cQV9TDczEgC67NnO -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 10.1.100.1 7550
[mp3float @ 0x1477d144b680] Header missing
2023-12-02 23:16:42 63910d932a7e RTSPCam[1] INFO Processing [GetRequest] message
[mp3float @ 0x5618dcdecd40] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/app/unifi/clock_sync.py", line 167, in <module>
    main()
  File "/app/unifi/clock_sync.py", line 161, in main
    write(read_bytes(source, payload_size))
  File "/app/unifi/clock_sync.py", line 87, in write
    sys.stdout.buffer.write(data)
BrokenPipeError: [Errno 32] Broken pipe
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:: Broken pipe
2023-12-02 23:16:44 63910d932a7e RTSPCam[1] INFO Processing [NetworkStatus] message
2023-12-02 23:16:44 63910d932a7e RTSPCam[1] INFO Processing [GetSystemStats] message
[mp3float @ 0x1477cf39a4c0] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/app/unifi/clock_sync.py", line 167, in <module>
    main()
  File "/app/unifi/clock_sync.py", line 161, in main
    write(read_bytes(source, payload_size))
  File "/app/unifi/clock_sync.py", line 87, in write
    sys.stdout.buffer.write(data)
BrokenPipeError: [Errno 32] Broken pipe
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:: Broken pipe
2023-12-02 23:16:49 63910d932a7e RTSPCam[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
2023-12-02 23:16:49 63910d932a7e RTSPCam[1] WARNING Previous ffmpeg process for video2 died.
2023-12-02 23:16:49 63910d932a7e RTSPCam[1] INFO Spawning ffmpeg for video2 (d10LqkTTbP3LsNVk): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://10.1.110.254:8554/unicast" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=d10LqkTTbP3LsNVk -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 10.1.100.1 7550
[mp3float @ 0x153144652680] Header missing
2023-12-02 23:16:54 63910d932a7e RTSPCam[1] INFO Processing [NetworkStatus] message
2023-12-02 23:16:54 63910d932a7e RTSPCam[1] INFO Processing [GetSystemStats] message
[mp3float @ 0x55a24e0377c0] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/app/unifi/clock_sync.py", line 167, in <module>
    main()
  File "/app/unifi/clock_sync.py", line 161, in main
    write(read_bytes(source, payload_size))
  File "/app/unifi/clock_sync.py", line 87, in write
    sys.stdout.buffer.write(data)
BrokenPipeError: [Errno 32] Broken pipe
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:: Broken pipe
2023-12-02 23:16:55 63910d932a7e RTSPCam[1] INFO Processing [GetRequest] message

````2023-12-02 23:16:39 63910d932a7e RTSPCam[1] INFO Spawning ffmpeg for video2 (d10LqkTTbP3LsNVk): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://10.1.110.254:8554/unicast" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=d10LqkTTbP3LsNVk -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 10.1.100.1 7550
[mp3float @ 0x14fef5ec3680] Header missing
2023-12-02 23:16:41 63910d932a7e RTSPCam[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
2023-12-02 23:16:42 63910d932a7e RTSPCam[1] WARNING Previous ffmpeg process for video1 died.
2023-12-02 23:16:42 63910d932a7e RTSPCam[1] INFO Spawning ffmpeg for video1 (cQV9TDczEgC67NnO): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://10.1.110.254:8554/unicast" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=cQV9TDczEgC67NnO -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 10.1.100.1 7550
[mp3float @ 0x1477d144b680] Header missing
2023-12-02 23:16:42 63910d932a7e RTSPCam[1] INFO Processing [GetRequest] message
[mp3float @ 0x5618dcdecd40] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/app/unifi/clock_sync.py", line 167, in <module>
    main()
  File "/app/unifi/clock_sync.py", line 161, in main
    write(read_bytes(source, payload_size))
  File "/app/unifi/clock_sync.py", line 87, in write
    sys.stdout.buffer.write(data)
BrokenPipeError: [Errno 32] Broken pipe
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:: Broken pipe
2023-12-02 23:16:44 63910d932a7e RTSPCam[1] INFO Processing [NetworkStatus] message
2023-12-02 23:16:44 63910d932a7e RTSPCam[1] INFO Processing [GetSystemStats] message
[mp3float @ 0x1477cf39a4c0] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/app/unifi/clock_sync.py", line 167, in <module>
    main()
  File "/app/unifi/clock_sync.py", line 161, in main
    write(read_bytes(source, payload_size))
  File "/app/unifi/clock_sync.py", line 87, in write
    sys.stdout.buffer.write(data)
BrokenPipeError: [Errno 32] Broken pipe
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:: Broken pipe
2023-12-02 23:16:49 63910d932a7e RTSPCam[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
2023-12-02 23:16:49 63910d932a7e RTSPCam[1] WARNING Previous ffmpeg process for video2 died.
2023-12-02 23:16:49 63910d932a7e RTSPCam[1] INFO Spawning ffmpeg for video2 (d10LqkTTbP3LsNVk): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://10.1.110.254:8554/unicast" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=d10LqkTTbP3LsNVk -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc 10.1.100.1 7550
[mp3float @ 0x153144652680] Header missing
2023-12-02 23:16:54 63910d932a7e RTSPCam[1] INFO Processing [NetworkStatus] message
2023-12-02 23:16:54 63910d932a7e RTSPCam[1] INFO Processing [GetSystemStats] message
[mp3float @ 0x55a24e0377c0] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/app/unifi/clock_sync.py", line 167, in <module>
    main()
  File "/app/unifi/clock_sync.py", line 161, in main
    write(read_bytes(source, payload_size))
  File "/app/unifi/clock_sync.py", line 87, in write
    sys.stdout.buffer.write(data)
BrokenPipeError: [Errno 32] Broken pipe
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:: Broken pipe
2023-12-02 23:16:55 63910d932a7e RTSPCam[1] INFO Processing [GetRequest] message

### How to reproduce

restart the docker. consistent behavior.

### Expected behaviour

_No response_

### Screenshots

_No response_

### Additional information

_No response_
fwest57 commented 1 week ago

Does the git clone https://github.com/zacharee/unifi-cam-proxy.git. I keep getting an error "unable to 'git clone' to temporary context directory: error fatching : fatal: couldn't find remote ref master: exit status 128.