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

QSV Hardware Transcoding not working on Docker on 10.7.5 #5993

Closed
foux opened this issue May 6, 2021 · 118 comments
Closed

QSV Hardware Transcoding not working on Docker on 10.7.5 #5993

foux opened this issue May 6, 2021 · 118 comments
Labels
bug Something isn't working

Comments

@foux
Copy link

foux commented May 6, 2021

Describe the bug
When using docker on 10.7.5 (either Jellyfin image or LinuxServer one), hardware transcoding won't work with the following error :

tail FFmpeg.Transcode-2021-05-06_14-44-12_87f32129d88b262aeec014eb47bca72a_daf3d61e.log
Error creating a QSV device
qsv hwaccel requested for input stream #0:1, but cannot be initialized.
[hevc_qsv @ 0x5580db7b11c0] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:1: Invalid argument
[AVHWDeviceContext @ 0x5580db7f8e00] Failed to initialise VAAPI connection: -1 (unknown libva error).
Error creating a QSV device
qsv hwaccel requested for input stream #0:1, but cannot be initialized.
[hevc_qsv @ 0x5580db7b11c0] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:1: Invalid argument
[AVHWDeviceContext @ 0x5580db8011c0] Failed to initialise VAAPI connection: -1 (unknown libva error).

The same file (with the same configuration) works without issue on 10.7.2.

System (please complete the following information):

  • OS: Docker on Linux Gentoo host
  • Virtualization: Docker
  • Clients: Android / iOS Jellyfin apps
  • Jellyfin Version: 10.7.5
  • Playback: HW Transcode

To Reproduce

  1. Have a QSV encoding hardware, and configured on Jellyfin
  2. Launch a media needing conversion
  3. See error

Expected behavior
The hardware transcoding should work

Logs
FFmpeg error :

tail FFmpeg.Transcode-2021-05-06_14-44-12_87f32129d88b262aeec014eb47bca72a_daf3d61e.log
Error creating a QSV device
qsv hwaccel requested for input stream #0:1, but cannot be initialized.
[hevc_qsv @ 0x5580db7b11c0] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:1: Invalid argument
[AVHWDeviceContext @ 0x5580db7f8e00] Failed to initialise VAAPI connection: -1 (unknown libva error).
Error creating a QSV device
qsv hwaccel requested for input stream #0:1, but cannot be initialized.
[hevc_qsv @ 0x5580db7b11c0] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:1: Invalid argument
[AVHWDeviceContext @ 0x5580db8011c0] Failed to initialise VAAPI connection: -1 (unknown libva error).

vainfo on host :

libva info: VA-API version 1.11.0
libva info: Trying to open /usr/lib64/va/drivers/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/lib64/va/drivers/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.11 (libva 2.11.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Coffee Lake - 2.4.1
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointEncSlice
      VAProfileVP9Profile2            : VAEntrypointVLD

vainfo on docker container :

error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.11.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_11
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.11 (libva 2.11.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 21.1.3 (bec8e13)
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD

Additional context
Works perfectly when reverting to 10.7.2

@lreeves
Copy link

lreeves commented May 10, 2021

Same issue on Debian 11/Bullseye. I've tried upgrading the Intel driver packages to the latest version but that doesn't seem to help.

@fakemanhk
Copy link

I believe you are using jellyfin-ffmpeg v4.3.1-4 as bundled with Ubuntu image.
However there exist a newer v4.3.2-1 in Jellyfin Repo but never released to Ubuntu 20.04 (dunno why), for the same 10.7.5 on Debian Buster, the repo is already distributing FFMPEG 4.3.2-1 which is the one working with QSV.
For details please refer to this post.

@mLgz0rn
Copy link

mLgz0rn commented May 12, 2021

So it's a dependency issue right?
Seems like an easy fix to just update the dependency to the newer ffmpeg?
It's quite a pain to either be forced to use 10.7.2 or manually update ffmpeg inside the docker containers through console just to get qsv working.

@fakemanhk
Copy link

So it's a dependency issue right?
Seems like an easy fix to just update the dependency to the newer ffmpeg?
It's quite a pain to either be forced to use 10.7.2 or manually update ffmpeg inside the docker containers through console just to get qsv working.

Nope, there is no dependency issue, you can just go to https://repo.jellyfin.org/releases/server/ubuntu/versions/jellyfin-ffmpeg/ and grab the DEB for your Ubuntu.
Jellyfin has 4.3.2-1 package for Debian/Ubuntu, I guess it's a mistake that they forgot to put the newer FFMPEG to the Ubuntu repo? (Debian repo has the correct version).

@mLgz0rn
Copy link

mLgz0rn commented May 17, 2021

So it's a dependency issue right?
Seems like an easy fix to just update the dependency to the newer ffmpeg?
It's quite a pain to either be forced to use 10.7.2 or manually update ffmpeg inside the docker containers through console just to get qsv working.

Nope, there is no dependency issue, you can just go to https://repo.jellyfin.org/releases/server/ubuntu/versions/jellyfin-ffmpeg/ and grab the DEB for your Ubuntu.
Jellyfin has 4.3.2-1 package for Debian/Ubuntu, I guess it's a mistake that they forgot to put the newer FFMPEG to the Ubuntu repo? (Debian repo has the correct version).

That pretty much means that it's a dependency problem.
Since it's set to pull the old version instead of the new.

@fakemanhk
Copy link

So it's a dependency issue right?
Seems like an easy fix to just update the dependency to the newer ffmpeg?
It's quite a pain to either be forced to use 10.7.2 or manually update ffmpeg inside the docker containers through console just to get qsv working.

Nope, there is no dependency issue, you can just go to https://repo.jellyfin.org/releases/server/ubuntu/versions/jellyfin-ffmpeg/ and grab the DEB for your Ubuntu.
Jellyfin has 4.3.2-1 package for Debian/Ubuntu, I guess it's a mistake that they forgot to put the newer FFMPEG to the Ubuntu repo? (Debian repo has the correct version).

That pretty much means that it's a dependency problem.
Since it's set to pull the old version instead of the new.

I remember a couple days ago I had a glace from another issue, someone quoted that Jellyfin has released 4.3.2-1 for Ubuntu but for some reason they decided to move back, I can't find that issue now. But for Debian, a 10.7.5 installation will automatically bring me FFMPEG 4.3.2-1, so at the beginning I also couldn't believe that's the root cause of problem on Ubuntu.

@fakemanhk
Copy link

Oh I found it here: linuxserver/docker-jellyfin@ede49b2

@Hukuma1
Copy link

Hukuma1 commented May 23, 2021

Same issue here. So... why was it reverted to older version of FFMpeg? And how to fix it besides reverting to older Jellyfin version? :/

@fightforlife
Copy link

Same here

@Hukuma1
Copy link

Hukuma1 commented Jun 18, 2021

Still an issue in Jellyfin 10.7.6

Workaround (installing newer version of jellyfin-ffmpeg):

docker exec -it jellyfin /bin/bash
curl -LO https://repo.jellyfin.org/releases/server/ubuntu/versions/jellyfin-ffmpeg/4.3.2-1/jellyfin-ffmpeg_4.3.2-1-focal_amd64.deb
dpkg -i jellyfin-ffmpeg_4.3.2-1-focal_amd64.deb

@AndreaPro
Copy link

Still an issue in Jellyfin 10.7.6

Workaround (installing newer version of jellyfin-ffmpeg):

docker exec -it jellyfin /bin/bash
curl -LO https://repo.jellyfin.org/releases/server/ubuntu/versions/jellyfin-ffmpeg/4.3.2-1/jellyfin-ffmpeg_4.3.2-1-focal_amd64.deb
dpkg -i jellyfin-ffmpeg_4.3.2-1-focal_amd64.deb

I've solved by using the following command too, before QSV was broken

@imyuno
Copy link

imyuno commented Jun 19, 2021

QSV not working on clean jellyfin/jellyfin:latest docker container for a few months now. VAAPI works but not QSV.
Manually downgrading to jellyfin-ffmpeg_4.3.1-3 fixes it but hopefully this can be addressed in new releases of the container image given that the issue seems to be depency related.

jellyfin:latest (debian buster) - jellyfin server 10.7.6 - jellyfin-ffmpeg 4.3.2-1-buster - QSV NOT working
jellyfin:latest (debian buster) - jellyfin server 10.7.6 - jellyfin-ffmpeg 4.3.1-3-buster (manual downgrade) - QSV WORKS

Running this after updating the container to restore QSV functionality (also installs non-free driver).

docker exec -it jellyfin /bin/bash
echo 'deb http://deb.debian.org/debian buster non-free' >> /etc/apt/sources.list \
&& apt -y update \
&& apt -y install wget intel-media-va-driver-non-free \
&& dpkg -P --force-depends jellyfin-ffmpeg \
&& wget https://github.com/jellyfin/jellyfin-ffmpeg/releases/download/v4.3.1-3/jellyfin-ffmpeg_4.3.1-3-buster_amd64.deb \
&& dpkg -i jellyfin-ffmpeg_4.3.1-3-buster_amd64.deb

@fakemanhk
Copy link

fakemanhk commented Jun 21, 2021 via email

@imyuno
Copy link

imyuno commented Jun 22, 2021

@edwardwong80 thank you for the pointer, I managed to get QSV working with jellyfin 10.7.6 and jellyfin-ffmpeg 4.3.2-1 inside the docker container using the intel drivers from bullseye/testing! This avoids being stuck on jellyfin-ffmpeg 4.3.1 which might become an issue down the line.

This is what I run inside jellyfin:latest container (can remove vainfo, useful for debugging):

echo 'APT::Default-Release "stable";' > /etc/apt/apt.conf.d/99defaultrelease \
  && echo 'deb http://deb.debian.org/debian testing main non-free' >> /etc/apt/sources.list \
  && apt -y update \
  && apt -y -t testing install intel-media-va-driver-non-free vainfo \
  && rm /usr/local/lib/libigdgmm.so.11

The rm /usr/local/lib/libigdgmm.so.11 is awkward but libva loads that if present instead of the latest version from the intel driver and breaks vainfo/jellyfin-ffmpeg. Credit: https://www.reddit.com/r/jellyfin/comments/meobdv/qsv_setup_problems/gsldom7/

Logs with existing /usr/local/lib/libigdgmm.so.11

[AVHWDeviceContext @ 0x56405154fa80] libva: dlopen of /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so failed: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so: undefined symbol: _ZN6GmmLib16GmmClientContext25CreateCustomResInfoObjectEP32GMM_RESCREATE_CUSTOM_PARAMS__REC
[AVHWDeviceContext @ 0x56405154fa80] Failed to initialise VAAPI connection: -1 (unknown libva error).
Device creation failed: -5. 

vainfo
libva info: VA-API version 1.10.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva error: dlopen of /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so failed: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so: undefined symbol: _ZN6GmmLib16GmmClientContext25CreateCustomResInfoObjectEP32GMM_RESCREATE_CUSTOM_PARAMS__REC
libva info: va_openDriver() returns -1

After removing /usr/local/lib/libigdgmm.so.11

vainfo
libva info: VA-API version 1.10.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.10 (libva 2.10.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 21.1.1 ()

Jellyfin QSV working on latest docker container!

@rightsaidfred99
Copy link

lol none of those commands work for me in docker + synology :(

Anyone care to help out a newbie with this?

@rbkn
Copy link

rbkn commented Jul 7, 2021

@rightsaidfred99 You will need to give more information on the problem, what you tried and what didn't work.

@rightsaidfred99
Copy link

@rightsaidfred99 You will need to give more information on the problem, what you tried and what didn't work.

Oh, just the commands don't match what can be entered into the synology docker console.

In the end I disabled hardware transcoding and I can now play all videos and everything transcodes faster than with qsv enabled so I really don't understand what's going on.

@fakemanhk
Copy link

@rightsaidfred99 You will need to give more information on the problem, what you tried and what didn't work.

Oh, just the commands don't match what can be entered into the synology docker console.

In the end I disabled hardware transcoding and I can now play all videos and everything transcodes faster than with qsv enabled so I really don't understand what's going on.

Are you sure you are doing transcoding? And what's the resolution? Those Synology home use NAS has only a Celeron J series CPU, 1080p software transcoding should be OK (but using lots of CPU resources), but 4K is not quite possible, especially HEVC video type.

For Synology NAS, I remember that the intel-media-driver-non-free version is quite new, the remaining is to update the FFMPEG inside docker to make it work.

@rightsaidfred99
Copy link

@rightsaidfred99 You will need to give more information on the problem, what you tried and what didn't work.

Oh, just the commands don't match what can be entered into the synology docker console.
In the end I disabled hardware transcoding and I can now play all videos and everything transcodes faster than with qsv enabled so I really don't understand what's going on.

Are you sure you are doing transcoding? And what's the resolution? Those Synology home use NAS has only a Celeron J series CPU, 1080p software transcoding should be OK (but using lots of CPU resources), but 4K is not quite possible, especially HEVC video type.

For Synology NAS, I remember that the intel-media-driver-non-free version is quite new, the remaining is to update the FFMPEG inside docker to make it work.

Yes, it's transcoding - it says so on an Android client where you tap the "i" icon and transcoding=true.

I have no idea what's going on but 4K Videos and 1080p transcoding works without hardware acceleration with Jellyfin.
Enabling HWT causes massive slowdowns to the point of it being unwatchable - hardware transcoding used to work over a year ago so maybe something did break with FFMPEG.

At the moment, I suggest anyone else that runs into this, just keep it simple and disable HWT cause it'll still work until this bug is found.

@fakemanhk
Copy link

@rightsaidfred99 You will need to give more information on the problem, what you tried and what didn't work.

Oh, just the commands don't match what can be entered into the synology docker console.
In the end I disabled hardware transcoding and I can now play all videos and everything transcodes faster than with qsv enabled so I really don't understand what's going on.

Are you sure you are doing transcoding? And what's the resolution? Those Synology home use NAS has only a Celeron J series CPU, 1080p software transcoding should be OK (but using lots of CPU resources), but 4K is not quite possible, especially HEVC video type.
For Synology NAS, I remember that the intel-media-driver-non-free version is quite new, the remaining is to update the FFMPEG inside docker to make it work.

Yes, it's transcoding - it says so on an Android client where you tap the "i" icon and transcoding=true.

I have no idea what's going on but 4K Videos and 1080p transcoding works without hardware acceleration with Jellyfin.
Enabling HWT causes massive slowdowns to the point of it being unwatchable - hardware transcoding used to work over a year ago so maybe something did break with FFMPEG.

At the moment, I suggest anyone else that runs into this, just keep it simple and disable HWT cause it'll still work until this bug is found.

Can you capture the Jellyfin transcoding log, for both using/not using QSV?
And as I mentioned before, the FFMPEG bundled with 10.7.5 (seems the same for 10.7.6) is not 4.3.2-1, are you using 4.3.2-1 now?

@henkisdabro
Copy link
Contributor

henkisdabro commented Jul 14, 2021

echo 'APT::Default-Release "stable";' > /etc/apt/apt.conf.d/99defaultrelease
&& echo 'deb http://deb.debian.org/debian testing main non-free' >> /etc/apt/sources.list
&& apt -y update
&& apt -y -t testing install intel-media-va-driver-non-free vainfo
&& rm /usr/local/lib/libigdgmm.so.11

Sounds awesome, but I can't get this to work I'm afraid, generating the following error message:

W: GPG error: http://deb.debian.org/debian buster InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY DCC9EFBF77E11517
E: The repository 'http://deb.debian.org/debian buster InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://deb.debian.org/debian testing InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138
E: The repository 'http://deb.debian.org/debian testing InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The value 'stable' is invalid for APT::Default-Release as such a release is not available in the sources

🤦🏻‍♂️ I'm on Ubuntu (it's inside the linuxserver/jellyfin:latest container), that would be why it's not working, sorry for this. What would be the recommended steps for Ubuntu to ensure I'm best prepared for QSV support? It seems by the logs that the hevc_qsv is working and I can watch transcoded movies (on my iphone), but the CPU usage is like 400% (~80% total) on my 6500T Skylake CPU, is this right for 4K HEVC SDR content?

@fakemanhk
Copy link

fakemanhk commented Jul 14, 2021

echo 'APT::Default-Release "stable";' > /etc/apt/apt.conf.d/99defaultrelease
&& echo 'deb http://deb.debian.org/debian testing main non-free' >> /etc/apt/sources.list
&& apt -y update
&& apt -y -t testing install intel-media-va-driver-non-free vainfo
&& rm /usr/local/lib/libigdgmm.so.11

Sounds awesome, but I can't get this to work I'm afraid, generating the following error message:

W: GPG error: http://deb.debian.org/debian buster InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY DCC9EFBF77E11517
E: The repository 'http://deb.debian.org/debian buster InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://deb.debian.org/debian testing InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138
E: The repository 'http://deb.debian.org/debian testing InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The value 'stable' is invalid for APT::Default-Release as such a release is not available in the sources

🤦🏻‍♂️ I'm on Ubuntu (it's inside the linuxserver/jellyfin:latest container), that would be why it's not working, sorry for this. What would be the recommended steps for Ubuntu to ensure I'm best prepared for QSV support? It seems by the logs that the hevc_qsv is working and I can watch transcoded movies (on my iphone), but the CPU usage is like 400% (~80% total) on my 6500T Skylake CPU, is this right for 4K HEVC SDR content?

That command won't work for you, it's for Debian, not for Ubuntu.

For Ubuntu one you need to upgrade 2 things, one is FFMPEG, you can download the Focal-AMD64 here.

And follow this guide from Intel to get latest intel-media-driver-non-free

For your case, Skylake CPU has HEVC hardware acceleration support but 8-bit ONLY, 10-bit isn't supported, so it depends on your video source, but you should better have the transcoding log for better analysis, you can paste them to Ubuntu pastebin and link back here.

@Hukuma1
Copy link

Hukuma1 commented Jul 14, 2021

echo 'APT::Default-Release "stable";' > /etc/apt/apt.conf.d/99defaultrelease
&& echo 'deb http://deb.debian.org/debian testing main non-free' >> /etc/apt/sources.list
&& apt -y update
&& apt -y -t testing install intel-media-va-driver-non-free vainfo
&& rm /usr/local/lib/libigdgmm.so.11

Sounds awesome, but I can't get this to work I'm afraid, generating the following error message:

W: GPG error: http://deb.debian.org/debian buster InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY DCC9EFBF77E11517
E: The repository 'http://deb.debian.org/debian buster InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://deb.debian.org/debian testing InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138
E: The repository 'http://deb.debian.org/debian testing InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The value 'stable' is invalid for APT::Default-Release as such a release is not available in the sources

🤦🏻‍♂️ I'm on Ubuntu (it's inside the linuxserver/jellyfin:latest container), that would be why it's not working, sorry for this. What would be the recommended steps for Ubuntu to ensure I'm best prepared for QSV support? It seems by the logs that the hevc_qsv is working and I can watch transcoded movies (on my iphone), but the CPU usage is like 400% (~80% total) on my 6500T Skylake CPU, is this right for 4K HEVC SDR content?

See my comment from three weeks ago above. I use the Linuxserver Docker image and this works:

#5993 (comment)

Note: Have to do it manually after every update to release unfortunately. Until it actually gets fixed that is...

@mLgz0rn
Copy link

mLgz0rn commented Jul 14, 2021

I use this docker container now on my unraid https://hub.docker.com/r/ich777/jellyfin
Should work for most of you guys also.
He seem to have done the job for us inside the container, no more manually updating ffmpeg every update.

@henkisdabro
Copy link
Contributor

Thanks for the information and assistance. Thanks also for the heads up on the SkyLake capabilities, i don't see this being mentioned as often as it should... I use this resource to remind myself what my CPU is capable of - and ensure I set my jellyfin server playback hardware encoding/decoding settings accordingly:
ffmpeg Quicksync documentation

I applied Hukuma1's commands as above in the comment earlier and can confirm with dpkg -l | grep jellyfin-ffmpeg that the right version is installed. QSV seems to be working too, but the CPU usage is still really high... (the movie files are between 10–50Gb/hour 4K HEVC HDR generally. I DirectPlay on my nVidia Shield Pro, but for iphone and other devices jellyfin transcodes).

Here is on of the transcode logs:
https://pastebin.ubuntu.com/p/HMCKvnxjZf/

And here are the two first transcode logs after playing another 4K HEVC HDR movie file:
https://pastebin.ubuntu.com/p/37JYfWR6Hq/
https://pastebin.ubuntu.com/p/vk8QMMJT3w/

Is anything out of the ordinary and is it really normal with this high CPU usage (350% on my intel 6500t skylake quad-core cpu)?

@Hukuma1
Copy link

Hukuma1 commented Jul 15, 2021

Looking over the second log you posted, it seems to be capped at 8mb/s for the re-encode/stream. Up that number dramatically (just set it to 100 if on LAN?) and see if that helps. It's probably trying to crunch it down too much and that puts too much stress. You can change playback rate using the settings cog wheel I believe.

@nyanmisaka
Copy link
Member

nyanmisaka commented Jan 4, 2022

@Ulrar
Copy link

Ulrar commented Jan 4, 2022

Probably that jellyfin thinks something is supported because of the version in the container, but the host then doesn't really.

googling your error seems to suggest it'd indeed a version issue, see this for example.

As for how to fix it, I don't know. I'd try to ensure the driver version matches on the host, and in the kernel, are the drivers mentioning kernel version compatibility maybe ?

Maybe try using vaapi instead, that could be easier.

@nzlov
Copy link

nzlov commented Jan 4, 2022

@nyanmisaka

enable guc,but no work.

ffmpeg -c:v hevc_qsv -hwaccel qsv -i file:"/media/Movies/长津湖.mp4" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -preset 7 -look_ahead 0 -b:v 9810557 -maxrate 9810557 -bufsize 19621114 -profile:v:0 high -level 41 -g:v:0 72 -keyint_min:v:0 72 -sc_threshold:v:0 0 -vf "vpp_qsv=format=nv12" -start_at_zero -vsync -1 -codec:a:0 aac -ac 2 -ab 189443 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/config/data/transcodes/7d4e649d01f18089714dd681daba5c20%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/config/data/transcodes/7d4e649d01f18089714dd681daba5c20.m3u8"
ffmpeg version n4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x557c2a99cac0] stream 0, timescale not set
[extract_extradata @ 0x557c2ae341c0] Invalid NAL unit 24, skipping.
[hevc @ 0x557c2a99f980] Invalid NAL unit 24, skipping.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x557c2a99cac0] Stream #2: not enough frames to estimate rate; consider increasing probesize
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x557c2a99cac0] decoding for stream 2 failed
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x557c2a99cac0] Could not find codec parameters for stream 2 (Video: hevc, none): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:/media/Movies/长津湖.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.12.100
    title           : 长津湖.Battle.of.Chosin.Reservior.2021.x265.HD4K.国语中字[BD影视分享bd2020.com]
    comment         : www.bd2020.com
                    : 更多网盘、BT、更多下载方式,请访问BD影视分享
  Duration: 02:57:44.37, start: 0.000000, bitrate: 3170 kb/s
  Stream #0:0(und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv), 3840x1624, 2974 kb/s, 24 fps, 24 tbr, 90k tbn, 24 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:2: Video: hevc, none, 90k tbr, 90k tbn, 90k tbc (attached pic)
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (hevc_qsv) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[AVHWDeviceContext @ 0x557c2ae26cc0] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ae26cc0] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2a9a0540] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2a9a0540] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2a9a0540] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2a9a0540] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ad81e80] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ad81e80] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ae66e80] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ae66e80] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ae6b0c0] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ae6b0c0] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ae2e6c0] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ae2e6c0] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ae61880] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ae61880] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ad7bec0] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ad7bec0] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ae6d800] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ae6d800] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ae6efc0] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ae6efc0] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ae71640] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ae71640] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ae709c0] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ae709c0] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ae78480] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ae78480] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ad711c0] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ad711c0] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ae76440] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ae76440] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device
qsv hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc_qsv @ 0x557c2ae2fe80] Error initializing the MFX video decoder: invalid handle (-6)
Error while decoding stream #0:0: Invalid argument
[AVHWDeviceContext @ 0x557c2ae75cc0] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ae75cc0] Failed to initialise VAAPI connection: 1 (operation failed).

@nyanmisaka
Copy link
Member

[AVHWDeviceContext @ 0x557c2ae26cc0] libva: /usr/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x557c2ae26cc0] Failed to initialise VAAPI connection: 1 (operation failed).
Error creating a QSV device

this should be a separate problem.

what's the environment? docker or host?

@nyanmisaka
Copy link
Member

do not use custom ffmpeg if you need hardware acceleration in Jellyfin 10.8.

low-power encoder should also be enabled.

@nzlov
Copy link

nzlov commented Jan 4, 2022

archlinux host.
dmesg info

[    3.675849] fb0: switching to i915 from EFI VGA
[    3.675926] Console: switching to colour dummy device 80x25
[    3.675967] i915 0000:00:02.0: vgaarb: deactivate vga console
[    3.681088] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    3.683175] i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[    3.684081] pps pps1: new PPS source ptp1
[    3.684924] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/icl_dmc_ver1_09.bin (v1.9)
[    3.686620] igb 0000:02:00.0: added PHC on eth1
[    3.686624] igb 0000:02:00.0: Intel(R) Gigabit Ethernet Network Connection
[    3.686626] igb 0000:02:00.0: eth1: (PCIe:2.5Gb/s:Width x1) 00:90:27:e4:01:01
[    3.686629] igb 0000:02:00.0: eth1: PBA No: FFFFFF-0FF
[    3.686630] igb 0000:02:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)
[    3.730166] SSE version of gcm_enc/dec engaged.
[    3.777799] iTCO_vendor_support: vendor-support=0
[    3.781868] igb 0000:01:00.0 enp1s0: renamed from eth0
[    3.788693] iTCO_wdt iTCO_wdt: unable to reset NO_REBOOT flag, device disabled by hardware/BIOS
[    3.791848] igb 0000:02:00.0 enp2s0: renamed from eth1
[    3.806879] snd_hda_intel 0000:00:1f.3: enabling device (0000 -> 0002)
[    4.039622] EXT4-fs (dm-12): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[    4.041928] EXT4-fs (dm-13): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[    4.046160] intel_rapl_common: Found RAPL domain package
[    4.046165] intel_rapl_common: Found RAPL domain core
[    4.046166] intel_rapl_common: Found RAPL domain uncore
[    4.314465] EXT4-fs (dm-1): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[    4.374344] i915 0000:00:02.0: [drm] failed to retrieve link info, disabling eDP
[    4.672849] i915 0000:00:02.0: GuC initialization failed -110
[    4.672856] i915 0000:00:02.0: Enabling uc failed (-5)
[    4.672858] i915 0000:00:02.0: Failed to initialize GPU, declaring it wedged!
[    4.673333] i915 0000:00:02.0: [drm:add_taint_for_CI [i915]] CI tainted:0x9 by intel_gt_init+0xcf/0x640 [i915]
[    4.839758] [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 0
[    4.840746] ACPI: video: [Firmware Bug]: ACPI(GFX0) defines _DOD but not _DOS
[    4.841842] ACPI: video: Video Device [GFX0] (multi-head: yes  rom: no  post: no)
[    4.842361] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input4
[    4.842508] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    4.849774] fbcon: i915drmfb (fb0) is primary device
[    4.879251] Console: switching to colour frame buffer device 128x48
[    4.900483] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
cat /sys/kernel/debug/dri/0/gt/uc/huc_info             master :: 8d :: ⬡
HuC firmware: i915/ehl_huc_9.0.0.bin
	status: AVAILABLE
	version: wanted 9.0, found 9.0
	uCode: 498496 bytes
	RSA: 256 bytes
HuC status: 0x0007c002
cat /sys/kernel/debug/dri/0/gt/uc/guc_info             master :: 8d :: ⬡
GuC firmware: i915/ehl_guc_62.0.0.bin
	status: AVAILABLE
	version: wanted 62.0, found 62.0
	uCode: 327104 bytes
	RSA: 256 bytes

GuC status 0x00000001:
	Bootrom status = 0x0
	uKernel status = 0x0
	MIA Core status = 0x0

Scratch registers:
	 0: 	0x0
	 1: 	0x0
	 2: 	0x0
	 3: 	0x0
	 4: 	0x0
	 5: 	0x0
	 6: 	0x0
	 7: 	0x0
	 8: 	0x0
	 9: 	0x0
	10: 	0x0
	11: 	0x0
	12: 	0x0
	13: 	0x0
	14: 	0x0
	15: 	0x0

GuC log relay not created

@nyanmisaka
Copy link
Member

nyanmisaka commented Jan 4, 2022

GuC firmware: i915/ehl_guc_62.0.0.bin
	status: AVAILABLE
	version: wanted 62.0, found 62.0
	uCode: 327104 bytes
	RSA: 256 bytes

Guc in enabled. Which jellyfin are you running?

Would you like to give it a try to nyanmisaka/jellyfin:latest docker image?
EHL/JSL chips have a hard dependency on Guc firmware and Low-Power encoding. You can enable it in this jellyfin.

@nzlov
Copy link

nzlov commented Jan 4, 2022

try nyanmisaka/jellyfin:latest

/videos/0abe0c7a-d849-9bd2-2637-f14886f3d606/hls1/main/0.ts

{"Protocol":0,"Id":"0abe0c7ad8499bd22637f14886f3d606","Path":"/media/Movies/\u957F\u6D25\u6E56.mp4","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"mov,mp4,m4a,3gp,3g2,mj2","Size":4226064265,"Name":"\u957F\u6D25\u6E56","IsRemote":false,"ETag":"d1a49497a35b617134bfc8a8b4d652c8","RunTimeTicks":106643700000,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"OpenToken":null,"RequiresClosing":false,"LiveStreamId":null,"BufferMs":null,"RequiresLooping":false,"SupportsProbing":true,"VideoType":0,"IsoType":null,"Video3DFormat":null,"MediaStreams":[{"Codec":"hevc","CodecTag":"hev1","Language":"und","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"Comment":null,"TimeBase":"1/90000","CodecTimeBase":null,"Title":null,"VideoRange":"SDR","LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"DisplayTitle":"4K HEVC SDR","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":2974684,"BitDepth":8,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":true,"IsForced":false,"Height":1624,"Width":3840,"AverageFrameRate":24,"RealFrameRate":24,"Profile":"Main","Type":1,"AspectRatio":"2.35:1","Index":0,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p","Level":150,"IsAnamorphic":null},{"Codec":"aac","CodecTag":"mp4a","Language":"und","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"Comment":null,"TimeBase":"1/44100","CodecTimeBase":null,"Title":"SoundHandler","VideoRange":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"DisplayTitle":"SoundHandler - AAC - Stereo - Default","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":"stereo","BitRate":189443,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":2,"SampleRate":44100,"IsDefault":true,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":"LC","Type":0,"AspectRatio":null,"Index":1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"png","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"Comment":null,"TimeBase":"1/90000","CodecTimeBase":null,"Title":null,"VideoRange":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"DisplayTitle":null,"NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":149,"Width":304,"AverageFrameRate":null,"RealFrameRate":90000,"Profile":null,"Type":3,"AspectRatio":"304:149","Index":2,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"rgb24","Level":-99,"IsAnamorphic":null}],"MediaAttachments":[{"Codec":"png","CodecTag":"[0][0][0][0]","Comment":null,"Index":2,"FileName":null,"MimeType":null,"DeliveryUrl":null}],"Formats":[],"Bitrate":3170230,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":null,"TranscodingContainer":null,"AnalyzeDurationMs":null,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

/usr/lib/jellyfin-ffmpeg/ffmpeg -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel vaapi -hwaccel_output_format vaapi -autorotate 0 -i file:"/media/Movies/长津湖.mp4" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -low_power 1 -preset 7 -look_ahead 0 -b:v 9810557 -maxrate 9810557 -bufsize 19621114 -profile:v:0 high -level 41 -g:v:0 72 -keyint_min:v:0 72 -sc_threshold:v:0 0 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=format=nv12,hwmap=derive_device=qsv,format=qsv" -codec:a:0 copy -strict -2 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/config/transcodes/58fd86beabe744b859aaaf3904fbe8f0%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/config/transcodes/58fd86beabe744b859aaaf3904fbe8f0.m3u8"


ffmpeg version 4.4.1-Jellyfin Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  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-gmp --enable-gnutls --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 --arch=amd64 --enable-opencl --enable-vaapi --enable-amf --enable-libmfx --enable-vdpau --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[AVHWDeviceContext @ 0x55906a02d780] libva: /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x55906a02d780] Failed to initialise VAAPI connection: 1 (operation failed).
Device creation failed: -5.
Failed to set value 'vaapi=va:,kernel_driver=i915,driver=iHD' for option 'init_hw_device': Input/output error
Error parsing global options: Input/output error

Archlinux vainfo when enable guc

libva error: /usr/lib/dri/iHD_drv_video.so init failed
vaInitialize failed with error code -1 (unknown libva error),exit

@nzlov
Copy link

nzlov commented Jan 5, 2022

kernel 5.15 no work.
downgrade linux 5.14.16 working.

kernel 5.16 fixed.

@icedterminal
Copy link

Thank you @nyanmisaka.

4.4.1 works with 21.4.1+i643. Both docker and bare metal instances are functioning without fault.

@Fallenbagel
Copy link

Hi. I'm also having the same problem as nzlov. I am running dockerised with the official jellyfin image and when i turn on intel quicksync I get
[AVHWDeviceContext @ 0x55adf278a680\] Failed to initialise VAAPI connection: -1 (unknown libva error). Device creation failed: -5. Failed to set value 'vaapi=va:,kernel\_driver=i915,driver=iHD' for option 'init\_hw\_device': Input/output error Error parsing global options: Input/output error
However, when i run linuxserver image it works but the server starts from scratch even if i point to the library path and I could not figure out how to make it detect the existing library no matter what I did.
Is it possible to fix the aforementioned error on official jellyfin image?
or is it possible to use the existing library made with the official jellyfin image on the linuxserver one?

@ocervell
Copy link

ocervell commented Mar 27, 2022

Same here on 10.8.0-alpha5. I run this script after container deployment at the moment, which fixes it:

#!/bin/bash

# Install debug tools
apt update
apt install -y wget gnupg vainfo gpg-agent

# Upgrade jellyfin-ffmpeg to latest version 4.4.1-4-bullseye (increases transcoding perfs a lot)
echo "deb http://http.us.debian.org/debian stable main contrib non-free" | tee -a /etc/apt/sources.list
apt update
apt install -y -u jellyfin-ffmpeg

# Install i965 driver (default gpu driver, uncomment if you have <9th gen CPU)
# apt install i965-va-driver-shaders

# Install iHD driver (iHD quicksync driver, better performance cf https://www.reddit.com/r/jellyfin/comments/r5pur8/best_transcoding_settings_for_synology_ds920/ only if you have a >9th gen CPU)
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 -y intel-media-va-driver-non-free

We should consider adding those steps in the Dockerfile.

@dlicois
Copy link

dlicois commented Mar 27, 2022

PR for dockerfile should probably go there jellyfin/jellyfin-metapackages. I am unsure if all usecases can fit in the same amd64 dockerfile though.

@crobibero
Copy link
Member

The dockerfile changes shouldn't be needed on current master, please check and verify that it works for you.

@maxirus
Copy link

maxirus commented Jun 17, 2022

Intel QuickSync still does not work for me on v10.8.0. However, the error is different this time:

ffmpeg version 5.0.1-Jellyfin Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-libs=-lfftw3 --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-shared --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-static --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-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libmfx --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
Device creation failed: -542398533.
Failed to set value 'vaapi=va:,driver=iHD,kernel_driver=i915' for option 'init_hw_device': Generic error in an external library
Error parsing global options: Generic error in an external library

@nyanmisaka
Copy link
Member

nyanmisaka commented Jun 17, 2022

This is a configure issue, due to missing /dev/dri, the wrong group-add value or the privileged option is not checked on Synology NAS. All required Intel drivers have been shipped with jellyfin-ffmpeg5 deb packages.

Please follow this instructions:
https://jellyfin.org/docs/general/administration/hardware-acceleration.html#hardware-acceleration-on-docker-linux

Issue Triage for Main Repo automation moved this from Needs triage to Closed/Done Jun 17, 2022
@jellyfin-bot jellyfin-bot moved this from Closed/Done to Needs triage in Issue Triage for Main Repo Jun 17, 2022
@ricky9w
Copy link

ricky9w commented Jul 12, 2022

kernel 5.15 no work. downgrade linux 5.14.16 working.

kernel 5.16 fixed.

Same issue as nzlov

CPU, GPU: Intel N5095

Environment: PVE 7.2-7, LXC based on Debian 11, running docker nyanmisaka/jellyfin in LXC

Same problem with kernel 5.15, and upgrading to 5.16 fixes

@nyanmisaka
Copy link
Member

Same problem with kernel 5.15, and upgrading to 5.16 fixes

For Jasper Lake and Elkhart Lake chips (such as N5095, N6005 and J6412), Low-Power encoding must be enabled. There's a known kernel issue on these chips in linux 5.15 that comes with Ubuntu 22.04 LTS preventing you from using Low-Power. You may need to upgrade kernel for this.

https://jellyfin.org/docs/general/administration/hardware-acceleration.html#intel-gen9-and-gen11-igpus

@mich2k
Copy link

mich2k commented Jan 12, 2024

GuC firmware: i915/ehl_guc_62.0.0.bin
	status: AVAILABLE
	version: wanted 62.0, found 62.0
	uCode: 327104 bytes
	RSA: 256 bytes

Guc in enabled. Which jellyfin are you running?

Would you like to give it a try to nyanmisaka/jellyfin:latest docker image? EHL/JSL chips have a hard dependency on Guc firmware and Low-Power encoding. You can enable it in this jellyfin.

Hello,
I just pulled your image, running a J6413 but still having no success, if I understood right your image is ready for low power encoding needed for these celeron cpus but I cant find the settings you state in this comment
thank you for your time

@nyanmisaka
Copy link
Member

@mich2k jellyfin/jellyfin have included all the changes needed for JSL/EHL so my image doesn't have to be used.

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

@jellyfin-bot jellyfin-bot moved this from Closed/Done to Needs triage in Issue Triage for Main Repo Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.