blakeblackshear / frigate

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

[HW Accel Support]: OPI5 FFMPEG hwaccel_args problems #9141

Closed seler69 closed 9 months ago

seler69 commented 10 months ago

Describe the problem you are having

Hello everyone! i get OPI5 (more powerfull than RPi) and i have installed HA Supervised succesfully. only one thing istnt working is hwacccel args line!

i have setp up HA Supervised on armbian + i added 3588 support sudo add-apt-repository ppa:liujianfeng1994/panfork-mesa sudo add-apt-repository ppa:liujianfeng1994/rockchip-multimedia sudo apt update sudo apt dist-upgrade sudo apt install mali-g610-firmware rockchip-multimedia-config

here is my dump of decoder/encoders ffmpeg -decoders | grep -i rkmpp V..... av1_rkmpp av1 (rkmpp) (codec av1) V..... h263_rkmpp h263 (rkmpp) (codec h263) V..... h264_rkmpp h264 (rkmpp) (codec h264) V..... hevc_rkmpp hevc (rkmpp) (codec hevc) V..... mpeg1_rkmpp mpeg1 (rkmpp) (codec mpeg1video) V..... mpeg2_rkmpp mpeg2 (rkmpp) (codec mpeg2video) V..... mpeg4_rkmpp mpeg4 (rkmpp) (codec mpeg4) V..... vp8_rkmpp vp8 (rkmpp) (codec vp8) V..... vp9_rkmpp vp9 (rkmpp) (codec vp9)

ffmpeg -encoders | grep -i omx V..... h264_omx OpenMAX IL H.264 video encoder (codec h264) V..... mpeg4_omx OpenMAX IL MPEG-4 video encoder (codec mpeg4)

i make also ubuntu+ ha supervised

`root@confirm:# ffmpeg -codecs | grep rkmpp ffmpeg version 6.0-5+git230804.e243e8d001j1 Copyright (c) 2000-2023 the FFmpeg developers built with gcc 11 (Ubuntu 11.4.0-1ubuntu122.04) configuration: --prefix=/usr --extra-version='5+git230804.e243e8d001j1' --toolchain=hardened --libdir=/us r/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-strippin g --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enab le-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig -- enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-li bpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --e nable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enab le-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --ena ble-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --e nable-openal --enable-opencl --enable-opengl --enable-version3 --enable-rkmpp --enable-sdl2 --disable-sndio --enable-pocketsphinx --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chro maprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-shared libavutil 58. 2.100 / 58. 2.100 libavcodec 60. 3.100 / 60. 3.100 libavformat 60. 3.100 / 60. 3.100 libavdevice 60. 1.100 / 60. 1.100 libavfilter 9. 3.100 / 9. 3.100 libswscale 7. 1.100 / 7. 1.100 libswresample 4. 10.100 / 4. 10.100 libpostproc 57. 1.100 / 57. 1.100 DEV.L. av1 Alliance for Open Media AV1 (decoders: av1_rkmpp_decoder libdav1d libaom-av1 av1 ) (encoders: libaom-av1 libsvtav1 ) DEV.L. h263 H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2 (decoders: h263_rkmpp _decoder h263 h263_v4l2m2m ) (encoders: h263 h263_v4l2m2m )

DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264_rkmpp_decoder h264 h2 64_v4l2m2m ) (encoders: h264_rkmpp_encoder libx264 libx264rgb h264_omx h264_v4l2m2m h264_vaapi )

DEV.L. hevc H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc_rkmpp_decoder hevc hevc_v4l2m2m ) (encoders: hevc_rkmpp_encoder libx265 hevc_v4l2m2m hevc_vaapi `

frigate.yml hwaccel_args: -hwaccel drm -hwaccel_device /dev/dri/renderD128 -c:v h264_rkmpp -vcodec h264_rkmpp i think there might be a problem

Version

2023.12.4

Frigate config file

mqtt:
  host: 192.168.1.25
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: homeassistant
  password: passwdd
  stats_interval: 60

cameras:

  loft:
    ffmpeg:
      hwaccel_args: -hwaccel drm -hwaccel_device /dev/dri/renderD128 -c:v h264_rkmpp -vcodec h264_rkmpp

      inputs:

        - path: rtsp://192.168.1.25:8554/camera.loft?video=copy&audio=aac
          roles:
            - detect
            - record
            - rtmp

      output_args:
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a copy
        rtmp: -c:v copy -c:a copy -f flv

    rtmp:
      enabled: true

    detect:
      width: 800
      height: 480

    objects:
      track:
        - person
      filters:
        person:
          threshold: 0.7

    snapshots:
      enabled: true
      timestamp: false
      bounding_box: true
      retain:
        default: 3

    record:
      enabled: true
      retain_days: 0
      events:
        retain:
          default: 3

    zones:
      loft_zone:
        coordinates: 800,480,800,163,243,225,237,480

    motion:
      mask: 0,0,653,0,693,153,0,187

docker-compose file or Docker CLI command

dont use docker

Relevant log output

2023-12-31 12:21:37.080646699  [INFO] Starting Frigate...
2023-12-31 12:21:41.275232749  [2023-12-31 13:21:41] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-12-31 12:21:41.343385750  [2023-12-31 13:21:41] frigate.config                 WARNING : The 'retain_days' config option has been DEPRECATED and will be removed in a future version. Please use the 'days' setting under 'retain'
2023-12-31 12:21:41.343691702  [2023-12-31 13:21:41] frigate.config                 WARNING : RTMP restream is deprecated in favor of the restream role, recommend disabling RTMP.
2023-12-31 12:21:41.349513547  [2023-12-31 13:21:41] frigate.app                    INFO    : Creating directory: /tmp/cache
2023-12-31 12:21:41.350874728  [2023-12-31 13:21:41] peewee_migrate                 INFO    : Starting migrations
2023-12-31 12:21:41.374124191  [2023-12-31 13:21:41] peewee_migrate                 INFO    : There is nothing to migrate
2023-12-31 12:21:41.392742077  [2023-12-31 13:21:41] detector.cpu                   INFO    : Starting detection process: 455
2023-12-31 12:21:41.574880558  [2023-12-31 13:21:41] frigate.app                    INFO    : Output process started: 456
2023-12-31 12:21:41.575260009  [2023-12-31 13:21:41] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-12-31 12:21:41.575563045  [2023-12-31 13:21:41] frigate.app                    INFO    : Camera processor started for loft: 459
2023-12-31 12:21:41.575832248  [2023-12-31 13:21:41] frigate.app                    INFO    : Capture process started for loft: 460
2023-12-31 12:21:42.687418103  [2023-12-31 13:21:42] frigate.video                  ERROR   : loft: Unable to read frames from ffmpeg process.
2023-12-31 12:21:42.687786762  [2023-12-31 13:21:42] frigate.video                  ERROR   : loft: ffmpeg process is not running. exiting capture thread...
2023-12-31 12:22:01.447502487  [2023-12-31 13:22:01] watchdog.loft                  ERROR   : Ffmpeg process crashed unexpectedly for loft.
2023-12-31 12:22:01.447537486  [2023-12-31 13:22:01] watchdog.loft                  ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-12-31 12:22:01.447573360  [2023-12-31 13:22:01] ffmpeg.loft.detect             ERROR   : Unknown decoder 'h264_rkmpp'
2023-12-31 12:22:01.729038390  [2023-12-31 13:22:01] frigate.video                  ERROR   : loft: Unable to read frames

FFprobe output from your camera

orangepi5:seler:# ffprobe 192.168.1.64
ffprobe version 6.0-5+git230804.e243e8d001~j1 Copyright (c) 2007-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
  configuration: --prefix=/usr --extra-version='5+git230804.e243e8d001~j1' --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-version3 --enable-rkmpp --enable-sdl2 --disable-sndio --enable-pocketsphinx --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-shared
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100

Operating system

Debian

Install method

HassOS Addon

Network connection

Wired

Camera make and model

Hikvision T5

Any other information that may be helpful

No response

NickM-27 commented 10 months ago

you can not use rkmpp in frigate 0.12, the ffmpeg build does not support it. OrangePi is supported in frigate 0.13 as part of a community supported build https://deploy-preview-6262--frigate-docs.netlify.app/configuration/hardware_acceleration#rockchip-platform

seler69 commented 10 months ago

you can not use rkmpp in frigate 0.12, the ffmpeg build does not support it. OrangePi is supported in frigate 0.13 as part of a community supported build https://deploy-preview-6262--frigate-docs.netlify.app/configuration/hardware_acceleration#rockchip-platform

@NickM-27 Thank You! sadly i need more help. i'm civil enginieer i started my journey with debian a few weeks ago and i have no knowledge with docker. its a nightmare!

i made Homeassistant supervised not a docker container. i dont know how to use Your information. any advise? btw right now i got 0.13 latest beta and Frigate integration 5.0.0 beta3 ( frigate cant even start....)

s6-rc: info: service fix-attrs: starting s6-rc: info: service s6rc-fdholder successfully started s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service log-prepare: starting s6-rc: info: service log-prepare successfully started s6-rc: info: service nginx-log: starting s6-rc: info: service go2rtc-log: starting s6-rc: info: service frigate-log: starting s6-rc: info: service go2rtc-log successfully started s6-rc: info: service go2rtc: starting s6-rc: info: service frigate-log successfully started s6-rc: info: service nginx-log successfully started s6-rc: info: service go2rtc successfully started s6-rc: info: service go2rtc-healthcheck: starting s6-rc: info: service frigate: starting s6-rc: info: service go2rtc-healthcheck successfully started s6-rc: info: service frigate successfully started s6-rc: info: service nginx: starting s6-rc: info: service nginx successfully started s6-rc: info: service legacy-services: starting 2023-12-31 13:37:55.440507596 [INFO] Preparing Frigate... 2023-12-31 13:37:55.442693012 [INFO] Starting NGINX... s6-rc: info: service legacy-services successfully started 2023-12-31 13:43:21.138677509 [INFO] Preparing Frigate... s6-rc: info: service legacy-services: starting 2023-12-31 13:43:21.147428609 [INFO] Starting NGINX... s6-rc: info: service legacy-services successfully started 2023-12-31 13:43:21.238867750 [INFO] Preparing new go2rtc config... 2023-12-31 13:43:21.245204744 [INFO] Starting Frigate... 2023-12-31 13:43:21.309522590 [INFO] Got IP address from supervisor: 192.168.1.25 2023-12-31 13:43:21.371523746 [INFO] Got WebRTC port from supervisor: 8556 2023-12-31 13:43:21.848429844 [INFO] Starting go2rtc... 2023-12-31 13:43:21.958733259 14:43:21.958 INF go2rtc version 1.8.4 linux/arm64 2023-12-31 13:43:21.959474962 14:43:21.959 INF [rtsp] listen addr=:8554 2023-12-31 13:43:21.959723460 14:43:21.959 INF [api] listen addr=:1984 2023-12-31 13:43:21.959747960 14:43:21.959 INF [webrtc] listen addr=:8555 2023-12-31 13:43:23.513672499 [2023-12-31 14:43:23] frigate.app INFO : Starting Frigate (0.13.0-c35c7da) 2023-12-31 13:43:23.513892706 [2023-12-31 14:43:23] frigate.app INFO : Creating directory: /tmp/cache 2023-12-31 13:43:23.525903155 2023-12-31 13:43:23.525908405 2023-12-31 13:43:23.525917739 Your config file is not valid! 2023-12-31 13:43:23.525942238 Please check the docs at 2023-12-31 13:43:23.525943405 https://docs.frigate.video/configuration/index 2023-12-31 13:43:23.525944572 2023-12-31 13:43:23.525945447 2023-12-31 13:43:23.525946613 Config Validation Errors 2023-12-31 13:43:23.525978988 * 2023-12-31 13:43:23.526051029 1 validation error for FrigateConfig 2023-12-31 13:43:23.526052196 cameras -> loft -> record -> retain_days 2023-12-31 13:43:23.526053071 extra fields not permitted (type=value_error.extra) 2023-12-31 13:43:23.527705933 Traceback (most recent call last): 2023-12-31 13:43:23.527707100 File "/opt/frigate/frigate/app.py", line 644, in start 2023-12-31 13:43:23.527707975 self.init_config() 2023-12-31 13:43:23.527708850 File "/opt/frigate/frigate/app.py", line 112, in init_config 2023-12-31 13:43:23.527709725 user_config = FrigateConfig.parse_file(config_file) 2023-12-31 13:43:23.527710891 File "/opt/frigate/frigate/config.py", line 1333, in parse_file 2023-12-31 13:43:23.527711766 return cls.parse_obj(config) 2023-12-31 13:43:23.527712933 File "/usr/local/lib/python3.9/dist-packages/pydantic/main.py", line 526, in parse_obj 2023-12-31 13:43:23.527715850 return cls(*obj) 2023-12-31 13:43:23.527717016 File "/usr/local/lib/python3.9/dist-packages/pydantic/main.py", line 341, in init 2023-12-31 13:43:23.527717891 raise validation_error 2023-12-31 13:43:23.527719058 pydantic.error_wrappers.ValidationError: 1 validation error for FrigateConfig 2023-12-31 13:43:23.527748224 cameras -> loft -> record -> retain_days 2023-12-31 13:43:23.527749391 extra fields not permitted (type=value_error.extra) 2023-12-31 13:43:23.527759016
2023-12-31 13:43:23.527760183
2023-12-31 13:43:23.527761349 End Config Validation Errors 2023-12-31 13:43:23.527762224 ***** 2023-12-31 13:43:25.202290741 [INFO] Service Frigate exited with code 1 (by signal 0) s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service nginx: stopping s6-rc: info: service go2rtc-healthcheck: stopping 2023-12-31 13:43:25.235571690 [INFO] The go2rtc-healthcheck service exited with code 256 (by signal 15) s6-rc: info: service go2rtc-healthcheck successfully stopped 2023-12-31 13:43:25.307970959 [INFO] Service NGINX exited with code 0 (by signal 0) s6-rc: info: service nginx successfully stopped s6-rc: info: service nginx-log: stopping and every services are stopping

NickM-27 commented 10 months ago

Retain_days is not valid. It should be

retain:
  days: 2
github-actions[bot] commented 9 months 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.