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

Pavel Koshevoy pkoshevoy at gmail.com
Mon Jan 9 20:26:43 EET 2017


On Sun, Jan 8, 2017 at 2:53 PM, Hendrik Leppkes <h.leppkes at gmail.com> wrote:
> On Tue, Jan 3, 2017 at 8:26 AM,  <pkoshevoy at gmail.com> wrote:

>> +    ret = convert_to_cuda_video_chroma_format(avctx->pix_fmt, &probed_chroma_format);
>> +    if (ret < 0) {
>> +        // pixel format is not supported:
>> +        return ret;
>> +    }
>
> Generally, there is no guarantee that any of these properties are
> already set when init is called. When you use avformat->avcodec, it'll
> generally try to probe them from the stream, however if someone just
> uses avcodec, the h264 software decoder for example works independent
> of dimensions or pixfmt set - because it can determine this from the
> bitstream.
>
> So what I'm trying to say, failing when you detect an explicitly
> incompatible value might be OK, but failing when its unset seems like
> it might be annoying.
>


You are right, that was my oversight.  I've posted a new version of
the patch -- if avctx->pix_fmt is unset assume YUV420P.

Thank you,
    Pavel.


More information about the ffmpeg-devel mailing list