[Libav-user] hw_decode.c example, help getting cuda decoded frame into application cuda memory
Cole Richardson
crichardson at edgeaisolutions.com
Fri May 30 21:19:50 EEST 2025
Hello,
I have been using the libav* libraries c-api here recently and it's been a
blast!
I am currently working with the ffmpeg example hw_decode.c (targeting only
cuda decoder for now) and I would like to get the hw decoded frame into my
own cuda allocated memory instead of copying to the cpu and writing to disk
as is done in the example:
https://github.com/FFmpeg/FFmpeg/blob/ab37c7e49ff98a8c32c90e6df49dd11145bc64bb/doc/examples/hw_decode.c#L108.
Additionally, I would like this frame to be in RGB colorspace.
My questions are:
1. How can I copy the hw (NV12 format) frame into my own cuda memory
(cudaMalloc from cuda_runtime.h)?
2. How can I do the colorspace conversion? Is there a way to do this
with libav* libraries prior to copying into my application memory? If not,
I could probably write my own cuda kernel or something.
Any info would be greatly appreciated!
Thank you,
- Cole
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20250530/72fc47db/attachment.htm>
More information about the Libav-user
mailing list