[FFmpeg-trac] #10285(avcodec:new): scale_qsv filter for resolutions not 32x32 aligned results in in green lines on bottom or right
FFmpeg
trac at avcodec.org
Mon Mar 27 22:58:10 EEST 2023
#10285: scale_qsv filter for resolutions not 32x32 aligned results in in green
lines on bottom or right
--------------------------------------+----------------------------------
Reporter: Steve Browne | Type: defect
Status: new | Priority: normal
Component: avcodec | Version: 5.1.2
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
--------------------------------------+----------------------------------
Summary of the bug:
When using an h264_qsv decoder with an hwdevice context and scaling via
the scale_qsv filter if the input resolution is not 32x32 aligned you'll
get green on the bottom or right depending on which dimension was not
divisible by 32. This happens because `qsv_decode_preinit` in qsvdec.c
will set the dimensions of the hwframes context to the 32 pixel aligned
values. However, when the surfaces are initialized in `qsv_init_surface`
of hwcontext_qsv.c it assumes the width/height represent the unaligned
dimensions and tries to use them as the CropW/CropH to account for that.
There doesn't appear to be any other good way to get the unaligned
dimensions at this point. I'm not sure why those dimensions need to be
aligned in the hwcontext rather than just aligning them wherever that is
needed which `qsv_init_surface` tries to align by 16 already. Basically I
think the alignment can just go away at that level otherwise it probably
needs another field to keep track of the unaligned value.
How to reproduce:
Use an input video with a resolution not 32x32 aligned. For instance my
input video was 3840x2160.
Create an h264_qsv AVCodecContext with an hwdevice context.
Create an avfilter graph to scale the video. Mine for example used a graph
description of "scale_qsv=w=768:h=432" and a Input filter of
"video_size=3840x2160:pix_fmt=114:time_base=1/90000:pixel_aspect=0/1"
Decode the video then send the frame to the filter graph and get the
output
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10285>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list