frigate: [HW Accel Support]: Unable to read frames from ffmpeg process.

Describe the problem you are having

Hey!

I’ve got an unexplainable issue enabling hardware acceleration for my Dahua IPC-EBW81242-AS-S2 fisheye camera. I’m using blakeblackshear/frigate:0.11.0-rc1 official image from Docker-Hub.

With Hardware-Acceleration enabled all I get is a Greenscreen. Software-Encoding does great - Expect the CPU-Load.

Another camera in the same instance does work great with Hardware-Encoding.

Maybe you could help?

If that helps, then I could upload a short recording from the camera.

Version

Frigate (0.11.0-37325c7)

Frigate config file

mqtt:
    host: xxx.xxx.xxx.xxx

detectors:
  coral:
    type: edgetpu
    device: usb

logger:
  # Optional: default log level (default: shown below)
  default: info

detect:
  enabled: True

record:
  enabled: True
  events:
    retain:
     default: 14

rtmp:
  enabled: False

snapshots:
  enabled: True
  bounding_box: True
  timestamp: True
  retain:
    default: 14

cameras:
  garten_seite:
    ffmpeg:
      global_args: -hide_banner -loglevel info
#      hwaccel_args:
#        - -c:v
#        - h264_v4l2m2m#      hwaccel_args:
#        - -c:v
#        - h264_v4l2m2m
      inputs:
        - path: rtsp://frigate:xxx@xxx.xxx.xxx.xxx:554/cam/realmonitor?channel=1&subtype=2
          roles:
            - detect
#          hwaccel_args:
#            - -c:v
#            - h264_v4l2m2m
        - path: rtsp://frigate:xxx@xxx.xxx.xxx.xxx:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - record
#          hwaccel_args:
#            - -c:v
#            - h264_v4l2m2m
    objects:
      track:
        - person
        - cat
      filters:
        person:
          min_score: 0.50
          threshold: 0.59
        cat:
          min_score: 0.50
          threshold: 0.59
    detect:
      width: 1280
      height: 960
      fps: 5
    # 1O-4000x3000 + 1Stream-1280x960
    motion:
      contour_area: 15
      mask:
         - 381,728,892,200,985,289,600,960,1280,960,1280,0,0,0,0,960,132,960
         - 765,331,849,422,800,504,704,526,632,557,562,622,497,690,430,796,469,960,679,960,945,960,941,621,835,544,900,470,1011,288,914,161
         - 750,341,765,367,708,415,722,447,646,438
    zones:
      garten_seite_weg:
        coordinates: 732,381,737,358,761,328,832,405,561,723,516,680,452,730,422,700


  front:
    ffmpeg:
      hwaccel_args:
        - -c:v
        - h264_v4l2m2m
      inputs:
        - path: rtsp://xxx.xxx.xxx.xxx:8554/unicast
          roles:
            - detect
            - record
    zones:
      front_eingang:
        coordinates: 633,189,265,187,324,236,352,253,343,283,366,313,360,408,467,408
        objects:
          - person
          - cat
          - car
          - dog

    objects:
      track:
        - person
        - bicycle
        - motorcycle
        - car
        - cat
        - dog
      filters:
        person:
          min_score: 0.50
          threshold: 0.60
        cat:
          min_score: 0.50
          threshold: 0.55
    motion:
      improve_contrast: True
      mask:
         - 0,480,640,480,640,176,465,408,375,405,339,350,363,311,349,276,336,238,445,235,451,150,306,151,286,166,254,118,256,73,230,54,241,21,210,0,0,0
         - 640,0,640,83,575,82,558,53,564,0
    detect:
      width: 640
      height: 480
      fps: 5

docker-compose file or Docker CLI command

frigate11:
    image: blakeblackshear/frigate:0.11.0-rc1
    environment:
      - FRIGATE_RTSP_PASSWORD='xxx'
    container_name: frigate11
    privileged: true
    shm_size: "1024mb"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /media/data/etc/frigate11/config.yml:/config/config.yml:ro
      - /media/data/var/lib/frigate11:/media/frigate
      - /dev:/dev
    devices:
      - /dev/video10:/dev/video10
      - /dev/video11:/dev/video11
      - /dev/video12:/dev/video12
      - /dev/video13:/dev/video13
      - /dev/video14:/dev/video14
      - /dev/video15:/dev/video15
      - /dev/video16:/dev/video16
      - /dev/video18:/dev/video18
      - /dev/video20:/dev/video20
      - /dev/video21:/dev/video21
      - /dev/video22:/dev/video22
      - /dev/video23:/dev/video23
      - /dev/video31:/dev/video31
      - /dev/bus/usb:/dev/bus/usb
    ports:
      - "5000:5000"
    depends_on:
      - mqtt

  mqtt:
    container_name: mqtt
    image: eclipse-mosquitto:1.6
    ports:
      - "1883:1883"

Relevant log output

frigate11  | [services.d] starting services
frigate11  | [services.d] done.
frigate11  | [2022-08-30 17:10:02] frigate.app                    INFO    : Starting Frigate (0.11.0-37325c7)
frigate11  | Starting migrations
frigate11  | [2022-08-30 17:10:02] peewee_migrate                 INFO    : Starting migrations
frigate11  | There is nothing to migrate
frigate11  | [2022-08-30 17:10:02] peewee_migrate                 INFO    : There is nothing to migrate
frigate11  | [2022-08-30 17:10:03] detector.coral                 INFO    : Starting detection process: 210
frigate11  | [2022-08-30 17:10:03] frigate.app                    INFO    : Output process started: 212
frigate11  | [2022-08-30 17:10:03] frigate.app                    INFO    : Camera processor started for garten_seite: 214
frigate11  | [2022-08-30 17:10:03] ws4py                          INFO    : Using epoll
frigate11  | [2022-08-30 17:10:03] frigate.app                    INFO    : Camera processor started for front: 215
frigate11  | [2022-08-30 17:10:03] frigate.app                    INFO    : Capture process started for garten_seite: 216
frigate11  | [2022-08-30 17:10:03] frigate.edgetpu                INFO    : Attempting to load TPU as usb
frigate11  | [2022-08-30 17:10:03] frigate.app                    INFO    : Capture process started for front: 219
frigate11  | [2022-08-30 17:10:03] ws4py                          INFO    : Using epoll
frigate11  | [2022-08-30 17:10:05] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:43708]
frigate11  | [2022-08-30 17:10:05] frigate.edgetpu                INFO    : TPU found
frigate11  | [2022-08-30 17:10:09] frigate.record                 WARNING : Discarding a corrupt recording segment: {'cache_path': '/tmp/cache/garten_seite-20220830170852.mp4', 'start_time': datetime.datetime(2022, 8, 30, 17, 8, 52)}
frigate11  | [2022-08-30 17:10:10] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:43708]
frigate11  | [2022-08-30 17:10:11] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:39338]
frigate11  | [2022-08-30 17:10:12] frigate.record                 WARNING : Discarding a corrupt recording segment: {'cache_path': '/tmp/cache/garten_seite-20220830170852.mp4', 'start_time': datetime.datetime(2022, 8, 30, 17, 8, 52)}
frigate11  | [2022-08-30 17:10:17] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:39338]
frigate11  | [2022-08-30 17:10:18] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:51868]
frigate11  | [2022-08-30 17:10:20] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:33732]
frigate11  | [2022-08-30 17:10:23] watchdog.garten_seite          INFO    : No frames received from garten_seite in 20 seconds. Exiting ffmpeg...
frigate11  | [2022-08-30 17:10:23] watchdog.garten_seite          INFO    : Waiting for ffmpeg to exit gracefully...
frigate11  | [2022-08-30 17:10:29] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:33732]
frigate11  | [2022-08-30 17:10:29] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:51570]
frigate11  | [2022-08-30 17:10:35] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:51570]
frigate11  | [2022-08-30 17:10:35] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:51580]
frigate11  | [2022-08-30 17:10:36] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:51580]
frigate11  | [2022-08-30 17:10:53] watchdog.garten_seite          INFO    : FFmpeg didnt exit. Force killing...
frigate11  | [2022-08-30 17:10:53] frigate.video                  ERROR   : garten_seite: Unable to read frames from ffmpeg process.
frigate11  | [2022-08-30 17:10:53] frigate.video                  ERROR   : garten_seite: Unable to read frames from ffmpeg process.
frigate11  | [2022-08-30 17:10:53] frigate.video                  ERROR   : garten_seite: Unable to read frames from ffmpeg process.
frigate11  | [2022-08-30 17:10:53] frigate.video                  ERROR   : garten_seite: ffmpeg process is not running. exiting capture thread...
frigate11  | [2022-08-30 17:11:03] watchdog.garten_seite          ERROR   : Ffmpeg process crashed unexpectedly for garten_seite.
frigate11  | [2022-08-30 17:11:03] watchdog.garten_seite          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
frigate11  | [2022-08-30 17:11:03] ffmpeg.garten_seite.detect     ERROR   : Input #0, rtsp, from 'rtsp://frigate:xxx@xxx.xxx.xxx.xxx:554/cam/realmonitor?channel=1&subtype=2':
frigate11  | [2022-08-30 17:11:03] ffmpeg.garten_seite.detect     ERROR   :   Metadata:
frigate11  | [2022-08-30 17:11:03] ffmpeg.garten_seite.detect     ERROR   :     title           : Media Server
frigate11  | [2022-08-30 17:11:03] ffmpeg.garten_seite.detect     ERROR   :   Duration: N/A, start: 1661872203.589167, bitrate: N/A
frigate11  | [2022-08-30 17:11:03] ffmpeg.garten_seite.detect     ERROR   :   Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1280x960 [SAR 1:1 DAR 4:3], 10 fps, 25 tbr, 90k tbn
frigate11  | [2022-08-30 17:11:03] ffmpeg.garten_seite.detect     ERROR   : [h264_v4l2m2m @ 0x378c9e0] Using device /dev/video10
frigate11  | [2022-08-30 17:11:03] ffmpeg.garten_seite.detect     ERROR   : [h264_v4l2m2m @ 0x378c9e0] driver 'bcm2835-codec' on card 'bcm2835-codec-decode' in mplane mode
frigate11  | [2022-08-30 17:11:03] ffmpeg.garten_seite.detect     ERROR   : [h264_v4l2m2m @ 0x378c9e0] requesting formats: output=H264 capture=YU12
frigate11  | [2022-08-30 17:11:03] ffmpeg.garten_seite.detect     ERROR   : Stream mapping:
frigate11  | [2022-08-30 17:11:03] ffmpeg.garten_seite.detect     ERROR   :   Stream #0:0 -> #0:0 (h264 (h264_v4l2m2m) -> rawvideo (native))
frigate11  | [2022-08-30 17:11:03] ffmpeg.garten_seite.detect     ERROR   : Press [q] to stop, [?] for help
frigate11  | [2022-08-30 17:11:06] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:51868]
frigate11  | [2022-08-30 17:11:23] watchdog.garten_seite          INFO    : No frames received from garten_seite in 20 seconds. Exiting ffmpeg...
frigate11  | [2022-08-30 17:11:23] watchdog.garten_seite          INFO    : Waiting for ffmpeg to exit gracefully...

FFprobe output from your camera

This is run within your docker image.

Passing “-rtsp_transport tcp” as additional parameter returns no warnings. Passing in ffmpeg -> global_args does not help with my greenscreen-issue.

--- Record-Stream
# ffprobe "rtsp://frigate:xxx@xxx.xxx.xxx.xxx:554/cam/realmonitor?channel=1&subtype=0"
ffprobe version 5.0.1-Jellyfin Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-libs=-lfftw3f --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-shared --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-static --enable-gmp --enable-gnutls --enable-chromaprint --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --toolchain=hardened --enable-cross-compile --arch=armhf --cross-prefix=/usr/bin/arm-linux-gnueabihf-
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
[udp @ 0x20d39c0] attempted to set receive buffer to size 393216 but it only ended up set as 360448
[udp @ 0x20e3d00] attempted to set receive buffer to size 393216 but it only ended up set as 360448
[rtsp @ 0x20ce790] max delay reached. need to consume packet
[rtsp @ 0x20ce790] RTP: missed 3 packets
[rtsp @ 0x20ce790] max delay reached. need to consume packet
[rtsp @ 0x20ce790] RTP: missed 48 packets
[rtsp @ 0x20ce790] max delay reached. need to consume packet
[rtsp @ 0x20ce790] RTP: missed 14 packets
[rtsp @ 0x20ce790] max delay reached. need to consume packet
[rtsp @ 0x20ce790] RTP: missed 1 packets
[rtsp @ 0x20ce790] max delay reached. need to consume packet
[rtsp @ 0x20ce790] RTP: missed 12 packets
[rtsp @ 0x20ce790] max delay reached. need to consume packet
[rtsp @ 0x20ce790] RTP: missed 205 packets
[h264 @ 0x20d2e40] concealing 28896 DC, 28896 AC, 28896 MV errors in I frame
[rtsp @ 0x20ce790] max delay reached. need to consume packet
[rtsp @ 0x20ce790] RTP: missed 57 packets
[h264 @ 0x20d2e40] cabac decode of qscale diff failed at 130 134
[h264 @ 0x20d2e40] error while decoding MB 130 134, bytestream 19450
[h264 @ 0x20d2e40] concealing 13419 DC, 13419 AC, 13419 MV errors in P frame
[rtsp @ 0x20ce790] max delay reached. need to consume packet
[rtsp @ 0x20ce790] RTP: missed -65159 packets
[rtsp @ 0x20ce790] max delay reached. need to consume packet
[rtsp @ 0x20ce790] RTP: missed 130 packets
[rtsp @ 0x20ce790] jitter buffer full
[rtsp @ 0x20ce790] RTP: missed 54 packets
[rtsp @ 0x20ce790] max delay reached. need to consume packet
[rtsp @ 0x20ce790] RTP: missed 159 packets
Input #0, rtsp, from 'rtsp://frigate:xxx@xxx.xxx.xxx.xxx:554/cam/realmonitor?channel=1&subtype=0':
  Metadata:
    title           : Media Server
  Duration: N/A, start: 0.080000, bitrate: N/A
  Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 4000x3000 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 90k tbn

--- Detectors-Stream
# ffprobe "rtsp://frigate:xxx@xxx.xxx.xxx.xxx:554/cam/realmonitor?channel=1&subtype=2"
ffprobe version 5.0.1-Jellyfin Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-libs=-lfftw3f --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-shared --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-static --enable-gmp --enable-gnutls --enable-chromaprint --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --toolchain=hardened --enable-cross-compile --arch=armhf --cross-prefix=/usr/bin/arm-linux-gnueabihf-
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
[udp @ 0x24849b0] attempted to set receive buffer to size 393216 but it only ended up set as 360448
[udp @ 0x2494d00] attempted to set receive buffer to size 393216 but it only ended up set as 360448
Input #0, rtsp, from 'rtsp://frigate:xxx@xxx.xxx.xxx.xxx:554/cam/realmonitor?channel=1&subtype=2':
  Metadata:
    title           : Media Server
  Duration: N/A, start: 0.100000, bitrate: N/A
  Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1280x960 [SAR 1:1 DAR 4:3], 10 fps, 10 tbr, 90k tbn

Operating system

Other Linux

Install method

Docker Compose

Network connection

Wired

Camera brand and model

Dahua IPC-EBW81242-AS-S2 fisheye camera

Any other information that may be helpful

Platform: Raspberry Pi4 - 8 GB GPU-Memory: 512 MByte TPU: Google Coral Host-OS: Archlinux (armv7h) Kernel: 5.15.55-2-rpi-ARCH

Detector-Stream-Resolution: 1280x960 Record-Stream-Resolution: 4000x3000

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 28

Most upvoted comments

Haven’t had time to get out the Pi yet, today is super busy but might have time this evening otherwise tomorrow