blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
18.97k stars 1.73k forks source link

[Support]: HW Acceleration on NUC < 10th gen produces " Green Screens" #2167

Closed Tokn59 closed 2 years ago

Tokn59 commented 3 years ago

Describe the problem you are having

I added the HW accel options as described in the documentation for my NUC as follows:

image

But this turns the "screens" of my cameras "green" :

image

Version

0.9.1-800F33E

Frigate config file

mqtt:
  host: 192.168.1.163
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: els
  password: xxxxxxxxxxx
  stats_interval: 60
#--------------------------------------------------------------------------------------------------------  
cameras:
  Lounge:
    ffmpeg:
      inputs:
        - path: rtsp://admin:xxxxxxxxxx@192.168.1.122:554
          roles:
            - detect
            - rtmp
            - record
#      hwaccel_args:
#        - -hwaccel
#        - vaapi
#        - -hwaccel_device
#        - /dev/dri/renderD128
#        - -hwaccel_output_format
#        - yuv420p
    detect:
      width: 1280
      height: 720   
    record:
      enabled: False
      retain_days: 0
      events:
        retain:
          default: 10   
#--------------------------------------------------------------------------------------------------------  
  Parking:
    ffmpeg:
      inputs:
        - path: rtsp://admin:xxxxxxxxxx@192.168.1.200:554
          roles:
            - detect
            - rtmp
            - record
    detect:
      width: 1280
      height: 720  
    record:
      enabled: False
      retain_days: 3
      events:
        retain:
          default: 10
#--------------------------------------------------------------------------------------------------------  
detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu
#--------------------------------------------------------------------------------------------------------      
objects:
  # Optional: list of objects to track from labelmap.txt (default: shown below)
  track:
    - person
    - dog
    - cat
    - car
    - bicycle
#--------------------------------------------------------------------------------------------------------       
snapshots:
  # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
  # This value can be set via MQTT and will be updated in startup based on retained value
  enabled: True
  # Optional: print a timestamp on the snapshots (default: shown below)
  timestamp: True
  # Optional: draw bounding box on the snapshots (default: shown below)
  bounding_box: True
  # Optional: crop the snapshot (default: shown below)
  crop: False
  # Optional: Camera override for retention settings (default: global values)
  retain:
    # Required: Default retention days (default: shown below)
    default: 10
    # Optional: Per object retention days
    objects:
      person: 7
      dog: 3
      cat: 3
      car: 3
      bicycle: 3
#-----------------------------------------------------------------------------------------------------------------------    
ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p

Relevant log output

2021-11-02 08:04:26] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:26] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:26] frigate.video                  INFO    : Lounge: ffmpeg process is not running. exiting capture thread...
[2021-11-02 08:04:26] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:26] frigate.video                  INFO    : Parking: ffmpeg process is not running. exiting capture thread...
[2021-11-02 08:04:34] watchdog.Lounge                ERROR   : FFMPEG process crashed unexpectedly for Lounge.
[2021-11-02 08:04:34] watchdog.Lounge                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-11-02 08:04:34] watchdog.Lounge                ERROR   : You may have invalid args defined for this camera.
[2021-11-02 08:04:34] ffmpeg.Lounge.detect           ERROR   : Guessed Channel Layout for Input Stream #0.1 : mono
[2021-11-02 08:04:34] ffmpeg.Lounge.detect           ERROR   : [AVHWDeviceContext @ 0x55c327ac5500] No VA display found for device /dev/dri/renderD128.
[2021-11-02 08:04:34] ffmpeg.Lounge.detect           ERROR   : Device creation failed: -22.
[2021-11-02 08:04:34] ffmpeg.Lounge.detect           ERROR   : [h264 @ 0x55c327ac46c0] No device available for decoder: device type vaapi needed for codec h264.
[2021-11-02 08:04:34] ffmpeg.Lounge.detect           ERROR   : Device setup failed for decoder on input stream #0:0 : Invalid argument
[2021-11-02 08:04:34] watchdog.Parking               ERROR   : FFMPEG process crashed unexpectedly for Parking.
[2021-11-02 08:04:34] watchdog.Parking               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-11-02 08:04:34] watchdog.Parking               ERROR   : You may have invalid args defined for this camera.
[2021-11-02 08:04:34] ffmpeg.Parking.detect          ERROR   : [AVHWDeviceContext @ 0x55f2427417c0] No VA display found for device /dev/dri/renderD128.
[2021-11-02 08:04:34] ffmpeg.Parking.detect          ERROR   : Device creation failed: -22.
[2021-11-02 08:04:34] ffmpeg.Parking.detect          ERROR   : [h264 @ 0x55f2426bcac0] No device available for decoder: device type vaapi needed for codec h264.
[2021-11-02 08:04:34] ffmpeg.Parking.detect          ERROR   : Device setup failed for decoder on input stream #0:0 : Invalid argument
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Lounge: ffmpeg process is not running. exiting capture thread...
[2021-11-02 08:04:36] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:36] frigate.video                  INFO    : Parking: ffmpeg process is not running. exiting capture thread...
[2021-11-02 08:04:44] watchdog.Lounge                ERROR   : FFMPEG process crashed unexpectedly for Lounge.
[2021-11-02 08:04:44] watchdog.Lounge                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-11-02 08:04:44] watchdog.Lounge                ERROR   : You may have invalid args defined for this camera.
[2021-11-02 08:04:44] ffmpeg.Lounge.detect           ERROR   : Guessed Channel Layout for Input Stream #0.1 : mono
[2021-11-02 08:04:44] ffmpeg.Lounge.detect           ERROR   : [AVHWDeviceContext @ 0x55b85bef3880] No VA display found for device /dev/dri/renderD128.
[2021-11-02 08:04:44] ffmpeg.Lounge.detect           ERROR   : Device creation failed: -22.
[2021-11-02 08:04:44] ffmpeg.Lounge.detect           ERROR   : [h264 @ 0x55b85bed5300] No device available for decoder: device type vaapi needed for codec h264.
[2021-11-02 08:04:44] ffmpeg.Lounge.detect           ERROR   : Device setup failed for decoder on input stream #0:0 : Invalid argument
[2021-11-02 08:04:44] watchdog.Parking               ERROR   : FFMPEG process crashed unexpectedly for Parking.
[2021-11-02 08:04:44] watchdog.Parking               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-11-02 08:04:44] watchdog.Parking               ERROR   : You may have invalid args defined for this camera.
[2021-11-02 08:04:44] ffmpeg.Parking.detect          ERROR   : [AVHWDeviceContext @ 0x559cfe4888c0] No VA display found for device /dev/dri/renderD128.
[2021-11-02 08:04:44] ffmpeg.Parking.detect          ERROR   : Device creation failed: -22.
[2021-11-02 08:04:44] ffmpeg.Parking.detect          ERROR   : [h264 @ 0x559cfe4a5540] No device available for decoder: device type vaapi needed for codec h264.
[2021-11-02 08:04:44] ffmpeg.Parking.detect          ERROR   : Device setup failed for decoder on input stream #0:0 : Invalid argument
[2021-11-02 08:04:46] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:46] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:46] frigate.video                  INFO    : Lounge: ffmpeg process is not running. exiting capture thread...
[2021-11-02 08:04:46] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:46] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:46] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:46] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:46] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:46] frigate.video                  INFO    : Parking: ffmpeg process is not running. exiting capture thread...
[2021-11-02 08:04:54] watchdog.Lounge                ERROR   : FFMPEG process crashed unexpectedly for Lounge.
[2021-11-02 08:04:54] watchdog.Lounge                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-11-02 08:04:54] watchdog.Lounge                ERROR   : You may have invalid args defined for this camera.
[2021-11-02 08:04:54] ffmpeg.Lounge.detect           ERROR   : Guessed Channel Layout for Input Stream #0.1 : mono
[2021-11-02 08:04:54] ffmpeg.Lounge.detect           ERROR   : [AVHWDeviceContext @ 0x561866eb1c00] No VA display found for device /dev/dri/renderD128.
[2021-11-02 08:04:54] ffmpeg.Lounge.detect           ERROR   : Device creation failed: -22.
[2021-11-02 08:04:54] ffmpeg.Lounge.detect           ERROR   : [h264 @ 0x561866d711c0] No device available for decoder: device type vaapi needed for codec h264.
[2021-11-02 08:04:54] ffmpeg.Lounge.detect           ERROR   : Device setup failed for decoder on input stream #0:0 : Invalid argument
[2021-11-02 08:04:54] watchdog.Parking               ERROR   : FFMPEG process crashed unexpectedly for Parking.
[2021-11-02 08:04:54] watchdog.Parking               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-11-02 08:04:54] watchdog.Parking               ERROR   : You may have invalid args defined for this camera.
[2021-11-02 08:04:54] ffmpeg.Parking.detect          ERROR   : [AVHWDeviceContext @ 0x55cab2084e80] No VA display found for device /dev/dri/renderD128.
[2021-11-02 08:04:54] ffmpeg.Parking.detect          ERROR   : Device creation failed: -22.
[2021-11-02 08:04:54] ffmpeg.Parking.detect          ERROR   : [h264 @ 0x55cab2114280] No device available for decoder: device type vaapi needed for codec h264.
[2021-11-02 08:04:54] ffmpeg.Parking.detect          ERROR   : Device setup failed for decoder on input stream #0:0 : Invalid argument
[2021-11-02 08:04:56] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:56] frigate.video                  INFO    : Lounge: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:56] frigate.video                  INFO    : Lounge: ffmpeg process is not running. exiting capture thread...
[2021-11-02 08:04:57] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:57] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:57] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:57] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:57] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:57] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:57] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:57] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:57] frigate.video                  INFO    : Parking: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-02 08:04:57] frigate.video                  INFO    : Parking: ffmpeg process is not running. exiting capture thread...

FFprobe output from your camera

Not sure how to do this. Cameras are working when not using the HW accel entries in the config file

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

Hisseeu, Digoo

Any other information that may be helpful

No response

Multipage commented 3 years ago

I have a NUC 8, only use these lines and it works: hwaccel_args:

I don't use these lines:

Tokn59 commented 3 years ago

Thank you but that doesn't work for me either.

Multipage commented 3 years ago

Do you have the vaapi driver installed? I had to install it manually.

If you ffprobe your rtsp stream, what does it say.

Multipage commented 3 years ago

Just read you don't know how to ffprobe. It's easy. On a terminal just type: ffprobe rtsp://admin:xxxxxxxxxx@192.168.1.122:554

I doubt rtsp://admin:xxxxxxxxxx@192.168.1.122:554 is your full camera rtsp stream though

Tokn59 commented 2 years ago

Thank you but the ffprobe command does not seem to be available from the Terminal. I am using the latest builds of HASSOS on NUC. image

Multipage commented 2 years ago

Can you ffprobe outside of your docker ? I assume you are working on Linux? ffprobe is only to get us some information of your rtsp stream.

Tokn59 commented 2 years ago

Not sure I can .. I am runnig HASSOS on a NUC running Proxmox ...

Multipage commented 2 years ago

Sorry, i have 0 knowledge of Proxmox. I'm running a supervised installation of HA on Debian

Tokn59 commented 2 years ago

No worries, I will keep trying. Thanks for trying to help me out !!! Appreciated !

Any chance you know about this one ?

https://github.com/blakeblackshear/frigate/issues/2180

blakeblackshear commented 2 years ago

It's not finding your video device for some reason. You may want to try the full access addon and disable protection mode.

SunnyM-ha commented 2 years ago

FYI this just started happening to me yesterday. I updated to core-2021.11.1 so assumed that was the issue, but downgraded back to core-2021.10.6 and same green screens. Tried the full-access version and disabled protection mode but same green screens and ffmpeg errors, so went back to the regular. Commented out the hwaccel_args lines and it started working again. No idea why it just started - was working fine for a long time. Updated back to 2021.11.1 and still works fine (with the hwaccel_args lines commented out) so its definitely that.

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.