[FFmpeg-devel] [PATCH] lavc/cuvid: fail early if GPU can't handle video parameters

Pavel Koshevoy pkoshevoy at gmail.com
Sun Jan 22 20:16:53 EET 2017


On Sun, Jan 22, 2017 at 9:37 AM, Pavel Koshevoy <pkoshevoy at gmail.com> wrote:
> On 01/22/2017 07:05 AM, Timo Rothenpieler wrote:
>>>
>>> Despite wm4 objections I am resubmitting this patch, because I can
>>> find no other reasonable method for rejecting ffmpeg cuvid decoder
>>> when it can't handle a given video stream.  An unreasonable
>>> alternative would be to duplicate the work that cuvid.c does
>>> internally on my application side, and that would be of little benefit
>>> to me and to ffmpeg -- I might as well use the nvenc APIs directly
>>> then.  I still see this patch as an improvement.
>>
>> Cuvid should still return an error, just not on init, while some stream
>> parameters are still unknown, but when decoding the first (couple)
>> frame(s).
>> If there is a case where it doesn't, I'd much rather fix that.
>
>
>
> It didn't return an error.  I was testing with 5K and 8K h264 samples
> mentioned at http://kodi.wiki/view/Samples on a GeForce GT 730 which only
> supports 4K 8-bit h264 -- ctx->cvdl->cuvidParseVideoData never returned an
> error, and cuvid_handle_video_sequence callback was never called.   The only
> indication I ever got from cuvid that it won't work was during
> ctx->cvdl->cuvidCreateDecoder call (after my patch).
>

I've just tested on GeForce GTX 1060 with PATAGONIA 8K mp4 sample and
I see the same behavior -- packets are accepted but the callbacks are
not called.

With the Snow Monkeys in Japan 5K Retina 60p (Ultra HD).mp4 on GeForce
1060 it actually does call the callbacks and logs errors, so that's
different from GeForce 730:

[h264_cuvid @ 0x7fff9c000980]
ctx->cvdl->cuvidDecodePicture(ctx->cudecoder, picparams) failed ->
CUDA_ERROR_INVALID_HANDLE: invalid resource handle
[h264_cuvid @ 0x7fff9c000980] cuvid decode callback error

Pavel.


More information about the ffmpeg-devel mailing list