Frigate Issues

Hi all,

I am struggling a bit with getting my Anran camera’s to work. The rtsp stream is h264 and sometimes it works, sometimes it doesn’t.

This is from the log:
2023-01-11 15:17:09.007464297 [2023-01-11 16:17:09] frigate.video ERROR : Oprit: Unable to read frames from ffmpeg process.
2023-01-11 15:17:09.007811623 [2023-01-11 16:17:09] frigate.video ERROR : Oprit: ffmpeg process is not running. exiting capture thread…
2023-01-11 15:17:10.553666335 172.30.32.1 - - [11/Jan/2023:16:17:10 +0100] “GET /api/stats HTTP/1.1” 200 2487 “-” “HomeAssistant/2023.1.2 aiohttp/3.8.1 Python/3.10” “-”
2023-01-11 15:17:11.358059097 172.30.32.2 - - [11/Jan/2023:16:17:11 +0100] “GET / HTTP/1.1” 200 6640 “-” “HomeAssistantSupervisor/2022.12.1 aiohttp/3.8.3 Python/3.10” “-”
2023-01-11 15:17:18.548035500 172.30.32.1 - - [11/Jan/2023:16:17:18 +0100] “GET /api/stats HTTP/1.1” 200 2477 “-” “HomeAssistant/2023.1.2 aiohttp/3.8.1 Python/3.10” “-”
2023-01-11 15:17:25.927444292 [2023-01-11 16:17:25] watchdog.Oprit ERROR : Ffmpeg process crashed unexpectedly for Oprit.
2023-01-11 15:17:25.941524811 [2023-01-11 16:17:25] watchdog.Oprit ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-01-11 15:17:25.941537976 [2023-01-11 16:17:25] ffmpeg.Oprit.detect ERROR : ffmpeg version n5.1-2-g915ef932a3-20220731 Copyright (c) 2000-2022 the FFmpeg developers
2023-01-11 15:17:25.941546152 [2023-01-11 16:17:25] ffmpeg.Oprit.detect ERROR : built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
2023-01-11 15:17:25.941601754 [2023-01-11 16:17:25] ffmpeg.Oprit.detect ERROR : configuration: --prefix=/ffbuild/prefix --pkg-config-flags=–static --pkg-config=pkg-config --cross-prefix=x86_64-ffbuild-linux-gnu- --arch=x86_64 --target-os=linux --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libpulse --enable-libvmaf --enable-libxcb --enable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-mbedtls --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --disable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags=-pie --extra-libs=’-ldl -lgomp’ --extra-version=20220731
2023-01-11 15:17:25.941658601 [2023-01-11 16:17:25] ffmpeg.Oprit.detect ERROR : libavutil 57. 28.100 / 57. 28.100
2023-01-11 15:17:25.941664132 [2023-01-11 16:17:25] ffmpeg.Oprit.detect ERROR : libavcodec 59. 37.100 / 59. 37.100
2023-01-11 15:17:25.941669110 [2023-01-11 16:17:25] ffmpeg.Oprit.detect ERROR : libavformat 59. 27.100 / 59. 27.100
2023-01-11 15:17:25.941673633 [2023-01-11 16:17:25] ffmpeg.Oprit.detect ERROR : libavdevice 59. 7.100 / 59. 7.100
2023-01-11 15:17:25.941678254 [2023-01-11 16:17:25] ffmpeg.Oprit.detect ERROR : libavfilter 8. 44.100 / 8. 44.100
2023-01-11 15:17:25.941717897 [2023-01-11 16:17:25] ffmpeg.Oprit.detect ERROR : libswscale 6. 7.100 / 6. 7.100
2023-01-11 15:17:25.941723444 [2023-01-11 16:17:25] ffmpeg.Oprit.detect ERROR : libswresample 4. 7.100 / 4. 7.100
2023-01-11 15:17:25.941727671 [2023-01-11 16:17:25] ffmpeg.Oprit.detect ERROR : libpostproc 56. 6.100 / 56. 6.100
2023-01-11 15:17:25.941794542 [2023-01-11 16:17:25] ffmpeg.Oprit.detect ERROR : [tcp @ 0x55e26a883000] Connection to tcp://192.168.0.252:554?timeout=0 failed: No route to host
2023-01-11 15:17:25.941800117 [2023-01-11 16:17:25] ffmpeg.Oprit.detect ERROR : rtsp://:@192.168.0.252:554/ch0_1.264: No route to host
2023-01-11 15:17:25.966490971 [2023-01-11 16:17:25] ffmpeg.Oprit.record ERROR : ffmpeg version n5.1-2-g915ef932a3-20220731 Copyright (c) 2000-2022 the FFmpeg developers
2023-01-11 15:17:25.966504404 [2023-01-11 16:17:25] ffmpeg.Oprit.record ERROR : built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
2023-01-11 15:17:25.966527226 [2023-01-11 16:17:25] ffmpeg.Oprit.record ERROR : configuration: --prefix=/ffbuild/prefix --pkg-config-flags=–static --pkg-config=pkg-config --cross-prefix=x86_64-ffbuild-linux-gnu- --arch=x86_64 --target-os=linux --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libpulse --enable-libvmaf --enable-libxcb --enable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-mbedtls --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --disable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags=-pie --extra-libs=’-ldl -lgomp’ --extra-version=20220731
2023-01-11 15:17:25.966533377 [2023-01-11 16:17:25] ffmpeg.Oprit.record ERROR : libavutil 57. 28.100 / 57. 28.100
2023-01-11 15:17:25.966537781 [2023-01-11 16:17:25] ffmpeg.Oprit.record ERROR : libavcodec 59. 37.100 / 59. 37.100
2023-01-11 15:17:25.966542126 [2023-01-11 16:17:25] ffmpeg.Oprit.record ERROR : libavformat 59. 27.100 / 59. 27.100
2023-01-11 15:17:25.966546318 [2023-01-11 16:17:25] ffmpeg.Oprit.record ERROR : libavdevice 59. 7.100 / 59. 7.100
2023-01-11 15:17:25.966550523 [2023-01-11 16:17:25] ffmpeg.Oprit.record ERROR : libavfilter 8. 44.100 / 8. 44.100
2023-01-11 15:17:25.966554483 [2023-01-11 16:17:25] ffmpeg.Oprit.record ERROR : libswscale 6. 7.100 / 6. 7.100
2023-01-11 15:17:25.966558362 [2023-01-11 16:17:25] ffmpeg.Oprit.record ERROR : libswresample 4. 7.100 / 4. 7.100
2023-01-11 15:17:25.966562492 [2023-01-11 16:17:25] ffmpeg.Oprit.record ERROR : libpostproc 56. 6.100 / 56. 6.100
2023-01-11 15:17:25.966567459 [2023-01-11 16:17:25] ffmpeg.Oprit.record ERROR : [tcp @ 0x55649df8f240] Connection to tcp://192.168.0.252:554?timeout=0 failed: No route to host
2023-01-11 15:17:25.966571766 [2023-01-11 16:17:25] ffmpeg.Oprit.record ERROR : rtsp://:@192.168.0.252:554/ch0_0.264: No route to host
2023-01-11 15:17:25.966575985 [2023-01-11 16:17:25] watchdog.Oprit INFO : Terminating the existing ffmpeg process…
2023-01-11 15:17:25.967744083 [2023-01-11 16:17:25] watchdog.Oprit INFO : Waiting for ffmpeg to exit gracefully…
2023-01-11 15:17:26.549554964 172.30.32.1 - - [11/Jan/2023:16:17:26 +0100] “GET /api/stats HTTP/1.1” 200 2540 “-” “HomeAssistant/2023.1.2 aiohttp/3.8.1 Python/3.10” “-”
2023-01-11 15:17:29.044518165 [2023-01-11 16:17:29] frigate.video ERROR : Oprit: Unable to read frames from ffmpeg process.
2023-01-11 15:17:29.044953040 [2023-01-11 16:17:29] frigate.video ERROR : Oprit: ffmpeg process is not running. exiting capture thread…

This is my config:

ffmpeg:
  input_args:
    - -avoid_negative_ts
    - make_zero
    - -fflags
    - +genpts+discardcorrupt
    - -flags
    - low_delay
    - -strict
    - experimental
    - -analyzeduration
    - 1000M
    - -probesize
    - 1000M
  global_args: -analyzeduration 1000M -probesize 1000M  
  output_args:
    detect: -f rawvideo -pix_fmt yuv420p
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an

cameras
 Oprit:
    ffmpeg:
      inputs:
      # High Resolution
        - path: rtsp://admin:[email protected]:554/ch0_0.264
          roles:
            - record
      # Low Resolution
        - path: rtsp://xxxx:[email protected]:554/ch0_1.264
          roles:
            - detect
            - restream

            
    best_image_timeout: 60
    rtmp:
      enabled: false # <-- RTMP should be disabled if your stream is not H264

Any ideas what’s wrong?

All help would be greatly appreciated.

Kr,

Pim