linuxserver / docker-jellyfin

GNU General Public License v3.0
647 stars 97 forks source link

linuxserver/jellyfin:10.6.4-1-ls96 broke Intel Quicksync (most likely due to jellyfin-ffmpeg4.3.1-4-focal) #96

Closed fightforlife closed 3 years ago

fightforlife commented 3 years ago

linuxserver.io


Expected Behavior

hardware transcoding using quicksync on Intel platforms should work last working build: linuxserver/jellyfin:10.6.4-1-ls95 with jellyfin-ffmpeg4.3.1-3-focal

Current Behavior

hardware transcoding using quicksync on Intel platforms is not working first non working build: linuxserver/jellyfin:10.6.4-1-ls96 with jellyfin-ffmpeg4.3.1-4-focal

Steps to Reproduce

  1. Run linuxserver/jellyfin:10.6.4-1-ls96 with jellyfin-ffmpeg4.3.1-4-focal
  2. activate Intel QS
  3. Play any file that needs to be transcoded

Also discussed here: https://github.com/jellyfin/jellyfin-ffmpeg/issues/62

Environment

OS: Ubuntu 20.10 CPU architecture: x86_64 Intel J3455 How docker service was installed: Using the suplied docker compose including the device configuration /de/dri

Command used to create docker container (run/create/compose/screenshot)

services:
  app:
#    image: ghcr.io/linuxserver/jellyfin
    image: linuxserver/jellyfin:10.6.4-1-ls95
#    image: linuxserver/jellyfin:10.6.4-1-ls96
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
    volumes:
      - config:/config
      - /mnt/HDD/share:/data
    ports:
      - 8096:8096
    devices:
      - /dev/dri:/dev/dri
    restart: unless-stopped

volumes:
  config:

Docker logs

Stream mapping:
  Stream #0:0 -> #0:0 (hevc (hevc_qsv) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, hls, to '/config/data/transcodes/286304083d50f88764ac6e8a54d5dba1.m3u8':
  Metadata:
    encoder         : Lavf58.45.100
    Stream #0:0: Video: h264 (h264_qsv), qsv, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 8003 kb/s, 25 fps, 90k tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc58.91.100 h264_qsv
    Side data:
      cpb: bitrate max/min/avg: 8003532/0/8003532 buffer size: 16007064 vbv_delay: N/A
    Stream #0:1: Audio: mp3 (libmp3lame), 48000 Hz, stereo, fltp, 224 kb/s (default)
    Metadata:
      encoder         : Lavc58.91.100 libmp3lame
[h264_qsv @ 0x559e6f5a2640] Error during encoding: device failed (-17)
Video encoding failed
[libmp3lame @ 0x559e6f7e47c0] 3 frames left in the queue on closing
Conversion failed!
github-actions[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

aptalca commented 3 years ago

Since the only difference between those two builds is the jellyfin ffmpeg package version, it probably should be reported upstream

fightforlife commented 3 years ago

https://github.com/jellyfin/jellyfin-ffmpeg/issues/62

I just wanted to also post it here, so that users of this image quickly find the error.

Here is some discussion about it. Could be some updated intel driver dependencies. https://www.reddit.com/r/jellyfin/comments/ljoozp/intel_quicksyncqsv_transcoding_broke_with

aptalca commented 3 years ago

Great, thanks

StableNarwhal commented 3 years ago

Workaround for the meantime:

Add this script at /config/custom-cont-init.d (You'll most likely have to create the folder manually, reference here):

apt update apt install -y gpg-agent wget wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | apt-key add - echo 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main' >> /etc/apt/sources.list apt update apt install --only-upgrade -y intel-media-va-driver-non-free

Now you'll have a persistent solution to automatically fix the container until it gets fixes upstream.

fightforlife commented 3 years ago

Thank you, works perfectly fine!

tces1 commented 3 years ago

GREAT!It works well for me, my NAS is synology 220+

matrixn commented 3 years ago

For n00bs -- like me :)) i should mention that they have to add the following at the start of the script file.

#!/bin/bash

Thanks for the workaround!

lyz-code commented 3 years ago

The solution worked for 10.7.1 too

Vercety87 commented 3 years ago

Hello,

I tried with your workaround but still unable to play movie with hw encode :

ffmpeg version 4.3.1-Jellyfin Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-shared --disable-libxcb --disable-sdl2 --disable-xlib --enable-gpl --enable-version3 --enable-static --enable-libfontconfig --enable-fontconfig --enable-gmp --enable-gnutls --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --arch=amd64 --enable-opencl --enable-vaapi --enable-amf --enable-libmfx --enable-vdpau --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvenc --enable-nvdec --enable-ffnvcodec
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Device creation failed: -542398533.
Failed to set value 'qsv=hw' for option 'init_hw_device': Generic error in an external library
Error parsing global options: Generic error in an external library

Any ideas ?

My docker-compose file :

version: "2.1"
services:
  jellyfin:
    image: ghcr.io/linuxserver/jellyfin
    container_name: jellyfin
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Paris
    volumes:
      - ./library:/config
      - /mnt/sdb1/media:/media/sdb1
      - /mnt/sdc1/media:/media/sdc1
    ports:
      - 8096:8096
      - 8920:8920 #optional
      - 7359:7359/udp #optional
      - 1900:1900/udp #optional
    devices:
      - /dev/dri:/dev/dri
    labels:
      - "com.centurylinklabs.watchtower.enable=true"
      - "traefik.enable=true"
      - "traefik.http.routers.jelly.rule=Host(`jellyfin.jmtserv.duckdns.org`)"
      - "traefik.http.routers.jelly.entrypoints=websecure"
      - "traefik.http.routers.jelly.tls.certresolver=letsencrypt"
      - "traefik.http.services.jelly.loadbalancer.server.port=8096"
      - "traefik.http.routers.jelly.middlewares=security@file, compression@file"
    restart: unless-stopped
    networks:
      - proxy
networks:
  proxy:
    external: true

Proc model : Intel(R) Xeon(R) CPU E5-2420 v2 @ 2.20GHz

MenchenFive commented 3 years ago

Are there no updates on this? It's been two weeks; this is not critical, but an official fix would be nice instead of having to continue with the workarounds.