Dear ffmpeg devs,
 
With the update of FFMPEG 7 to FFMPEG 8, I stumbled on an issue and wonder 
whether `hwupload` became more strict, requiring a device to be specified in 
ffmpeg 8 as opposed with ffmpeg 7, where it worked implicitly:
 
When enabling VA-API Hardware decode (AMD Graphics Card) on Nextcloud App 
Memories, playing a video errors out. I traced this to ffmpeg erroring out due 
to `hwupload` complaining about  `A hardware device reference is required to 
upload frames to.`, which is documented in 
https://github.com/NixOS/nixpkgs/issues/473008 and 
https://github.com/pulsejet/memories/issues/1591 as issues.
 
Nextcloud Memories calls ffmpeg like so: `ffmpeg -hwaccel vaapi -hwaccel_device 
/dev/dri/renderD128 -hwaccel_output_format vaapi -i 'sample.mp4' -vf 
"format=nv12|vaapi,hwupload,scale_vaapi=w=854:h=854:format=nv12" -vcodec 
h264_vaapi EncodeTest/output-www-data2.mp4`
 
This works with FFMPEG 7, but does not work with FFMPEG 8, which errors out 
with `[hwupload @ 0x55d77ee7d240] A hardware device reference is required to 
upload frames to.`
 
Nextcloud's memories does not specify `init_hw_device`, so when my server's 
system packages updated ffmpeg 7 to ffmpeg 8, it broke video playback for all 
users. Forcing dependency ffmpeg down to version 7 fixes this.
 
Reading the docs: https://trac.ffmpeg.org/wiki/Hardware/VAAPI#DeviceSelection 
and specifying a device fixes the above example in ffmpeg 8 and no more error 
occurs:
`ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 
-hwaccel_output_format vaapi -i 'sample.mp4' -init_hw_device 
vaapi=foo:/dev/dri/renderD128 -filter_hw_device foo -vf 
"format=nv12|vaapi,hwupload,scale_vaapi=w=854:h=854:format=nv12" -vcodec 
h264_vaapi EncodeTest/output-www-data2.mp4`
 
So this makes me wonder, was this changed on purpose going to ffmpeg 8? Is 
`init_hw_device` a requirement now, whereas in ffmpeg 7 it was done implicitly?
 
Best regards,
 
-- 
 
Wladislav Artsimovich 🇩🇪 🇷🇺 🇬🇧 🇯🇵
✍ TechBlog: https://blog.frost.kiwi/ 
▶ YouTube Channel: https://www.youtube.com/@FrostKiwi/
 
_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to