Tdarr icon indicating copy to clipboard operation
Tdarr copied to clipboard

FFMPEG QSV error on Intel ARC

Open bmcginnis5613 opened this issue 1 year ago • 3 comments

Hello, thank you for adding Intel Arc support! I have a bug though. I can't get it to work with QSV. The VAAPI docker command from here works fine: https://docs.tdarr.io/docs/installation/docker/hardware-transcoding

image

Plex is also working fine and transcoding with the GPU.

I ran:

docker run \
    --device=/dev/dri:/dev/dri \
    ghcr.io/haveagitgat/tdarr_node:latest \
    /bin/bash -e \
    -c 'ffmpeg \
            -hwaccel qsv -f lavfi -i color=c=black:s=256x256:d=1:r=30 \
            -c:v:0 hevc_qsv \
            -f null /dev/null'

And get:

Stream mapping:
  Stream #0:0 -> #0:0 (wrapped_avframe (native) -> hevc (hevc_qsv))
Press [q] to stop, [?] for help
[hevc_qsv @ 0x55fe6b389080] Selected ratecontrol mode is unsupported
[hevc_qsv @ 0x55fe6b389080] Low power mode is unsupported
[hevc_qsv @ 0x55fe6b389080] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
[vost#0:0/hevc_qsv @ 0x55fe6b388d80] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

FFMPEG Test image

I also tried with the plugin: Boosh-Transcode Using QSV GPU & FFMPEG and get the same:

image

I've Googled and troubleshooted for hours. Any ideas? Thank you!

Docker compose:

version: "3.4"
services:
  tdarr:
    image: haveagitgat/tdarr:2.22.01
    restart: unless-stopped
    container_name: tdarr
    privileged: true
    ports:
      - 8265:8265
      - 8266:8266
    environment:
      - REDACTED_TIMEZONE/REDACTED_TIMEZONE
      - PUID=1000
      - PGID=1000
      - UMASK_SET=002
      - serverIP=0.0.0.0
      - serverPort=8266
      - webUIPort=8265
      - internalNode=true
      - inContainer=true
      - nodeName=NAS
    volumes:
      - /home/REDACTED/tdarr/server:/app/server
      - /home/REDACTED/tdarr/configs:/app/configs
      - /home/REDACTED/tdarr/logs:/app/logs
      - /mnt/storage/plex/movies:/media/Movies
      - /mnt/storage/plex/tv:/media/TV
      - /tmp/tdarr_cache:/temp
    devices:
      - /dev/dri:/dev/dri

bmcginnis5613 avatar Jun 29 '24 23:06 bmcginnis5613

Not sure of the cause of that error as I don't have an ARC but just to confirm working fine with UHD620:

docker run \
>     --device=/dev/dri:/dev/dri \
>     ghcr.io/haveagitgat/tdarr_node:latest \
>     /bin/bash -e \
>     -c 'ffmpeg \
>             -hwaccel qsv -f lavfi -i color=c=black:s=256x256:d=1:r=30 \
>             -c:v:0 hevc_qsv \
>             -f null /dev/null'
[migrations] started
[migrations] no migrations found

User uid:    1000
User gid:    1000
-------------------------------------

chown: First run and CHOWN_ON_START != false, chowning /app, ffmpeg and ffprobe, this may take some time
───────────────────────────────────────
  _____ __ __ _____ _____ _____ _____ 
 |     |  |  |   __|_   _|     |     |
 |   --|  |  |__   | | | |  |  | | | |
 |_____|_____|_____| |_| |_____|_|_|_|
       _____ __ __ _ __    ____  
      | __  |  |  | |  |  |    \ 
      | __ -|  |  | |  |__|  |  |
      |_____|_____|_|_____|____/ 

  Based on images from linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

chmod: cannot access '/app/Tdarr_Node/assets/app/fileScanner/': No such file or directory
chmod: cannot access '/app/Tdarr_Server/node_modules/@ffprobe-installer/linux-x64/ffprobe': No such file or directory
[custom-init] No custom files found, skipping...
[ls.io-init] done.
Starting Tdarr_Node
ffmpeg version 6.0-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --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 --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  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
WARNING: defaulting hwaccel_output_format to qsv for compatibility with old commandlines. This behaviour is DEPRECATED and will be removed in the future. Please explicitly set "-hwaccel_output_format qsv".
Input #0, lavfi, from 'color=c=black:s=256x256:d=1:r=30':
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: wrapped_avframe, yuv420p, 256x256 [SAR 1:1 DAR 1:1], 30 fps, 30 tbr, 30 tbn
libva info: VA-API version 1.18.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva info: va_openDriver() returns 0
libva info: VA-API version 1.18.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva info: va_openDriver() returns 0
Stream mapping:
  Stream #0:0 -> #0:0 (wrapped_avframe (native) -> hevc (hevc_qsv))
Press [q] to stop, [?] for help
Output #0, null, to '/dev/null':
  Metadata:
    encoder         : Lavf60.3.100
  Stream #0:0: Video: hevc, nv12(tv, progressive), 256x256 [SAR 1:1 DAR 1:1], q=2-31, 1000 kb/s, 30 fps, 30 tbn
    Metadata:
      encoder         : Lavc60.3.100 hevc_qsv
    Side data:
      cpb: bitrate max/min/avg: 0/0/1000000 buffer size: 0 vbv_delay: N/A
frame=   30 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.86 bitrate=N/A speed= 6.6x    ts/s speed=N/A

HaveAGitGat avatar Jul 02 '24 09:07 HaveAGitGat

Have you checked the host has GUC/HUC enabled like intel describes? Without that it cant do advanced controls of the decoder the errors you could be related to this, or the VPL libraries are still not correctly imported in the container. As these controls you are behind the intel VPL. See their own github pages. I haven't tested the new container my yet, dont want to pull down my server just for testing. As i dropped linux for windows as it gives more control over the GPU with the ARC control center for fan speeds and slight overclocking etc.. And they perform just better on windows :) Can test it next week when my new arc gpu arrives if wanted.

dennix85 avatar Jul 02 '24 16:07 dennix85

Hy, I have the same problem as OP above. Just for fun I downloaded the jellyfin ffmpeg and set up a second node on my ubuntu as baremetal. Same error and an Intel Arc card was about to fly.

After what felt like 2 weeks of googling I finally looked at the jellyfin documentation again and found this.

https://jellyfin.org/docs/general/administration/hardware-acceleration/intel/#configure-and-verify-lp-mode-on-linux

And lo and behold, now it works.

fampla avatar Aug 07 '24 10:08 fampla

This is resolved. Follow the jellyfin docs @Slevin7 linked. GuC/HuC was not loading.

Pull firmware directly from Linux repo and updated initramfs and grub. Rebooted. GuC/HuC loading now.

https://www.reddit.com/r/debian/comments/1ah5kev/i_cant_get_guchuc_loaded_for_intel_arc_on/

Thanks!

bmcginnis5613 avatar Jan 03 '25 07:01 bmcginnis5613