[FFmpeg-devel] cuda-gl

Daniel Oberhoff danieloberhoff at googlemail.com
Mon Apr 30 18:20:41 EEST 2018


> On 30. Apr 2018, at 15:52, Daniel Oberhoff <danieloberhoff at googlemail.com> wrote:
> 
> Hello All,
> 
> I am fighting since a few days to get the frames from the cuvid decoder using the cuda pixel format transfered to opengl.
> 
> What i have done is create textures on gl using glGenTextures and glTexStorage2D. The actual format is NV12 in my case, and i properly allocate two planes with the first one being full size, 1bpp, and the second size halve size (in both dimensions) and 2bpp. The transfer is done with cuGraphicsMapResources, cuGraphicsSubResourceGetMappedArray, cuMemcpy2DAsync, cuGraphicsUnmapResources, running on an allocated stream, followed by cuStreamSynchronize. But when i draw this (i have a yuv aware shader) i am missing all the red information, as if the v channel where 0 everywhere.
> 
> Has anyone succeeded in this before? It seems like someone at least has interest in this, given that the needed functions appeared in nv_codec_headers recently.

Ok

So i found i had a very stupid mistake where the code later assumed triplanar pixel format. Sorry for spamming, works like a charm :).


Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180430/db5b33d7/attachment.sig>


More information about the ffmpeg-devel mailing list