[FFmpeg-devel] [PATCH] Added the possibility to pass an externally created CUDA context to libavutil/hwcontext.c/av_hwdevice_ctx_create() for decoding with NVDEC

Oscar Amoros Huguet oamoros at mediapro.tv
Mon May 7 20:37:32 EEST 2018


I was looking at the NVIDIA Video codec sdk samples (https://developer.nvidia.com/nvidia-video-codec-sdk#Download), where you can find the header NvDecoder.h next to cuviddec.h where CUVIDPROCPARAMS is defined.

Anyway, I should have looked at ffmpeg code directly, to see what’s being used, sorry for that.

Great then! Having the same cuda stream (either default or custom) for everything is the safest and most efficient way to go (in this case).

Thanks, and let me know if I can help with anything.

Oscar

> El 7 maig 2018, a les 18:43, Timo Rothenpieler <timo at rothenpieler.org> va escriure:
> 
> Am 07.05.2018 um 18:25 schrieb Oscar Amoros Huguet:
>> Have a look at this, looks pretty interesting:
>> /**
>>     *   @brief  This function decodes a frame and returns the locked frame buffers
>>     *   This makes the buffers available for use by the application without the buffers
>>     *   getting overwritten, even if subsequent decode calls are made. The frame buffers
>>     *   remain locked, until ::UnlockFrame() is called
>>     */
>>     bool DecodeLockFrame(const uint8_t *pData, int nSize, uint8_t ***pppFrame, int *pnFrameReturned, uint32_t flags = 0, int64_t **ppTimestamp = NULL, int64_t timestamp = 0, CUstream stream = 0);
>> Oscar
> 
> I'm not sure what API docs you are referring to here.
> Google has never seen them either.
> 
> But CUVIDPROCPARAMS, which is passed to cuvidMapVideoFrame, does indeed have
> CUstream output_stream;/**< IN: stream object used by cuvidMapVideoFrame */
> So setting the stream there would be easily possible.
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel



More information about the ffmpeg-devel mailing list