Intel-Media-SDK / MediaSDK

The Intel® Media SDK
MIT License
926 stars 457 forks source link

ffmpeg decoded qsv avframe transfered to opengl texture #2966

Open linxierr opened 2 years ago

linxierr commented 2 years ago

Hi there, I am currently using ffmpeg qsv_h264 and opengl redering on windows , is there any api that can transfer the decode frame to opengl texture to make the 0-copy rendering, thank you.

wangyan-intel commented 2 years ago

@xhaihao Could you please give some comments?

xhaihao commented 2 years ago

av_hwframe_map() may map a qsv frame to a d3d11 frame, then you may use the d3d11 frame in your app. See https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/hwcontext.h#L543-L583

linxierr commented 2 years ago

av_hwframe_map() may map a qsv frame to a d3d11 frame, then you may use the d3d11 frame in your app. See https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/hwcontext.h#L543-L583

very appreciate it, thank you, and I'll try to research how to share the memory for d3d11 and opengl.

By the way, Do mediaSDK has the similar function like the link refers for cuda https://www.qtav.org/blog/cuda_0_copy.html.