[FFmpeg-devel] [PATCH] svq1dec: Ensure that pixel format constraints are respected

Vittorio Giovara vittorio.giovara at gmail.com
Wed Jul 18 16:54:16 EEST 2018


2018-07-17 21:39 GMT+02:00, Carl Eugen Hoyos <ceffmpeg at gmail.com>:
> 2018-07-17 21:39 GMT+02:00, Vittorio Giovara <vittorio.giovara at gmail.com>:
> > YUV410P requires that sizes are divisible by 4. There seem to be
> > some encoders that ignore that and encode a different value in
> > the bitstream itself. Handle that case by exporting the relative
> > cropping information.
>
>Can you provide a sample?
>
>Thank you, Carl Eugen

It is possible to generate samples affected by this bug with the svq1 or
ffv1 encoders, like this:

./ffmpeg -f lavfi -i testsrc -s 190x240 -t 1 -pix_fmt yuv410p -c:v ffv1 output-yuv410p.avi

A prime example where the generated sample will fail is with a strict
scaler, such as zimg:

./ffmpeg -i output-yuv410p.avi -vf zscale -f null -

which will fail with

code 1027: image dimensions must be divisible by subsampling factor
Error while filtering: Generic error in an external library
Failed to inject frame into filter network: Generic error in an external library
Error while processing the decoded data for stream #0:0


While the proposed patch won't directly fix the issue with zscale, it will
offer tools for API users to adjust sizes accrodingly, and avoid it
altoether.

Regards,
    Vittorio




More information about the ffmpeg-devel mailing list