blakeblackshear / frigate

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

[HW Accel Support]: #6281

Closed Inzann closed 1 year ago

Inzann commented 1 year ago

Describe the problem you are having

Trying to set up hardware acceleration and have tried many different configurations and the different options/presets seen at https://docs.frigate.video/configuration/hardware_acceleration/ for this but can't get it to work. The streams work fine if I remove the "hwaccel_args: preset-vaapi" line but that also means it wont be using hardware acceleration if I understand the setup guide correctly.

Do I need to passthrough the iGPU to HAOS? Also I apologize in advance for my english and inexperience with these things.

Setup: Intel NUC 11 Pro 1145G7 (NUC11TNKv5). iGPU: Intel iris Xe Graphics HAOS installed on a Proxmox VM. Frigate (Full Access) add-on installed directly on HAOS with the "Protection mode" unchecked/disabled.

Version

0.12.0-DA3E197

Frigate config file

mqtt:
  host: redacted
  user: redacted
  password: redacted

go2rtc:
  streams:
    FRAMSIDA:
      - rtsp://redacted@192.168.50.203:554/h264Preview_01_main
    FRAMSIDA_sub:
      - rtsp://redacted@192.168.50.203:554/h264Preview_01_sub
environment_vars:
  LIBVA_DRIVER_NAME: i965
cameras:
  FRAMSIDA:
    ffmpeg:
      hwaccel_args: preset-vaapi
      inputs:
        - path: rtsp://127.0.0.1:8554/FRAMSIDA
          input_args: preset-rtsp-restream
          roles:
            - record
            - rtmp
        - path: rtsp://127.0.0.1:8554/FRAMSIDA_sub
          input_args: preset-rtsp-restream
          roles:
            - detect

docker-compose file or Docker CLI command

Not sure what this is or where to get it.

Relevant log output

2023-04-27 07:23:27.438771839  [INFO] Starting Frigate...
2023-04-27 07:23:28.126912231  [2023-04-27 09:23:28] frigate.app                    INFO    : Starting Frigate (0.12.0-da3e197)
2023-04-27 07:23:28.132068600  [2023-04-27 09:23:28] frigate.app                    INFO    : Creating directory: /tmp/cache
2023-04-27 07:23:28.132377259  [2023-04-27 09:23:28] peewee_migrate                 INFO    : Starting migrations
2023-04-27 07:23:28.134918886  [2023-04-27 09:23:28] peewee_migrate                 INFO    : There is nothing to migrate
2023-04-27 07:23:28.145365936  [2023-04-27 09:23:28] frigate.app                    INFO    : Output process started: 228
2023-04-27 07:23:28.156254142  [2023-04-27 09:23:28] frigate.app                    INFO    : Camera processor started for FRAMSIDA: 233
2023-04-27 07:23:28.156257510  [2023-04-27 09:23:28] frigate.app                    INFO    : Capture process started for FRAMSIDA: 234
2023-04-27 07:23:28.156261038  [2023-04-27 09:23:28] detector.cpu                   INFO    : Starting detection process: 227
2023-04-27 07:23:28.156262674  [2023-04-27 09:23:28] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-04-27 07:23:35.505042427  [2023-04-27 09:23:35] frigate.video                  ERROR   : FRAMSIDA: Unable to read frames from ffmpeg process.
2023-04-27 07:23:35.505046621  [2023-04-27 09:23:35] frigate.video                  ERROR   : FRAMSIDA: ffmpeg process is not running. exiting capture thread...
2023-04-27 07:23:48.185731000  [2023-04-27 09:23:48] watchdog.FRAMSIDA              ERROR   : Ffmpeg process crashed unexpectedly for FRAMSIDA.
2023-04-27 07:23:48.185734888  [2023-04-27 09:23:48] watchdog.FRAMSIDA              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-04-27 07:23:48.185736055  [2023-04-27 09:23:48] ffmpeg.FRAMSIDA.detect         ERROR   : [AVHWDeviceContext @ 0x55b32a13c2c0] No VA display found for device /dev/dri/renderD128.
2023-04-27 07:23:48.185737070  [2023-04-27 09:23:48] ffmpeg.FRAMSIDA.detect         ERROR   : Device creation failed: -22.
2023-04-27 07:23:48.185738143  [2023-04-27 09:23:48] ffmpeg.FRAMSIDA.detect         ERROR   : [h264 @ 0x55b32a137640] No device available for decoder: device type vaapi needed for codec h264.
2023-04-27 07:23:48.185742733  [2023-04-27 09:23:48] ffmpeg.FRAMSIDA.detect         ERROR   : Device setup failed for decoder on input stream #0:0 : Invalid argument
2023-04-27 07:23:55.525270063  [2023-04-27 09:23:55] frigate.video                  ERROR   : FRAMSIDA: Unable to read frames from ffmpeg process.
2023-04-27 07:23:55.525813819  [2023-04-27 09:23:55] frigate.video                  ERROR   : FRAMSIDA: ffmpeg process is not running. exiting capture thread...
2023-04-27 07:23:58.190467485  [2023-04-27 09:23:58] watchdog.FRAMSIDA              ERROR   : Ffmpeg process crashed unexpectedly for FRAMSIDA.
2023-04-27 07:23:58.190487091  [2023-04-27 09:23:58] watchdog.FRAMSIDA              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-04-27 07:23:58.192055221  [2023-04-27 09:23:58] ffmpeg.FRAMSIDA.detect         ERROR   : [AVHWDeviceContext @ 0x562a4ac8ed40] No VA display found for device /dev/dri/renderD128.
2023-04-27 07:23:58.192057770  [2023-04-27 09:23:58] ffmpeg.FRAMSIDA.detect         ERROR   : Device creation failed: -22.
2023-04-27 07:23:58.192058821  [2023-04-27 09:23:58] ffmpeg.FRAMSIDA.detect         ERROR   : [h264 @ 0x562a4aca3580] No device available for decoder: device type vaapi

FFprobe output from your camera

Stream 0:
Return Code: 0

Video:

Codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Resolution: 2560x1920
FPS: Unknown

Audio:

Codec: AAC (Advanced Audio Coding)

Stream 1:
Return Code: 0

Video:

Codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Resolution: 640x480
FPS: Unknown

Audio:

Codec: AAC (Advanced Audio Coding)

Operating system

HassOS

Install method

HassOS Addon

Network connection

Wired

Camera make and model

Reolink Video Doorbell WiFi

Any other information that may be helpful

The VAINFO button returns this.

VAINFO OUTPUT
Return Code: 3

Process Error:

error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.17.0
libva info: User environment variable requested driver 'i965'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_8
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

Probably not relevant but when I click on the system tab and try to access the go2rtc dahsboard I just get a 404: Not Found page.

NickM-27 commented 1 year ago

You have an 11th gen which doesn't support i965

Also, HA OS hasn't included the right driver until version 10 so you need to make sure you're on ha os 10

Inzann commented 1 year ago

Hi @NickM-27! I was running on HA OS 9.5 and upgraded to 10.1 now. I still seem to have the same issues though. Tried it without the following configs. (preset-vaapi and preset-intel-qsv-h264). Does me having 11th gen Intel NUC prevent hardware acceleration from working in my setup?

mqtt:
  host: redacted
  user: redacted
  password: redacted

go2rtc:
  streams:
    FRAMSIDA:
      - rtsp://redacted@192.168.50.203:554/h264Preview_01_main
    FRAMSIDA_sub:
      - rtsp://redacted@192.168.50.203:554/h264Preview_01_sub
detectors:
  cpu1:
    type: cpu
cameras:
  FRAMSIDA:
    ffmpeg:
      hwaccel_args: preset-vaapi
      inputs:
        - path: rtsp://127.0.0.1:8554/FRAMSIDA
          input_args: preset-rtsp-restream
          roles:
            - record
            - rtmp
        - path: rtsp://127.0.0.1:8554/FRAMSIDA_sub
          input_args: preset-rtsp-restream
          roles:
            - detect

FRIGATE LOGS preset-vaapi

2023-04-28 13:57:59.431873791  [INFO] Starting Frigate...
2023-04-28 13:58:00.196364495  [2023-04-28 15:58:00] frigate.app                    INFO    : Starting Frigate (0.12.0-da3e197)
2023-04-28 13:58:00.199965599  [2023-04-28 15:58:00] frigate.app                    INFO    : Creating directory: /tmp/cache
2023-04-28 13:58:00.201349577  [2023-04-28 15:58:00] peewee_migrate                 INFO    : Starting migrations
2023-04-28 13:58:00.204344781  [2023-04-28 15:58:00] peewee_migrate                 INFO    : There is nothing to migrate
2023-04-28 13:58:00.213904318  [2023-04-28 15:58:00] frigate.app                    INFO    : Output process started: 228
2023-04-28 13:58:00.228744089  [2023-04-28 15:58:00] detector.cpu1                  INFO    : Starting detection process: 227
2023-04-28 13:58:00.229169246  [2023-04-28 15:58:00] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-04-28 13:58:00.240667114  [2023-04-28 15:58:00] frigate.app                    INFO    : Camera processor started for FRAMSIDA: 231
2023-04-28 13:58:00.240670464  [2023-04-28 15:58:00] frigate.app                    INFO    : Capture process started for FRAMSIDA: 232
2023-04-28 13:58:04.931329124  [2023-04-28 15:58:04] frigate.video                  ERROR   : FRAMSIDA: Unable to read frames from ffmpeg process.
2023-04-28 13:58:04.932119143  [2023-04-28 15:58:04] frigate.video                  ERROR   : FRAMSIDA: ffmpeg process is not running. exiting capture thread...
2023-04-28 13:58:05.283856063  [2023-04-28 15:58:05] frigate.util                   ERROR   : Unable to poll intel GPU stats: No device filter specified and no discrete/integrated i915 devices found
2023-04-28 13:58:05.283860333  
2023-04-28 13:58:15.463662970  [2023-04-28 15:58:15] frigate.record                 ERROR   : Error occurred when attempting to maintain recording cache
2023-04-28 13:58:15.463867466  [2023-04-28 15:58:15] frigate.record                 ERROR   : list index out of range
2023-04-28 13:58:20.295191404  [2023-04-28 15:58:20] watchdog.FRAMSIDA              ERROR   : Ffmpeg process crashed unexpectedly for FRAMSIDA.
2023-04-28 13:58:20.295317301  [2023-04-28 15:58:20] watchdog.FRAMSIDA              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-04-28 13:58:20.295805373  [2023-04-28 15:58:20] ffmpeg.FRAMSIDA.detect         ERROR   : [AVHWDeviceContext @ 0x56409e60fd40] No VA display found for device /dev/dri/renderD128.
2023-04-28 13:58:20.295807251  [2023-04-28 15:58:20] ffmpeg.FRAMSIDA.detect         ERROR   : Device creation failed: -22.
2023-04-28 13:58:20.296049929  [2023-04-28 15:58:20] ffmpeg.FRAMSIDA.detect         ERROR   : [h264 @ 0x56409e627cc0] No device available for decoder: device type vaapi needed for codec h264.
2023-04-28 13:58:20.296051333  [2023-04-28 15:58:20] ffmpeg.FRAMSIDA.detect         ERROR   : Device setup failed for decoder on input stream #0:0 : Invalid argument
2023-04-28 13:58:20.400880513  [2023-04-28 15:58:20] frigate.record                 ERROR   : Error occurred when attempting to maintain recording cache
2023-04-28 13:58:20.401003358  [2023-04-28 15:58:20] frigate.record                 ERROR   : list index out of range
2023-04-28 13:58:24.933032198  [2023-04-28 15:58:24] frigate.video                  ERROR   : FRAMSIDA: Unable to read frames from ffmpeg process.
2023-04-28 13:58:24.933511185  [2023-04-28 15:58:24] frigate.video                  ERROR   : FRAMSIDA: ffmpeg process is not running. exiting capture thread...
2023-04-28 13:58:25.401170015  [2023-04-28 15:58:25] frigate.record                 ERROR   : Error occurred when attempting to maintain recording cache
2023-04-28 13:58:25.401289185  [2023-04-28 15:58:25] frigate.record                 ERROR   : list index out of range
2023-04-28 13:58:30.301462447  [2023-04-28 15:58:30] watchdog.FRAMSIDA              ERROR   : Ffmpeg process crashed unexpectedly for FRAMSIDA.
2023-04-28 13:58:30.301522924  [2023-04-28 15:58:30] watchdog.FRAMSIDA              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-04-28 13:58:30.301644297  [2023-04-28 15:58:30] ffmpeg.FRAMSIDA.detect         ERROR   : [AVHWDeviceContext @ 0x560269d85cc0] No VA display found for device /dev/dri/renderD128.
2023-04-28 13:58:30.301646100  [2023-04-28 15:58:30] ffmpeg.FRAMSIDA.detect         ERROR   : Device creation failed: -22.
2023-04-28 13:58:30.301647125  [2023-04-28 15:58:30] ffmpeg.FRAMSIDA.detect         ERROR   : [h264 @ 0x560269d98100] No device available for decoder: device type vaapi needed for codec h264.
2023-04-28 13:58:30.301663293  [2023-04-28 15:58:30] ffmpeg.FRAMSIDA.detect         ERROR   : Device setup failed for decoder on input stream #0:0 : Invalid argument
2023-04-28 13:58:30.401748107  [2023-04-28 15:58:30] frigate.record                 ERROR   : Error occurred when attempting to maintain recording cache
2023-04-28 13:58:30.401900649  [2023-04-28 15:58:30] frigate.record                 ERROR   : list index out of range

VAINFO LOG preset-vaapi

Return Code: 3

Process Error:

error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/simpledrm_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit
mqtt:
  host: redacted
  user: redacted
  password: redacted

go2rtc:
  streams:
    FRAMSIDA:
      - rtsp://redacted@192.168.50.203:554/h264Preview_01_main
    FRAMSIDA_sub:
      - rtsp://redacted@192.168.50.203:554/h264Preview_01_sub
detectors:
  cpu1:
    type: cpu
cameras:
  FRAMSIDA:
    ffmpeg:
      hwaccel_args: preset-intel-qsv-h264
      inputs:
        - path: rtsp://127.0.0.1:8554/FRAMSIDA
          input_args: preset-rtsp-restream
          roles:
            - record
            - rtmp
        - path: rtsp://127.0.0.1:8554/FRAMSIDA_sub
          input_args: preset-rtsp-restream
          roles:
            - detect

FRIGATE LOGS preset-intel-qsv-h264

2023-04-28 14:01:20.647023738  [INFO] Starting Frigate...
2023-04-28 14:01:21.387503273  [2023-04-28 16:01:21] frigate.app                    INFO    : Starting Frigate (0.12.0-da3e197)
2023-04-28 14:01:21.396820346  [2023-04-28 16:01:21] frigate.app                    INFO    : Creating directory: /tmp/cache
2023-04-28 14:01:21.397113205  [2023-04-28 16:01:21] peewee_migrate                 INFO    : Starting migrations
2023-04-28 14:01:21.399916159  [2023-04-28 16:01:21] peewee_migrate                 INFO    : There is nothing to migrate
2023-04-28 14:01:21.412522627  [2023-04-28 16:01:21] frigate.app                    INFO    : Output process started: 228
2023-04-28 14:01:21.419349945  [2023-04-28 16:01:21] frigate.app                    INFO    : Camera processor started for FRAMSIDA: 231
2023-04-28 14:01:21.420990422  [2023-04-28 16:01:21] frigate.app                    INFO    : Capture process started for FRAMSIDA: 232
2023-04-28 14:01:21.435005939  [2023-04-28 16:01:21] detector.cpu1                  INFO    : Starting detection process: 227
2023-04-28 14:01:21.435269497  [2023-04-28 16:01:21] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-04-28 14:01:21.451310140  [2023-04-28 16:01:21] frigate.video                  ERROR   : FRAMSIDA: Unable to read frames from ffmpeg process.
2023-04-28 14:01:21.451569000  [2023-04-28 16:01:21] frigate.video                  ERROR   : FRAMSIDA: ffmpeg process is not running. exiting capture thread...
2023-04-28 14:01:22.282383020  [2023-04-28 16:01:22] frigate.util                   ERROR   : Unable to poll intel GPU stats: No device filter specified and no discrete/integrated i915 devices found
2023-04-28 14:01:22.282385815  
2023-04-28 14:01:41.456946349  [2023-04-28 16:01:41] watchdog.FRAMSIDA              ERROR   : Ffmpeg process crashed unexpectedly for FRAMSIDA.
2023-04-28 14:01:41.457210345  [2023-04-28 16:01:41] watchdog.FRAMSIDA              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-04-28 14:01:41.457212492  [2023-04-28 16:01:41] ffmpeg.FRAMSIDA.detect         ERROR   : [AVHWDeviceContext @ 0x557fd0320540] No VA display found for device /dev/dri/renderD128.
2023-04-28 14:01:41.457215446  [2023-04-28 16:01:41] ffmpeg.FRAMSIDA.detect         ERROR   : Device creation failed: -22.
2023-04-28 14:01:41.457231016  [2023-04-28 16:01:41] ffmpeg.FRAMSIDA.detect         ERROR   : Failed to set value '/dev/dri/renderD128' for option 'qsv_device': Invalid argument
2023-04-28 14:01:41.457240813  [2023-04-28 16:01:41] ffmpeg.FRAMSIDA.detect         ERROR   : Error parsing global options: Invalid argument
2023-04-28 14:01:41.462458049  [2023-04-28 16:01:41] ffmpeg.FRAMSIDA.record_rtmp    ERROR   : [AVHWDeviceContext @ 0x55e4beb80600] No VA display found for device /dev/dri/renderD128.
2023-04-28 14:01:41.462691589  [2023-04-28 16:01:41] ffmpeg.FRAMSIDA.record_rtmp    ERROR   : Device creation failed: -22.
2023-04-28 14:01:41.462693264  [2023-04-28 16:01:41] ffmpeg.FRAMSIDA.record_rtmp    ERROR   : Failed to set value '/dev/dri/renderD128' for option 'qsv_device': Invalid argument
2023-04-28 14:01:41.462694168  [2023-04-28 16:01:41] ffmpeg.FRAMSIDA.record_rtmp    ERROR   : Error parsing global options: Invalid argument
2023-04-28 14:01:41.462694934  [2023-04-28 16:01:41] watchdog.FRAMSIDA              INFO    : Terminating the existing ffmpeg process...
2023-04-28 14:01:41.462911426  [2023-04-28 16:01:41] watchdog.FRAMSIDA              INFO    : Waiting for ffmpeg to exit gracefully...
2023-04-28 14:01:41.466265774  [2023-04-28 16:01:41] frigate.video                  ERROR   : FRAMSIDA: Unable to read frames from ffmpeg process.
2023-04-28 14:01:41.466391683  [2023-04-28 16:01:41] frigate.video                  ERROR   : FRAMSIDA: ffmpeg process is not running. exiting capture thread...
2023-04-28 14:01:51.468579144  [2023-04-28 16:01:51] watchdog.FRAMSIDA              ERROR   : Ffmpeg process crashed unexpectedly for FRAMSIDA.
2023-04-28 14:01:51.470732202  [2023-04-28 16:01:51] watchdog.FRAMSIDA              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-04-28 14:01:51.470735251  [2023-04-28 16:01:51] ffmpeg.FRAMSIDA.detect         ERROR   : [AVHWDeviceContext @ 0x55aef9887540] No VA display found for device /dev/dri/renderD128.
2023-04-28 14:01:51.470750608  [2023-04-28 16:01:51] ffmpeg.FRAMSIDA.detect         ERROR   : Device creation failed: -22.
2023-04-28 14:01:51.470782979  [2023-04-28 16:01:51] ffmpeg.FRAMSIDA.detect         ERROR   : Failed to set value '/dev/dri/renderD128' for option 'qsv_device': Invalid argument
2023-04-28 14:01:51.471105381  [2023-04-28 16:01:51] ffmpeg.FRAMSIDA.detect         ERROR   : Error parsing global options: Invalid argument
2023-04-28 14:01:51.476367671  [2023-04-28 16:01:51] ffmpeg.FRAMSIDA.record_rtmp    ERROR   : [AVHWDeviceContext @ 0x564045766600] No VA display found for device /dev/dri/renderD128.
2023-04-28 14:01:51.476496243  [2023-04-28 16:01:51] ffmpeg.FRAMSIDA.record_rtmp    ERROR   : Device creation failed: -22.
2023-04-28 14:01:51.476589691  [2023-04-28 16:01:51] ffmpeg.FRAMSIDA.record_rtmp    ERROR   : Failed to set value '/dev/dri/renderD128' for option 'qsv_device': Invalid argument
2023-04-28 14:01:51.476680533  [2023-04-28 16:01:51] ffmpeg.FRAMSIDA.record_rtmp    ERROR   : Error parsing global options: Invalid argument
2023-04-28 14:01:51.476681607  [2023-04-28 16:01:51] watchdog.FRAMSIDA              INFO    : Terminating the existing ffmpeg process...
2023-04-28 14:01:51.476749183  [2023-04-28 16:01:51] watchdog.FRAMSIDA              INFO    : Waiting for ffmpeg to exit gracefully...
2023-04-28 14:01:51.477752313  [2023-04-28 16:01:51] frigate.video                  ERROR   : FRAMSIDA: Unable to read frames from ffmpeg process.
2023-04-28 14:01:51.478060955  [2023-04-28 16:01:51] frigate.video                  ERROR   : FRAMSIDA: ffmpeg process is not running. exiting capture thread...

VAINFO LOG preset-intel-qsv-h264

Return Code: 3

Process Error:

error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/simpledrm_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit
NickM-27 commented 1 year ago

You need to provide logs for each of these attempts

Inzann commented 1 year ago

I updated my above post with logs etc. Let me know if you need something else as well.

NickM-27 commented 1 year ago

Weird... maybe try explicitly setting the driver to iHD and see what vainfo says

environment_vars:
  LIBVA_DRIVER_NAME: iHD
Inzann commented 1 year ago

Hi,

I tried it again with the specified enviroment_vars. Any ideas?

Config preset-vaapi

mqtt:
  host: redacted
  user: redacted
  password: redacted
environment_vars:
  LIBVA_DRIVER_NAME: iHD
go2rtc:
  streams:
    FRAMSIDA:
      - rtsp://redacted@192.168.50.200:554/h264Preview_01_main
    FRAMSIDA_sub:
      - rtsp://redacted@192.168.50.200:554/h264Preview_01_sub
detectors:
  cpu1:
    type: cpu
cameras:
  FRAMSIDA:
    ffmpeg:
      hwaccel_args: preset-vaapi
      inputs:
        - path: rtsp://127.0.0.1:8554/FRAMSIDA
          input_args: preset-rtsp-restream
          roles:
            - record
            - rtmp
        - path: rtsp://127.0.0.1:8554/FRAMSIDA_sub
          input_args: preset-rtsp-restream
          roles:
            - detect

    detect:
      enabled: true
      width: 640
      height: 480
    objects:
      track:
        - person
        - car

VAINFO OUTPUT preset-vaapi

Return Code: 3

Process Error:

error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.17.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 18
vaInitialize failed with error code 18 (invalid parameter),exit

Config preset-vaapi

mqtt:
  host: redacted
  user: redacted
  password: redacted
environment_vars:
  LIBVA_DRIVER_NAME: iHD
go2rtc:
  streams:
    FRAMSIDA:
      - rtsp://redacted@192.168.50.200:554/h264Preview_01_main
    FRAMSIDA_sub:
      - rtsp://redacted@192.168.50.200:554/h264Preview_01_sub
detectors:
  cpu1:
    type: cpu
cameras:
  FRAMSIDA:
    ffmpeg:
      hwaccel_args: preset-intel-qsv-h264
      inputs:
        - path: rtsp://127.0.0.1:8554/FRAMSIDA
          input_args: preset-rtsp-restream
          roles:
            - record
            - rtmp
        - path: rtsp://127.0.0.1:8554/FRAMSIDA_sub
          input_args: preset-rtsp-restream
          roles:
            - detect

    detect:
      enabled: true
      width: 640
      height: 480
    objects:
      track:
        - person
        - car

VAINFO OUTPUT preset-intel-qsv-h264

Return Code: 3

Process Error:

error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.17.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 18
vaInitialize failed with error code 18 (invalid parameter),exit
NickM-27 commented 1 year ago

Just so you know, it doesn't matter what preset you have, vainfo is the same. And yeah it seems the driver inside HA OS isn't working with your hardware for some reason. There's not much we can really do on the frigate side other than suggest that you run frigate outside HA OS where you can control the driver that is installed

Inzann commented 1 year ago

Thanks for trying. Is there any disadvantage to running Frigate outside of HAOS? I suppose the integration will work all the same? It looked a bit more complicated to setup and I'm not very experienced. I understand that I will need to run it inside docker/lxc (don't really know the difference) on my proxmox machine.

NickM-27 commented 1 year ago

There are only advantages as far as support and flexibility go.