Opened 4 years ago

Closed 3 years ago

#8453 closed defect (fixed)

converting png frames to gif is broken

Reported by: AyrA Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: paletteuse
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug

Converting png frames with transparency creates weird looking animations.

  • The first non-transparent row of each frame is replaced with a semi-transparent red line, sometimes other colors.
  • Using local palette occasionally replaces the transparent sections with green
  • The frame disposal is set to "replace" instead of "combine"

Version Info

OS: Windows 7 SP1 x64

ffmpeg: git-2019-12-29-e20c6d9

Note: The issue with the frame disposal and transparency being green does not exists in version N-91266-g8c20ea8ee0. The issue with the horizontal lines exists in both versions

How to reproduce

Using a global palette:

ffmpeg -framerate 2 -i %02d.png -filter_complex "[0:v] split [a][b];[a] palettegen [p];[b][p] paletteuse" test.gif

Using a local palette (one for each frame):

ffmpeg -framerate 2 -i %02d.png -filter_complex "[0:v] split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=new=1" test.gif

Note: attached are the frames as well as generated outputs

Attachments (1)

ffmpeg.zip (241.7 KB ) - added by AyrA 4 years ago.
Input PNG frames, example commands, generated GIF files

Download all attachments as: .zip

Change History (7)

by AyrA, 4 years ago

Attachment: ffmpeg.zip added

Input PNG frames, example commands, generated GIF files

comment:1 by Elon Musk, 4 years ago

The first issue is bug in swscale - it badly converts pal to other formats, workaround is using black color for transparency with palettegen.

comment:2 by Carl Eugen Hoyos, 4 years ago

Is there any difference between this ticket and ticket #7902 (and #8584)?

comment:3 by AyrA, 4 years ago

This one is about ffmpeg inserting lines of red (and sometimes green) color. The other ones aren't.

comment:4 by Carl Eugen Hoyos, 3 years ago

Component: undeterminedavfilter
Keywords: paletteuse added

Not gif-related afaict.

comment:5 by Elon Musk, 3 years ago

Status: newopen

The issue with green frame with new=1 have been fixed.

comment:6 by Elon Musk, 3 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.