Debug Intel QSV en/decoding on a 12th Gen Intel CPU

@sogan lets start here
21 Replies
svenger87
svenger87OP2y ago
So this is the debug output on my Jellyfin LXC container:
sogan
sogan2y ago
this will be a bit trial and error, but from the logs it seems it's down to libmfx not working as expected with this cpu. 12th gen is in an interesting spot where it's supported by both the older libmfx and the newer libvpl. try passing INTEL_MEDIA_RUNTIME=ONEVPL to the container
svenger87
svenger87OP2y ago
I just have seen it happens inside the LXC container already. Let me debug that first why it happens already at that stage. The LXC has the same config as the jellyfin one.
svenger87
svenger87OP2y ago
jellyfin-ffmpeg6 = does not work. jellyfin-ffmpeg5 = works Let me downgrade it in the microservices container.
svenger87
svenger87OP2y ago
@sogan works lol
No description
svenger87
svenger87OP2y ago
I used this release. https://github.com/jellyfin/jellyfin-ffmpeg/releases/tag/v5.1.3-4 Don´t know if it makes sense to raise an issue in the repo.
GitHub
Release Release 5.1.3-4 · jellyfin/jellyfin-ffmpeg
What's Changed Add VUI info to the seq header of HEVC VA-API encoder Remove HDR metadata from tonemap_vaapi SDR output Backport QSV fixes from upstream Fix VA-API import DRM prime2 planar form...
svenger87
svenger87OP2y ago
Okay. But this seems to have an Issue with iPhone HEVC videos. Asking in the jellyfin discord. I was able to strip this down. Only 240fps SloMos are failing with QSV now. Thats an case where one could live with. But are you able to downgrade jellyfin-ffmpeg6 to 5.13?
sogan
sogan2y ago
13th gen cpus require libvpl which is shipped in 6.0. if it’s working with 5.1.3, i’m thinking that it’s because it’s using libmfx without any ambiguity
svenger87
svenger87OP2y ago
Launchpad
Bug #1970637 “ffmpeg depends on libmfx-gen1.2 on Alder Lake for ......
On Intel 12th gen CPUs (Alder Lake), ffmpeg requires package libmfx-gen1.2 to use QSV hardware decoding/encoding, but it's not marked as a dependency and therefore not installed with ffmpeg. As stated on https://github.com/Intel-Media-SDK/MediaSDK#media-sdk-support-matrix, ADL-S, ADL-P and future Intel CPUs are not supported by libmfxhw64.so.1....
svenger87
svenger87OP2y ago
Seems like a known bug
sogan
sogan2y ago
that dependency caught my eye in the article you shared as well. can you try installing libmfx-gen1.2 to see if that works?
svenger87
svenger87OP2y ago
No. Doesn´t work.
svenger87
svenger87OP2y ago
GitHub
Error during set display handle · Issue #233 · intel/cartwheel-ffmp...
Trying to get the Intel Arc A380 AV1 Encoder working on Linux 6.2 🟢 Issue re-cap / progress update: #233 (comment) ➡️ Moved to new issue: #235 Ubuntu 23.04 daily build: https://cdimage.ubuntu.com/d...
svenger87
svenger87OP2y ago
Same issue here. Seems like there is no proper fix for ffmpeg6 yet.
sogan
sogan2y ago
yeah at that point i'm running low on suggestions 😅 you could maybe try INTEL_MEDIA_RUNTIME=MSDK?
svenger87
svenger87OP2y ago
Tried. No difference.
sogan
sogan2y ago
your best bet in that case is to just stick with the ffmpeg5 release you have installed. hopefully they release a fix for this
svenger87
svenger87OP2y ago
But that requires me to edit the container after every reboot and Immich update. Maybe I edit my systemd script to do that for me.
sogan
sogan2y ago
you could make a dockerfile with the release as the base image and add the command to install jellyfin-ffmpeg5. not ideal, but it will at least make it less manual.
svenger87
svenger87OP2y ago
I extended ,my systemd startscript for immich. Pretty hacky but does what i need 😄
# Script: immich-app-update.sh
# Description: Updates the immich application using Docker Compose and systemd.
# Downgrades ffmpeg-jellyfin6 package to version 5.

# Set the working directory
APP_DIR="/root/immich-app/"

# Docker container name
MICROSERVICES_CONTAINER="immich_microservices"

# Package URL
FFMPEG_PACKAGE_URL="https://github.com/jellyfin/jellyfin-ffmpeg/releases/download/v5.1.3-4/jellyfin-ffmpeg5_5.1.3-4-kinetic_amd64.deb"

# Pull the latest images
echo "Pulling the latest images..."
cd "$APP_DIR" && docker-compose pull

# Stop the immich service
echo "Stopping immich service..."
if ! systemctl stop immich; then
echo "Failed to stop immich service."
exit 1
fi

# Start the immich service
echo "Starting immich service..."
if ! systemctl start immich; then
echo "Failed to start immich service."
exit 1
fi

# Wait for the service to start
echo "Waiting for immich service to start..."
sleep 20

# Remove jellyfin-ffmpeg6 package
echo "Removing jellyfin-ffmpeg6 package..."
docker exec "$MICROSERVICES_CONTAINER" apt-get remove -y jellyfin-ffmpeg6

# Download and install ffmpeg-jellyfin5 package
echo "Downloading and installing ffmpeg-jellyfin5 package..."
FFMPEG_PACKAGE_NAME="jellyfin-ffmpeg5_5.1.3-4-kinetic_amd64.deb"
wget -O "$FFMPEG_PACKAGE_NAME" "$FFMPEG_PACKAGE_URL"
docker cp "$FFMPEG_PACKAGE_NAME" "$MICROSERVICES_CONTAINER:/tmp/"
docker exec "$MICROSERVICES_CONTAINER" dpkg -i "/tmp/$FFMPEG_PACKAGE_NAME"
rm "$FFMPEG_PACKAGE_NAME"

# Clean up Docker resources
echo "Cleaning up Docker resources..."
docker system prune -a -f
docker system prune --volumes -f

echo "Update and installation completed."
# Script: immich-app-update.sh
# Description: Updates the immich application using Docker Compose and systemd.
# Downgrades ffmpeg-jellyfin6 package to version 5.

# Set the working directory
APP_DIR="/root/immich-app/"

# Docker container name
MICROSERVICES_CONTAINER="immich_microservices"

# Package URL
FFMPEG_PACKAGE_URL="https://github.com/jellyfin/jellyfin-ffmpeg/releases/download/v5.1.3-4/jellyfin-ffmpeg5_5.1.3-4-kinetic_amd64.deb"

# Pull the latest images
echo "Pulling the latest images..."
cd "$APP_DIR" && docker-compose pull

# Stop the immich service
echo "Stopping immich service..."
if ! systemctl stop immich; then
echo "Failed to stop immich service."
exit 1
fi

# Start the immich service
echo "Starting immich service..."
if ! systemctl start immich; then
echo "Failed to start immich service."
exit 1
fi

# Wait for the service to start
echo "Waiting for immich service to start..."
sleep 20

# Remove jellyfin-ffmpeg6 package
echo "Removing jellyfin-ffmpeg6 package..."
docker exec "$MICROSERVICES_CONTAINER" apt-get remove -y jellyfin-ffmpeg6

# Download and install ffmpeg-jellyfin5 package
echo "Downloading and installing ffmpeg-jellyfin5 package..."
FFMPEG_PACKAGE_NAME="jellyfin-ffmpeg5_5.1.3-4-kinetic_amd64.deb"
wget -O "$FFMPEG_PACKAGE_NAME" "$FFMPEG_PACKAGE_URL"
docker cp "$FFMPEG_PACKAGE_NAME" "$MICROSERVICES_CONTAINER:/tmp/"
docker exec "$MICROSERVICES_CONTAINER" dpkg -i "/tmp/$FFMPEG_PACKAGE_NAME"
rm "$FFMPEG_PACKAGE_NAME"

# Clean up Docker resources
echo "Cleaning up Docker resources..."
docker system prune -a -f
docker system prune --volumes -f

echo "Update and installation completed."

Did you find this page helpful?