Opened 3 years ago

Closed 23 months ago

#9435 closed defect (fixed)

swscale yuv2rgb crops image or causes glitches

Reported by: iss Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by iss)

Summary of the bug:
From debugging the issue this seems to happen only when video resolution is not divisible by 32.

How to reproduce:

ffmpeg.exe -ss 00:00:00.50 -i test.avi -vframes 1 -pix_fmt rgba test.png

ffmpeg version N-103795-g140eac77a9-g6e26015a6b+1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.3.0 (Rev5, Built by MSYS2 project)

This may be same report as #8871, but in this case8 px on left side are corrupted.
This issue happens in Blender, but there every line of output is corrupted like this.

Attachments (2)

test.avi (144.3 KB ) - added by iss 3 years ago.
Test file
test.png (455.1 KB ) - added by iss 3 years ago.
Broken output

Download all attachments as: .zip

Change History (7)

by iss, 3 years ago

Attachment: test.avi added

Test file

by iss, 3 years ago

Attachment: test.png added

Broken output

comment:1 by iss, 3 years ago

Description: modified (diff)

comment:2 by Balling, 3 years ago

May be related to latest breaking of everything due to multithreading in swscale. https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/284897.html
May be will be fixed with:
Can you reproduce with zscale?

in reply to:  2 comment:3 by iss, 3 years ago

Replying to Balling:

May be related to latest breaking of everything due to multithreading in swscale. https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/284897.html
May be will be fixed with:

I am sure I was able to reproduce this issue with build few months old, from around may/june 2021. Unfortunately I didn't note exact commit.

Can you reproduce with zscale?

This happens during pixel format conversion, no image resizing is done, not sure if zscale is applicable. From docs I don't quite see how at least.

comment:4 by pdr0, 3 years ago

zscale is ok

ffmpeg -ss 00:00:00.50 -i test.avi -vf zscale=matrixin=170m,format=gbrap -vframes 1 testz.png

swscale was ok if you check about month ago. Not sure which commit broke it, but current version has the issue

comment:5 by Balling, 23 months ago

Resolution: fixed
Status: newclosed

Does not happen anymore, moreover png is bitperfect with old ffmpeg when

swscale was ok if you check about month ago

Note: See TracTickets for help on using tickets.