Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to fall back to CPU when timelapse encode fails #9106

Open
ehn opened this issue Dec 28, 2023 · 17 comments
Open

Add option to fall back to CPU when timelapse encode fails #9106

ehn opened this issue Dec 28, 2023 · 17 comments
Labels
enhancement New feature or request pinned

Comments

@ehn
Copy link
Sponsor

ehn commented Dec 28, 2023

Describe the problem you are having

I'm trying to export a timelapse from 0:00:00 to 12:00:00, but it doesn't work.

Version

0.13.0-C35C7DA

Frigate config file

mqtt:
  enabled: True
  host: 192.168.1.1
  user: homeassistant
  password: redacted

detectors:
  coral0:
    type: edgetpu
    device: "pci:0"
  coral1:
    type: edgetpu
    device: "pci:1"
  coral2:
    type: edgetpu
    device: "pci:2"
  coral3:
    type: edgetpu
    device: "pci:3"
  coral4:
    type: edgetpu
    device: "pci:4"
  coral5:
    type: edgetpu
    device: "pci:5"
  coral6:
    type: edgetpu
    device: "pci:6"
  coral7:
    type: edgetpu
    device: "pci:7"

birdseye:
  enabled: True
  mode: continuous

# More information about presets at https://docs.frigate.video/configuration/ffmpeg_presets
ffmpeg:
  hwaccel_args: preset-nvidia-h264

model:
  path: plus://redacted

objects:
  track:
    - person
    - face
    - car
    - license_plate
    - dog
    - cat
    - deer
    - ups
    - fedex
    - amazon
    - package
  filters:
    deer:
      min_score: .7
      threshold: .9
    dog:
      min_score: .7
      threshold: .9
    cat:
      min_score: .65
      threshold: .8
    face:
      min_score: .7
    package:
      min_score: .65
      threshold: .9
    license_plate:
      min_score: .6
    amazon:
      min_score: .75
    ups:
      min_score: .75
    fedex:
      min_score: .75
    person:
      min_score: .65
      threshold: .85
    car:
      min_score: .65
      threshold: .85

record:
  enabled: True
  # Optional: Retention settings for recording
  retain:
    days: 14
    mode: all
  events:
    retain:
      default: 60
      mode: active_objects

snapshots:
  enabled: True
  clean_copy: True
  timestamp: True
  bounding_box: True
  retain:
    default: 60

go2rtc:
  streams:
    camera_1:
      - rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.6.2:554/profile4/media.smp
    camera_1_sub:
      - rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.6.2:554/profile5/media.smp
  webrtc:
    candidates:
      - 192.168.1.1:8555
      - stun:8555

cameras:
  camera_1:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/camera_1
          input_args: preset-rtsp-restream
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/camera_1_sub
          input_args: preset-rtsp-restream
          roles:
            - detect
    detect:
      width: 1280
      height: 960

ui:
  # Optional: Set the default live mode for cameras in the UI (default: mse)
  live_mode: webrtc
  # Optional: Set a timezone to use in the UI (default: use browser local time)
  timezone: Europe/Stockholm
  # Optional: Use an experimental recordings / camera view UI (default: shown below)
  # experimental_ui: False
  # Optional: Set the time format used.
  # Options are browser, 12hour, or 24hour (default: shown below)
  # time_format: browser
  # Optional: Set the date style for a specified length.
  # Options are: full, long, medium, short
  # Examples:
  #    short: 2/11/23
  #    medium: Feb 11, 2023
  #    full: Saturday, February 11, 2023
  # (default: shown below).
  # date_style: short
  # Optional: Set the time style for a specified length.
  # Options are: full, long, medium, short
  # Examples:
  #    short: 8:14 PM
  #    medium: 8:15:22 PM
  #    full: 8:15:22 PM Mountain Standard Time
  # (default: shown below).
  # time_style: medium
  # Optional: Ability to manually override the date / time styling to use strftime format
  # https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html
  # possible values are shown above (default: not set)
  strftime_fmt: "%Y-%m-%d %H:%M:%S"

# Optional: Telemetry configuration
telemetry:
  # Optional: Enable the latest version outbound check (default: shown below)
  # NOTE: If you use the HomeAssistant integration, disabling this will prevent it from reporting new versions
  version_check: True

Relevant log output

2023-12-28 08:33:37.846400912  [2023-12-28 08:33:37] frigate.record.export          ERROR   : Failed to export recording for command ffmpeg -hide_banner -hwaccel cuda -hwaccel_output_format cuda -extra_hw_frames 8 -an -skip_frame nokey -y -protocol_whitelist pipe,file,http,tcp -f concat -safe 0 -i /dev/stdin -c:v h264_nvenc -vf setpts=0.04*PTS -r 30 /media/frigate/exports/in_progress.camera_1@2023_12_26_23_00__2023_12_27_11_00.mp4
2023-12-28 08:33:37.846547409  [2023-12-28 08:33:37] frigate.record.export          ERROR   : [hls @ 0x55ae8e879200] Skip ('#EXT-X-ALLOW-CACHE:YES')
2023-12-28 08:33:37.846549143  [hls @ 0x55ae8e879200] Skip ('#EXT-X-VERSION:3')
2023-12-28 08:33:37.846551048  [hls @ 0x55ae8e879200] Opening 'http://127.0.0.1:5000/vod/camera_1/start/1703631593.0/end/1703641593.001016/seg-1-v1.ts' for reading
2023-12-28 08:33:37.846552845  [hls @ 0x55ae8e879200] Opening 'http://127.0.0.1:5000/vod/camera_1/start/1703631593.0/end/1703641593.001016/seg-2-v1.ts' for reading
2023-12-28 08:33:37.846554202  Input #0, concat, from '/dev/stdin':
2023-12-28 08:33:37.846555594    Duration: N/A, start: 0.000000, bitrate: N/A
2023-12-28 08:33:37.846557302    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuvj420p(pc, bt709), 2592x1944 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 90k tbn
2023-12-28 08:33:37.846558485      Metadata:
2023-12-28 08:33:37.846559737        variant_bitrate : 0
2023-12-28 08:33:37.846561026    Stream #0:1: Data: timed_id3 (ID3  / 0x20334449)
2023-12-28 08:33:37.846562169      Metadata:
2023-12-28 08:33:37.846563365        variant_bitrate : 0
2023-12-28 08:33:37.846564467  Stream mapping:
2023-12-28 08:33:37.846565829    Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
2023-12-28 08:33:37.846567462  [h264 @ 0x55ae8f4d7e80] decoder->cvdl->cuvidCreateDecoder(&decoder->decoder, params) failed -> CUDA_ERROR_INVALID_VALUE: invalid argument
2023-12-28 08:33:37.846568915  [h264 @ 0x55ae8f4d7e80] Using more than 32 (35) decode surfaces might cause nvdec to fail.
2023-12-28 08:33:37.846570317  [h264 @ 0x55ae8f4d7e80] Try lowering the amount of threads. Using 16 right now.
2023-12-28 08:33:37.846571816  [h264 @ 0x55ae8f4d7e80] Failed setup for format cuda: hwaccel initialisation returned error.
2023-12-28 08:33:37.846573410  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91eb1b80] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846575007  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91f0ef00] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846576589  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91f69fc0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846578165  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91fc6ec0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846579707  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92021f80] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846581274  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9207d000] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846582866  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae920d8080] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846584413  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92133100] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846586010  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9218e180] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846587546  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae921e9200] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846589115  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92244280] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846590674  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9229f300] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846592187  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae922fa380] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846593734  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92355400] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846595287  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae923b0480] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846596811  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9240b500] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846598826  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92466580] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846600344  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae924c1600] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846601911  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9251c680] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846603453  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92577700] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846604976  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae925d2780] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846606519  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91eb1a80] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846608031  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91fc59c0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846609538  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae922ad680] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846611079  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9207dd00] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846612596  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92308ec0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846614126  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae920218c0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846615669  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91f1ae00] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846617193  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91f77d00] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846618727  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae920dbbc0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846620240  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92136c40] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846621759  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9218f340] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846623305  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae921ec240] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846624823  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92244980] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846626350  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92356180] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846627893  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae923b30c0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846629407  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9240e180] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846630949  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92469200] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846632493  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae924c4280] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846634026  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9251f300] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846635589  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9257a380] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846637208  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae925d5400] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846638843  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae925f1880] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846640380  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91fa21c0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846641924  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae922efcc0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846643471  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9229f1c0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846644992  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9206fd00] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846646505  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92356180] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846648047  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae920138c0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846649572  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae921ea300] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846651115  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92245380] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846652662  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91f0db40] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846654139  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91f68c00] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846655721  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9251fc40] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846657242  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9257cb40] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846681882  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae925d7c00] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846683481  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae920e0840] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846685040  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9213b900] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846686570  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92196980] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846688098  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae923b8580] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846689653  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92413640] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846691179  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9246e6c0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846692734  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae924c9740] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846694280  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae925f1880] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846695801  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91ec7140] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846697353  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae922d9240] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846698875  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92287f40] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846700391  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9205a500] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846701931  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92340980] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846703449  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91ffe0c0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846705010  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91ef59c0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846706552  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae91f50a40] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846708079  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae921eb0c0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846709627  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92246180] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846711140  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92521e40] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846712650  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9257cf00] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846714199  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae925d7f80] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846715717  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae920e0840] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846717257  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9213b900] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846718801  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92196980] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846720318  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae923b8580] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846721858  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae92413640] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846723373  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae9246e6c0] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846724887  [swscaler @ 0x55ae91ea2b00] [swscaler @ 0x55ae924c9740] deprecated pixel format used, make sure you did set range correctly
2023-12-28 08:33:37.846726184  [h264_nvenc @ 0x55ae8e9080c0] Cannot load libnvidia-encode.so.1
2023-12-28 08:33:37.846727660  [h264_nvenc @ 0x55ae8e9080c0] The minimum required Nvidia driver for nvenc is 470.57.02 or newer
2023-12-28 08:33:37.846729375  Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
2023-12-28 08:33:37.846730515  Conversion failed!

FFprobe output from your camera

ffprobe version n5.1-2-g915ef932a3-20220731 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
  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
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, rtsp, from 'rtsp://admin:redacted@10.1.6.2:554/profile4/media.smp':
  Metadata:
    title           : Media Presentation
    comment         : samsung
  Duration: N/A, start: -0.128000, bitrate: N/A
  Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 2592x1944 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 90k tbn
  Stream #0:1: Data: none
Unsupported codec with id 0 for input stream 1

Frigate stats

No response

Operating system

Other Linux

Install method

Docker Compose

Coral version

PCIe

Network connection

Wired

Camera make and model

Hanwha QNV-8080R

Any other information that may be helpful

No response

@NickM-27 NickM-27 added the beta Related to the current beta version of frigate label Dec 28, 2023
@NickM-27
Copy link
Sponsor Collaborator

looks like there are too many decode processes running so the GPU is refusing to run another Using more than 32 (35) decode surfaces might cause nvdec to fail.

@ehn
Copy link
Sponsor Author

ehn commented Dec 28, 2023

Is there anything I can do about it? I have 24 cameras connected to Frigate in this setup. (Only included the one I'm trying to export from in the config.)

@NickM-27
Copy link
Sponsor Collaborator

I believe there are some driver patches that remove limitations like these https://github.com/keylase/nvidia-patch

Copy link

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.

@github-actions github-actions bot added the stale label Jan 28, 2024
@ehn
Copy link
Sponsor Author

ehn commented Jan 28, 2024

Not stale. However, the question is, should this be considered an issue of Frigate's or Nvidia's drivers'? I haven't been able to test the patch suggested by @NickM-27 and won't until I'm back on site in July. I don't want to live-patch hardware drivers while on another continent in case something breaks and the machine won't come back online.

Ideally, it would be possible to do a timelapse export without hardware acceleration if it isn't available.

@NickM-27
Copy link
Sponsor Collaborator

If you remove the global hwaccel args and apply to each camera then software will be used.

I don't think it's necessarily straightforward what the proper solution is when ffmpeg fails while using hwaccel. Some users may prefer it use software while others may prefer it put an error in the logs and not increase cpu usage.

@ehn
Copy link
Sponsor Author

ehn commented Jan 28, 2024

Yeah, fair.

Related, why would 32 decode processes be running for 24 cameras? (Nothing besides Frigate is using the GPU in this machine AFAIK.)

The graphics card in this machine is a PNY NVIDIA RTX A2000, which isn't exactly a consumer device, but perhaps the drivers are limited anyway.

@github-actions github-actions bot removed the stale label Jan 29, 2024
Copy link

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.

@github-actions github-actions bot added the stale label Feb 29, 2024
@ehn
Copy link
Sponsor Author

ehn commented Feb 29, 2024

Not stale.

@ehn
Copy link
Sponsor Author

ehn commented Feb 29, 2024

If you remove the global hwaccel args and apply to each camera then software will be used.

But then hardware acceleration would never be used, right? I guess one would want it to be used if available with a fallback to software when unavailable?

@ehn
Copy link
Sponsor Author

ehn commented Feb 29, 2024

Related, why would 32 decode processes be running for 24 cameras? (Nothing besides Frigate is using the GPU in this machine AFAIK.)

Thinking about this some more, that may be because there are also substreams to decode. (But then there should already have been more than 32 decode processes and I would have expected some of them to fail, which I haven't seen. 🤔)

@blakeblackshear
Copy link
Owner

Not sure why you are hitting the 32 limit, but you will still have hwaccel if you move it down and define it for each camera instead of globally. Removing it globally will just prevent it from being used for timelapse exports.

@ehn
Copy link
Sponsor Author

ehn commented Feb 29, 2024

Not sure why you are hitting the 32 limit, but you will still have hwaccel if you move it down and define it for each camera instead of globally. Removing it globally will just prevent it from being used for timelapse exports.

Yeah, that makes sense. But if it is available, it would be nice to use it. Is there any way to make the choice dynamic?

@NickM-27
Copy link
Sponsor Collaborator

we could have some sort of config option that enables trying to use cpu when gpu fails, would probably need to be optional because using a CPU for that could cause issues for users

@github-actions github-actions bot removed the stale label Mar 1, 2024
@ehn
Copy link
Sponsor Author

ehn commented Mar 1, 2024

Would the problem of falling back on the CPU be worse than not working at all?

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Mar 1, 2024

Well it depends, if a user doesn't have an adequate CPU for that type of load then it could do the export at the expense of causing issues for other services. So I think an option would be good

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Mar 1, 2024

It's also possible that the new preview video (low res low fps) feature coming in 0.14 will suffice and timelapse reendodes will not need to be done as often

@NickM-27 NickM-27 changed the title [Support]: Timelapse export fails Add option to fall back to CPU when timelapse encode fails Mar 1, 2024
@NickM-27 NickM-27 added enhancement New feature or request pinned and removed support triage beta Related to the current beta version of frigate labels Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned
Projects
None yet
Development

No branches or pull requests

3 participants