[FFmpeg-devel] [PATCH] avcodec/v4l2_m2m_enc: Check encoder pix_fmt matches pix_fmt on device

Andriy Gelman andriy.gelman at gmail.com
Tue Nov 12 05:56:51 EET 2019


On Mon, 11. Nov 07:05, Carl Eugen Hoyos wrote:
> 
> 
> > Am 11.11.2019 um 04:42 schrieb Andriy Gelman <andriy.gelman at gmail.com>:
> > 
> > +    /* check configured pix_fmt matches avctx->pix_fmt */
> 
> Is this comment really useful?

ok, will remove

> 
> > +    pix_fmt_output = ff_v4l2_format_v4l2_to_avfmt(v4l2_fmt_output, AV_CODEC_ID_RAWVIDEO);
> > +    if (pix_fmt_output != avctx->pix_fmt) {
> > +        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt_output);
> > +        av_log(priv, AV_LOG_ERROR, "Pixel format not configured. Encoder requires %s "
> 
> 
> > +                                   " pixel format. On command line add setting:"
> > +                                   " -pix_fmt %s to force correct pixel format.\n",
> 
> This should be rarely printed by a library, I don’t think this is a good exception.

I thought it would be useful to tell the user how to solve the problem. 

I can modify the docs instead and add option -list_pix_fmt
that tells the user what pixel formats are supported?

-- 
Andriy


More information about the ffmpeg-devel mailing list