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

Timo Rothenpieler timo at rothenpieler.org
Tue Jan 10 14:29:03 EET 2017


> The real problem I am trying to solve -- I need to find the "best"
> decoder for the incoming stream, or file.  There are multiple decoders
> available for H264 ... Selecting based on supported output pixel
> formats would eliminate some.  Selecting based on AVCodecParameters
> would allow to eliminate those decoders that can't handle given
> parameters, although that appears to be insufficient.  Perhaps
> selecting based on given codec extradata (PPS/SPS) would be more
> robust.  extradata is usually part of the bitstream... is there an API
> to feed extradata to the decoder to see if it likes it?

At least cuvid does just that on init:
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/cuvid.c;h=8fc713d08166617696b3dcf86d0f1dbe9d3bd41d;hb=HEAD#l839

I have never seen it fail because of it.
You can send random garbage and it doesn't ever fail.
Never tried a valid but unsupported set of headers though.


More information about the ffmpeg-devel mailing list