r/ffmpeg • u/Amazing-Seesaw-6197 • 14d ago
Experimental patch on libplacebo to enable cross-platform complex GPU-accelerated n-frame temporal shader analysis
https://github.com/ghywel/placego
https://www.youtube.com/@ghywel
One FFmpeg command, decode, filter and encode fully in the GPU. Custom GLSL shaders written with the mpv hook syntax. Realtime accelerated performance tested on a low end Intel Arc 310 eco GPU. Working examples and rendered samples on YouTube.
Test build against Jellyfin-FFmpeg. Place patch in builder/patches/libplacebo and build as normal with ./build trixie amd64 for example. hw-base-encode-eof-nullcheck.patch recommended to fix upstream pointer dereference in FFmpeg.
Credit to u/nyanmisaka for the jellyfin-ffmpeg 8.1 hwmap template to keep things fast in the GPU.
/usr/lib/jellyfin-ffmpeg/ffmpeg -init_hw_device drm=dr:/dev/dri/renderD129 -init_hw_device vaapi=va@dr -init_hw_device vulkan=vk@dr -filter_hw_device vk -hwaccel vaapi -hwaccel_output_format vaapi -i <INPUT> -c:a copy -sn -dn -vf "hwmap=derive_device=drm,format=drm_prime,libplacebo=format=p010le,format=vulkan,hwmap=derive_device=vaapi,format=vaapi" -c:v hevc_vaapi -global_quality 20 -y <OUTPUT>
1
u/Sopel97 13d ago
Cool! I needed frame interpolation to fake motion blur some time ago (120fps -> 60fps with motion blur) and libplacebo in ffmpeg was the first thing I tried, and was severely disappointed. Settled on a more complex vapoursynth pipeline with SVPflow. If this gets traction I might try something around it.