Opened 18 months ago

Last modified 18 months ago

#10025 open defect

Skewed png images for certain resolutions when making thumbnail

Reported by: Kevin Sallee 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 Kevin Sallee)

Summary of the bug:
How to reproduce:

% ffmpeg -i skew.png -vf "scale=force_original_aspect_ratio=decrease:w=2048:h=2048, thumbnail" -frames:v 1 skew_thumb.png
ffmpeg version 5.1.2
built on OSX

For certain PNG image resolutions, the command results in a skewed output. I am attaching examples of a PNG that does not cause the skew, and one that causes it.
Previous versions of ffmpeg were not exhibiting this behavior

The full output of the command failing:

Attachments (2)

skew.png (2.2 MB ) - added by Kevin Sallee 18 months ago.
A PNG that causes a skew
no_skew.png (998.1 KB ) - added by Kevin Sallee 18 months ago.
A PNG that does not cause it.

Change History (5)

by Kevin Sallee, 18 months ago

Attachment: skew.png added

A PNG that causes a skew

by Kevin Sallee, 18 months ago

Attachment: no_skew.png added

A PNG that does not cause it.

comment:1 by Carl Eugen Hoyos, 18 months ago

Version: 5.1.2unspecified

I cannot reproduce, please test current FFmpeg git head, the only version supported on this bug tracker and provide the command line you tested together with the complete, uncut console output.

comment:2 by Kevin Sallee, 18 months ago

Description: modified (diff)

The full output of the command:

ffmpeg -y -i skew.png -vf "scale=force_original_aspect_ratio=decrease:w=2048:h=2048:flags=fast_bilinear, thumbnail" -frames:v 1 skew_thumb.png
ffmpeg version N-107731-g5cdf4c0bed-tessus Copyright (c) 2000-2022 the FFmpeg developers

built with Apple clang version 11.0.0 (clang-1100.0.33.17)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
libavutil 57. 32.101 / 57. 32.101
libavcodec 59. 42.100 / 59. 42.100
libavformat 59. 30.100 / 59. 30.100
libavdevice 59. 8.101 / 59. 8.101
libavfilter 8. 46.101 / 8. 46.101
libswscale 6. 8.102 / 6. 8.102
libswresample 4. 8.100 / 4. 8.100
libpostproc 56. 7.100 / 56. 7.100

Input #0, png_pipe, from 'skew.png':

Duration: N/A, bitrate: N/A
Stream #0:0: Video: png, rgb24(pc), 3121x1776 [SAR 2835:2835 DAR 3121:1776], 25 fps, 25 tbr, 25 tbn

Stream mapping:

Stream #0:0 -> #0:0 (png (native) -> png (native))

Press [q] to stop, ? for help
[Parsed_thumbnail_1 @ 0x7f9cdb8105c0] frame id #0 (pts_time=0.000000) selected from a set of 1 images
Output #0, image2, to 'skew_thumb.png':

Metadata:

encoder : Lavf59.30.100

Stream #0:0: Video: png, rgb24(pc, gbr/unknown/unknown, progressive), 2048x1165 [SAR 3635965:3637248 DAR 3121:1776], q=2-31, 200 kb/s, 25 fps, 25 tbn

Metadata:

encoder : Lavc59.42.100 png

[image2 @ 0x7f9cdb804f00] The specified filename 'skew_thumb.png' does not contain an image sequence pattern or a pattern is invalid.
[image2 @ 0x7f9cdb804f00] Use a pattern such as %03d for an image sequence or use the -update option (with -frames:v 1 if needed) to write a single image.
frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.00 bitrate=N/A speed= 0x
video:1314kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

comment:3 by Elon Musk, 18 months ago

Status: newopen

Nothing to do with thumbnail filter. It is scale filter issue.

Note: See TracTickets for help on using tickets.