Closed lemystere closed 2 years ago
I tried the solution in this issue and it make my vaapi work. But quick sync just don't.
I fixed this for myself building a container based on the Linuxserver container for Jellyfin:
FROM ghcr.io/linuxserver/jellyfin
RUN set -ex; \
env DEBIAN_FRONTEND=noninteractive apt -y update; \
env DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends full-upgrade; \
env DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install vainfo; \
env DEBIAN_FRONTEND=noninteractive apt -y clean; \
rm -rf /var/cache/apt/archives/*
RUN set -ex; \
curl -fLSso /tmp/jellyfin-ffmpeg.deb '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 /tmp/jellyfin-ffmpeg.deb; \
rm -f /tmp/jellyfin-ffmpeg.deb; \
ln -f /usr/lib/x86_64-linux-gnu/libva* /usr/lib/jellyfin-ffmpeg/lib/
In effect it upgrades the OS, installs the correct jellyfin-ffmpeg package, and replaces the VA-API implementation that jellyfin-ffmpeg uses with the one from the OS. I have a cron job that tries to pull the ghcr.io/linuxserver/jellyfin
container and, if there's a new version, rebuilds my Jellyfin container using the above Dockerfile.
@Prototyped is this in essence what the Jellyfin-AMD Docker Mod does? I.e. could this be combined with that in order to get VAAPI working with AMD iGPUs?
Looks like that Docker mod installs (at container start rather than container build) Radeon DRI/DRM drivers and Mesa VA-API and VDPAU drivers from a third-party apt repo. My Dockerfile doesn't do that at all -- it just installs an up to date VA-API and then replaces the VA-API libraries under jellyfin-ffmpeg with it. You could combine them if you wanted -- nothing my Dockerfile does precludes the use of the Docker Mod -- but in my opinion if you're already building a container image, you're better off just doing it all directly in the Dockerfile rather than bothering with the Docker Mod.
@Prototyped good call on the modifications all in Dockerfile; however this container already uses files in the /root/etc/cont-init.d
directory, so they could just be added there?
Also, in the Reddit link you included, the permissions on /dev/dri
are specified as rwm, not rwx as you have it in your PR. Would you mind elaborating on that?
As I said there's nothing preventing anyone from just using the Docker Mod files. Having stuff installed on container launch isn't as good as actually baking the changes into the image though.
I don't think I included any Reddit link and didn't think I'd submitted a PR so unsure what you're talking about.
Oh you're right, I'm getting my wires crossed with a different effort to change permissions to the /dev/dri
directory, apologies! Thanks for the Dockerfile; I'm going to follow your lead with it
Has this issue been looked at? I'm having the same error when the transcoding used to work before.
[AVHWDeviceContext @ 0x5582eb0ea7c0] libva: /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so has no function __vaDriverInit_1_0 [AVHWDeviceContext @ 0x5582eb0ea7c0] Failed to initialise VAAPI connection: -1 (unknown libva error). Device creation failed: -5. Failed to set value '/dev/dri/renderD128' for option 'vaapi_device': Input/output error Error parsing global options: Input/output error
version: "2.1" services: jellyfin: image: ghcr.io/linuxserver/jellyfin container_name: jellyfin group_add:
/dev/shm/JellyfinTranscode:/transcode
devices:
Let me know if more information is required.
The issue seems to persist with ls143, the fix @Prototyped provided above still does the trick though.
The issue seems to persist with ls143, the fix @Prototyped provided above still does the trick though.
Hi @juic3pow3rs, how do you use @Prototyped code?
Thanks
@mbourd25 You can simply do :
sudo docker exec -it "Name of your Jellyfin container" bash
apt -y update && apt -y --no-install-recommends full-upgrade && apt -y --no-install-recommends install vainfo && apt -y clean && rm -rf /var/cache/apt/archives/* && curl -fLSso /tmp/jellyfin-ffmpeg.deb '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 /tmp/jellyfin-ffmpeg.deb && rm -f /tmp/jellyfin-ffmpeg.deb && ln -f /usr/lib/x86_64-linux-gnu/libva* /usr/lib/jellyfin-ffmpeg/lib/
Warning, if you update your container, you have to re-do these two commands.
Hi @lemystere, sorry for the lateness in my response, your command works like a charm. AMD transcoding is back working.
How can we tell the Jellyfin developers about this?
Thanks for the help.
Hell @mbourd25, I guess we are at the right place. But it’s a well known problem if you install Jellyfin "manually" so I imagine there is not a lot to do about it.
Also, if you don't want to re-do the command evry time you update, you can create the script below in order to update Jellyfin. You have to create a file with a '.sh" extension in your folder "/path to config/jellyfin/custom-cont-init.d/". In the file you have to write :
if [[ "$(apt list jellyfin-ffmpeg 2>/dev/null | sed '2q;d')" != "jellyfin-ffmpeg/now 4.3.2-1-focal amd64 [installed,local]" ]]; then
echo "**** update transcoding ****"
apt -y update
apt -y --no-install-recommends full-upgrade
apt -y --no-install-recommends install vainfo
apt -y clean && rm -rf /var/cache/apt/archives/*
curl -fLSso /tmp/jellyfin-ffmpeg.deb '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 /tmp/jellyfin-ffmpeg.deb
rm -f /tmp/jellyfin-ffmpeg.deb
ln -f /usr/lib/x86_64-linux-gnu/libva* /usr/lib/jellyfin-ffmpeg/lib/
fi
Every time your container will start, this script will be read. If your jellyfin-ffmpeg is already on the good version this script will do nothing. If not, the script will update to the good version like the command before.
Also, if you don't want to re-do the command evry time you update, you can create the script below in order to update Jellyfin. You have to create a file with a '.sh" extension in your folder "/path to config/jellyfin/custom-cont-init.d/". In the file you have to write :
if [[ "$(apt list jellyfin-ffmpeg 2>/dev/null | sed '2q;d')" != "jellyfin-ffmpeg/now 4.3.2-1-focal amd64 [installed,local]" ]]; then echo "**** update transcoding ****" apt -y update apt -y --no-install-recommends full-upgrade apt -y --no-install-recommends install vainfo apt -y clean && rm -rf /var/cache/apt/archives/* curl -fLSso /tmp/jellyfin-ffmpeg.deb '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 /tmp/jellyfin-ffmpeg.deb rm -f /tmp/jellyfin-ffmpeg.deb ln -f /usr/lib/x86_64-linux-gnu/libva* /usr/lib/jellyfin-ffmpeg/lib/ fi
Thanks! @lemystere
I suppose the script should be made executable too.
@mbourd25 You can simply do :
sudo docker exec -it "Name of your Jellyfin container" bash apt -y update && apt -y --no-install-recommends full-upgrade && apt -y --no-install-recommends install vainfo && apt -y clean && rm -rf /var/cache/apt/archives/* && curl -fLSso /tmp/jellyfin-ffmpeg.deb '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 /tmp/jellyfin-ffmpeg.deb && rm -f /tmp/jellyfin-ffmpeg.deb && ln -f /usr/lib/x86_64-linux-gnu/libva* /usr/lib/jellyfin-ffmpeg/lib/
Warning, if you update your container, you have to re-do these two commands.
Thanks a huge lot for this ! In order to make this workaround work, I also had to add two environments variable : LIBVA_DRIVERS_PATH=/usr/lib/jellyfin-ffmpeg/lib/dri and LIBVA_DRIVER_NAME=i965 (maybe related to #105 and #102 ?)
Please tell me if I can provide any useful info to fix these issues !
Hey @Pl1997 The latest image works for me and has been fixed; #136
Thanks for the heads up but unfortunately I am already running the latest image... I suppose #136 wasn't able to solve my issue because I'm using i965 driver (I have an old N3060 processor, I guess that's why it doesn't work with iHD...)
It's seems that the new versions solve this issue.
Expected Behavior
When hardware transcoding is enable in the settings, Jellyfin would transcode medias that need to be transcode or if the user wants to transcode because he wants a lower bitrate. Note that in the version 10.7.6-1-ls130 it's working perfectly fine.
Current Behavior
When hardware transcoding is enable, Jellyfin dosen't transcode.
Steps to Reproduce
Environment
OS: Ubuntu CPU architecture: x86_64 How docker service was installed: With "stacks" on Portainer.
Command used to create docker container (run/create/compose/screenshot)
FFmpeg logs