[Libav-user] Using externally created cuda buffers for AVFrames (decoding)

Korcan Hussein korcan_h at hotmail.com
Mon Oct 11 02:08:50 EEST 2021


Hi, I have a cuda buffer that has been imported from external memory (e.g. GL/D3D textures), I wanted to know if it is possible to use this buffer as a target for AVFrames that are passed to avcodec_receive_frame based on a cuvid based decoder. I've attemped to do this in various ways but it seems to be always ignored and the cuvid decoder will internally allocate (or re-use from a pool?) it's own cuda buffer instead of my own created one.

Basically I would like to use libav to decode a frame directly to user provided (imported/interop'ed) texture that I can then use for rendering. I would like to avoid device -> host -> device transfers or additional device buffers & mem copies.

I would also like to know if this is possible in geneal with libav's hw-accelerated api, for other other decoders as I would like to support multiple graphics APIs and hw-accel decoders.

Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20211010/87e8a120/attachment.htm>


More information about the Libav-user mailing list