frigate icon indicating copy to clipboard operation
frigate copied to clipboard

docker: Add VAAPI to arm64

Open stgraber opened this issue 2 years ago • 7 comments

This adds the needed bits for VAAPI to be available on arm64.

Worth noting that the current jellyfin build does not include vaapi support, so I'm currently running with an alternate build of it which is then mapped directly to /usr/lib/jellyfin-ffmpeg. This works fine for now until I can convince the jellyfin folks to build with --enable-vaapi too :)

stgraber avatar Jul 20 '22 15:07 stgraber

Worth noting that the current jellyfin build does not include vaapi support

This being just for arm64 arch right? vaapi works fine in amd64 arch with jellyfin

NickM-27 avatar Jul 20 '22 15:07 NickM-27

That's right. They build ffmpeg with vaapi on amd64 but not on the other architectures.

I ended up rebuilding their package with it enabled and then side loading that into my Frigate container, worked fine. So this suggests there's no particular reason not to build ffmpeg with it enabled.

stgraber avatar Jul 20 '22 20:07 stgraber

Can you describe the process you used to "side load" a different ffmpeg version?

blakeblackshear avatar Jul 21 '22 12:07 blakeblackshear

Can you describe the process you used to "side load" a different ffmpeg version?

Sounds like a simple volume mount, something like:

-v /home/stgraber/ffmpeg-build/bin/ffmpeg:/usr/lib/jellyfin-ffmpeg

Parlane avatar Jul 21 '22 20:07 Parlane

Yep, that's exactly what I'm doing :)

  -v /data/frigate/ffmpeg:/usr/lib/jellyfin-ffmpeg

stgraber avatar Jul 21 '22 20:07 stgraber

The switch to jellyfin-ffmpeg actually made this much easier as it's all nicely self-contained in one directory rather than spread across the filesystem :)

stgraber avatar Jul 21 '22 20:07 stgraber

@stgraber This happens to affect me too. Would you be willing to share your process for building the custom jellyfin-ffmpeg in the meantime, possibly for inclusion into the docs?

zeroping avatar Aug 06 '22 05:08 zeroping

@zeroping I cloned https://github.com/jellyfin/jellyfin-ffmpeg, then altered debian/rules and debian/control to add a basic dependency on vaapi:

root@docker01:~/jellyfin-ffmpeg# git diff
diff --git a/debian/control b/debian/control
index 53373799..62e65b8c 100644
--- a/debian/control
+++ b/debian/control
@@ -60,7 +60,7 @@ Build-Depends:
 # which will be shipped with jellyfin-ffmpeg package.
 # Vaapi currently only supports Intel and AMD gfx
 # and the drivers they provide only support x86/x64.
-# libva-dev [!armhf !arm64],
+ libva-dev [arm64],
 #
 # --enable-nvenc/--enable-nvdec
 # [!armhf] is needed otherwise mk-build-deps creates an invalid build
diff --git a/debian/rules b/debian/rules
index e20e2fd7..5287a9d5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -57,6 +57,7 @@ CONFIG_ARM := ${CONFIG_ARM_COMMON} \
 CONFIG_ARM64 := ${CONFIG_ARM_COMMON} \
        --arch=arm64 \
        --cross-prefix=/usr/bin/aarch64-linux-gnu- \
+       --enable-vaapi \
 
 CONFIG_x86 := --arch=amd64 \
        --enable-libshaderc \

And then built the whole thing by running ./build bullseye arm64

You'll end up with a bin/jellyfin-ffmpeg5_5.0.1-8-bullseye_arm64.deb or similar file in the parent directory. Unpack this with dpkg and you'll get the directory you need to replace.

stgraber avatar Aug 13 '22 17:08 stgraber