Re: [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

2018-05-08 Thread Timo Rothenpieler
On 08.05.2018 10:11, Oscar Amoros Huguet wrote: > Thank you so much! > > We will test this hopefully today, and verify the expected behavior with > NSIGHT. > > By the way, I'm new to ffmpeg, so... I don't know if you use your fork to > test things first, before adding the changes to the main ff

Re: [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

2018-05-08 Thread Oscar Amoros Huguet
your fork? Thanks! -Original Message- From: ffmpeg-devel On Behalf Of Timo Rothenpieler Sent: Tuesday, May 8, 2018 12:11 AM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH] Added the possibility to pass an externally created CUDA context to libavutil/h

Re: [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

2018-05-07 Thread Timo Rothenpieler
Am 07.05.2018 um 19:37 schrieb Oscar Amoros Huguet: 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

Re: [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

2018-05-07 Thread Oscar Amoros Huguet
: Re: [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 On 26.04.2018 18:03, Oscar Amoros Huguet wrote: > Thanks Mark, > > You are right, we can implement in our code

Re: [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

2018-05-07 Thread Oscar Amoros Huguet
Hi! Even if there is need to have a syncronization before leaving the ffmpeg call, callin cuMemcpyAsync will allow the copies to overlap with any other task on the gpu, that was enqueued using any other non-blocking cuda stream. That’s exactly what we want to achieve. This would benefit automa

Re: [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

2018-05-07 Thread Oscar Amoros Huguet
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, sorr

Re: [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

2018-05-07 Thread Timo Rothenpieler
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 o

Re: [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

2018-05-07 Thread Oscar Amoros Huguet
--- From: ffmpeg-devel On Behalf Of Timo Rothenpieler Sent: Monday, May 7, 2018 5:13 PM To: ffmpeg-devel@ffmpeg.org Subject: Re: [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 A

Re: [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

2018-05-07 Thread Oscar Amoros Huguet
el On Behalf Of Timo Rothenpieler Sent: Monday, May 7, 2018 5:13 PM To: ffmpeg-devel@ffmpeg.org Subject: Re: [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 Am 07.05.2018 um 17:05 sch

Re: [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

2018-05-07 Thread Timo Rothenpieler
Am 07.05.2018 um 17:05 schrieb Oscar Amoros Huguet: To clarify a bit what I was saying in the last email. When I said CUDA non-blocking streams, I meant non-default streams. All non-blocking streams are non-default streams, but non-default streams can be blocking or non-bloking with respect to

Re: [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

2018-05-07 Thread Oscar Amoros Huguet
Sent: Monday, May 7, 2018 2:05 PM To: FFmpeg development discussions and patches Subject: Re: [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 Hi! Even if there is need to have a

Re: [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

2018-05-07 Thread Timo Rothenpieler
>> Additionally, could you give your opinion on the feature we also may want to add in the future, that we mentioned in the previous email? Basically, we may want to add one more CUDA function, specifically cuMemcpy2DAsync, and the possibility to set a CUStream in AVCUDADeviceContext, so it is used

Re: [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

2018-05-07 Thread Timo Rothenpieler
On 26.04.2018 18:03, Oscar Amoros Huguet wrote: > Thanks Mark, > > You are right, we can implement in our code a sort of "av_hwdevice_ctx_set" > (which does not exist), by using av_hwdevice_ctx_alloc() + > av_hwdevice_ctx_init(). We actually use av_hwdevice_ctx_alloc in our code to > use the fe

Re: [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

2018-04-26 Thread Oscar Amoros Huguet
Thanks Mark, You are right, we can implement in our code a sort of "av_hwdevice_ctx_set" (which does not exist), by using av_hwdevice_ctx_alloc() + av_hwdevice_ctx_init(). We actually use av_hwdevice_ctx_alloc in our code to use the feature we implemented already. We are not sure about license

Re: [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

2018-04-22 Thread Mark Thompson
On 19/04/18 17:00, Oscar Amoros Huguet wrote: > > Hi! > > We changed 4 files in ffmpeg, libavcodec/nvdec.c, libavutil/hwcontext.c, > libavutil/hwcontext_cuda.h, libavutil/hwcontext_cuda.c. > > The purpose of this modification is very simple. We needed, for performance > reasons (per frame exec

[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

2018-04-20 Thread Oscar Amoros Huguet
Hi! We changed 4 files in ffmpeg, libavcodec/nvdec.c, libavutil/hwcontext.c, libavutil/hwcontext_cuda.h, libavutil/hwcontext_cuda.c. The purpose of this modification is very simple. We needed, for performance reasons (per frame execution time), that nvdec.c used the same CUDA context as we us