On 10/10/2024 06:05, martin schitter wrote:
Can someone here point me to an example, how to use GPU acceleration outside of external hw_decode/encode facilities or vulkan_filters, just as more suitable compute mechanism and for better float image data support in ordinary ffmpeg code modules?Most examples and documentation are only focused on external hardware accelerated en-/decoding or isolated vulkan/placebo filters, but I'm more interested in using compute shaders just as alternative execution path in common ffmpeg code whenever the required hardware is accessible. It would be very helpful to have an instructive working example for efficient use of this kind of more silent GPGPU inclusion.
You can copy libavutil/vulkan* into whatever project you want, and change 4 #include lines to make it compile. This lets you use the same API to construct and execute shaders as you would within lavc/lavfi/lavu into your own project. You will need to make libavutil a dependency as hwcontext_vulkan.c cannot be exported and must remain within libavutil.
That's what I did for https://github.com/cyanreg/ldpc_matrix_opt/ Works great thanks to all the work I put in.Otherwise, of course you can do it the long way by either writing your own or using another framework.
OpenPGP_0xA2FEA5F03F034464.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".