Closed Pl1997 closed 2 years ago
We do not ask for logs or command to be offered on demand, please add them to the issue.
We do not ask for logs or command to be offered on demand, please add them to the issue.
Sorry, I wanted to do well, by avoiding to add maybe unnecessary logs... I just added a log of an installation configured as the README says.
Also, can you add the docker installation please.
Also, can you add the docker installation please.
Sorry, I’m not sure to understand precisely what you’re asking for… About the main docker installation, it is the one provided by my NAS vendor (QNAP), and about the container installation in Docker, I didn’t use a docker compose or run file but the Portainer GUI, so I don’t really know what extra material I could provide
Hell, you had to write things to install Jellyfin on Portainer, right ? This is important to know if you have the good config
No I didn’t, unfortunately… The Portainer GUI provides a large set of various options and switches, I tweaked them to match the readme. More specifically, I chose the right image, I mounted /dev/dri as a device, I published the needed ports, I binded the paths to the library folders, and checked the option to restart unless stopped. At first, everything else remained default, I only added the environment variables for LIBVA in later attempts.
i'm not 100% sure if my problem is connected and i'm not that deep into drivers and hardware accelleration, but since some days (not sure) my hardware acceleration also struggles.
I had success by adding the non 'non-free', so the free intel va driver. Not sure why this works.
inside the container:
apt update && apt install intel-media-va-driver
before:
[AVHWDeviceContext @ 0x55cf2cdbc7c0] libva: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed Input #0, matroska,webm, from 'file:/data/movies/somemovie.mkv': Metadata: encoder : libebml v0.8.0 + libmatroska v0.9.0 creation_time : 2020-12-26T20:32:06.000000Z Duration: 01:29:28.94, start: 0.000000, bitrate: 6932 kb/s Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1036 [SAR 1:1 DAR 480:259], 24 fps, 24 tbr, 1k tbn, 48 tbc Stream #0:1(ger): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 768 kb/s (default) Stream #0:2(ger): Subtitle: dvd_subtitle, 1920x1080 Stream mapping: Stream #0:0 (h264) -> format (graph 0) Stream #0:2 (dvdsub) -> scale (graph 0) hwupload (graph 0) -> Stream #0:0 (h264_vaapi) Stream #0:1 -> #0:1 (dts (dca) -> aac (native)) Press [q] to stop, [?] for help [matroska,webm @ 0x55cf2cddb480] sub2video: using 1920x1036 canvas Output #0, hls, to '/config/data/transcodes/3f2156af66c43a0a69fa28161c5d5e67.m3u8': Metadata: encoder : Lavf58.76.100 Stream #0:0: Video: h264 (High), vaapi_vld(tv, bt709, progressive), 1920x1036 [SAR 1:1 DAR 480:259], q=2-31, 6932 kb/s, 24 fps, 90k tbn (default) Metadata: encoder : Lavc58.134.100 h264_vaapi Stream #0:1: Audio: aac (LC), 48000 Hz, 5.1, fltp, 640 kb/s (default) Metadata: encoder : Lavc58.134.100 aac [h264_vaapi @ 0x55cf2ce15500] Failed to sync to output buffer completion: 5 (invalid VAContextID). Video encoding failed [h264_vaapi @ 0x55cf2ce15500] Failed to sync to output buffer completion: 5 (invalid VAContextID). [aac @ 0x55cf2ce16d80] Qavg: 65536.000 [aac @ 0x55cf2ce16d80] 2 frames left in the queue on closing Conversion failed!
after:
[AVHWDeviceContext @ 0x557f095b87c0] libva: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed Input #0, matroska,webm, from 'file:/data/movies/somemovie.mkv': Metadata: encoder : libebml v0.8.0 + libmatroska v0.9.0 creation_time : 2020-12-26T20:32:06.000000Z Duration: 01:29:28.94, start: 0.000000, bitrate: 6932 kb/s Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1036 [SAR 1:1 DAR 480:259], 24 fps, 24 tbr, 1k tbn, 48 tbc Stream #0:1(ger): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 768 kb/s (default) Stream #0:2(ger): Subtitle: dvd_subtitle, 1920x1080 Stream mapping: Stream #0:0 (h264) -> format (graph 0) Stream #0:2 (dvdsub) -> scale (graph 0) hwupload (graph 0) -> Stream #0:0 (h264_vaapi) Stream #0:1 -> #0:1 (dts (dca) -> aac (native)) Press [q] to stop, [?] for help [matroska,webm @ 0x557f095d4a00] sub2video: using 1920x1036 canvas Output #0, hls, to '/config/data/transcodes/24d211b38e29d149c4c444f715f5968f.m3u8': Metadata: encoder : Lavf58.76.100 Stream #0:0: Video: h264 (High), vaapi_vld(tv, bt709, progressive), 1920x1036 [SAR 1:1 DAR 480:259], q=2-31, 6932 kb/s, 24 fps, 90k tbn (default) Metadata: encoder : Lavc58.134.100 h264_vaapi Stream #0:1: Audio: aac (LC), 48000 Hz, 5.1, fltp, 640 kb/s (default) Metadata: encoder : Lavc58.134.100 aac frame= 2 fps=0.0 q=-0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x
Unrepairable overflow! frame= 19 fps=0.0 q=-0.0 size=N/A time=00:00:00.85 bitrate=N/A speed=1.52x
frame= 35 fps= 33 q=-0.0 size=N/A time=00:00:01.36 bitrate=N/A speed=1.28x
So iHD_drv_video.so still fails, but it continues anyway... Strange :) Btw: CPU is i7-4790k
I think an updated version off ffmpeg is the reason. 10.7.7 is using 4.3.1 and newer versions of Jellyfin are using ffmpeg 4.4.1.
After using an older container (jellyfin:10.7.7-1-ls146) the problem below is gone and video's play again.
Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi)) Stream #0:1 -> #0:1 (eac3 (native) -> aac (native)) Press [q] to stop, [?] for help Output #0, hls, to '/transcode/3fa08c11b2328a2288bcc8e9286a8f6c.m3u8': Metadata: encoder : Lavf58.76.100 Stream #0:0: Video: h264 (High), vaapi_vld(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 3360 kb/s, 23.98 fps, 90k tbn (default) Metadata: encoder : Lavc58.134.100 h264_vaapi Stream #0:1: Audio: aac (LC), 48000 Hz, 5.1, fltp, 640 kb/s (default) Metadata: encoder : Lavc58.134.100 aac frame= 1 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x [h264_vaapi @ 0x55dbb58f6c00] Failed to sync to output buffer completion: 5 (invalid VAContextID). Video encoding failed [h264_vaapi @ 0x55dbb58f6c00] Failed to sync to output buffer completion: 5 (invalid VAContextID). [aac @ 0x55dbb591f900] Qavg: 65536.000 [aac @ 0x55dbb591f900] 2 frames left in the queue on closing Conversion failed!
Hello, I am running into similar problems with Hw acceleration. My install is jellyfin 10.7.7-1 with ffmpeg 4.4.1.1 My CPU is an i7-3820qm so I am trying to get the i965 drivers to work.
The device is properly mounted in the docker-compose, with drivers installed on the host.
The ffmpeg logs show :
[AVHWDeviceContext @ 0x5635b72bc740] libva: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed [AVHWDeviceContext @ 0x5635b72bc740] Failed to initialise VAAPI connection: 1 (operation failed). Device creation failed: -5. [hevc_qsv @ 0x5635b7298600] No device available for decoder: device type qsv needed for codec hevc_qsv. Stream mapping: Stream #0:0 -> #0:0 (hevc (hevc_qsv) -> h264 (h264_qsv)) Stream #0:1 -> #0:1 (ac3 (native) -> aac (native)) Device setup failed for decoder on input stream #0:0 : Input/output error
Seeing that the va driver seemed to be iHD_drv_video I tried to et environment variables:
But that changed nothing and the error message remained, still mentioning libva: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
I really have no idea how to make this work :/
Hi @skoulof, unfortunately I can't help you much, but one thing I can tell you is that troubleshooting my own installation involved a lot of "vainfo" typing in the terminal. I had to install this command with apt install vainfo
, then using it pointed me to the right direction, especially telling me which driver was being used by the system (very useful since there is obviously something strange with " iHD_drv_video" messages in the jellyfin logs). You should give it a try, it's harmless since it will only retrieve some info about your configuration.
Also, did you try downgrading ffmpeg as suggested here ?
After that, I still couldn't get Jellyfin to transcode (still with the error about driver iHD failing to initiate in the logs... strangely, since I configured i965 as preferred driver). I finally managed to make it work by downgrading ffmpeg, as suggested by @lemystere in #129 (comment)_ .
@Roxedus I just added some screenshots from Portainer providing more details about my configuration... If this is enough for you, could you please remove the "invalid" label ?
Thank you very much !
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.
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.
Hello, this issue is still not resolved, I'd like to avoid it being closed
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.
Hello, still not solved !...
I am encountering the same problem, where out of the box using the image, HW acceleration does not work. From the logs the error is:
[AVHWDeviceContext @ 0x55a4c09f4680] libva: /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x55a4c09f4680] Failed to initialise VAAPI connection: 1 (operation failed).
Device creation failed: -5.
It should be using the other driver:
abc@00d62122f28b:/$ ls /usr/lib/jellyfin-ffmpeg/lib/dri/
i965_drv_video.so iHD_drv_video.so
Running vainfo
in the host machine:
~$ vainfo
error: can't connect to X server!
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.14.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Desktop - 2.4.1
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
Running an old i7-4770
Ah, finally, I got hardware acceleration working out of the box 😹. In the jellyfin playback config, I chose "Video Acceleration API (VAAPI" instead of "Intel Quick Sync".
@Pl1997 What is your output for this ?
sudo docker exec -it <Name of your Jellyfin container> /bin/bash
/usr/lib/jellyfin-ffmpeg/vainfo | grep iHD
And what is your ffmeg version ? You can check on your log of transcoding.
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.
This is now fixed.
I tried to install Jellyfin yesterday, in Docker, with this image, on my QNAP TS-251A (celeron N3060). I had a LOT of difficulties to make HW acceleration work, but I'm not sure if it is caused by one big issue or several smaller ones.
Expected Behavior
In a perfect world, HW acceleration should work out of the box by following README instructions
Current Behavior
I had to do a huge amount of trial and error in order to make it work, getting inspiration in older issues filed on this repository.
Steps to Reproduce
I started by installing in Docker the latest image, version 10.7.7-1-ls150. As soon as I tried to play something, the UI showed this error : This client isn't compatible with the media and the server isn't sending a compatible media format
For starters, I had to add a script to custom-cont-init.d in order to fix /dev/dri permissions (original idea by @fmanno in https://github.com/linuxserver/docker-jellyfin/issues/26#issuecomment-618089750_ , I only changed chmod 755 to chmod 777).
Then I got errors in the log about driver iHD failing to initiate (
libva: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed.
) After a bit of searching, I think that my processor might be too old for this driver (not completely sure). I chose to go with i965 driver so I added a first env variable in the container (not documented in README) : LIBVA_DRIVER_NAME=i965 .Trying to make it work, I found out that the driver had been removed from the usual directory (#102), so I had to point the system to the driver embedded in FFMPEG, with an other env variable, not documented either : LIBVA_DRIVERS_PATH=/usr/lib/jellyfin-ffmpeg/lib/dri
(Side note, I ended up getting a bit better results by installing instead i965-va_drivers_shaders with a simple
apt install i965-va-driver-shaders
, in the container's — still based on latest image — console connected as root. After that I could get rid of the LIBVA_DRIVERS_PATH variable)After that, I still couldn't get Jellyfin to transcode (still with the error about driver iHD failing to initiate in the logs... strangely, since I configured i965 as preferred driver). I finally managed to make it work by downgrading ffmpeg, as suggested by @lemystere in https://github.com/linuxserver/docker-jellyfin/issues/129#issuecomment-995212155_ .
Trying to get a better understanding of the issue, I managed to make it work with a prior version of the image (10.7.7-ls146, as suggested in #141), following all of above steps, but without downgrading ffmpeg. However I'm not sure whether the HW acceleration is effectively working, since although the video does play (instead of getting "This client isn't compatible with the media and the server isn't sending a compatible media format"), I do have a strange and never-seen-before message in Jellyfin logs :
libva: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so has no function __vaDriverInit_1_0
.Environment
OS: QTS 5.0 CPU architecture: x86_64 How docker service was installed: Integrated in « Container Station » (official app by QNAP), managed via Portainer
Command used to create docker container (run/create/compose/screenshot)
I used the Portainer GUI to configure my installation, making sure that every parameter listed in your README was taken into account.
Here is a screenshot of the container details after install (please ignore the "LIBVA_DRIVERS_PATH_back variable, which is only a reminiscence from my debugging attempts — more on that below).
Docker logs
I can provide any extra log you want, of any installation mentioned above (I kept all of them for future research/reference).
Here is the one from the first installation, following the README (without the extra ENVIRONMENT VARIABLES), but with the script fixing /dev/dri permissions at startup.