I'm trying to make a gif from a series of transparent pngs but when I play the resulting gif back the frames overlap the first frame can be seen through. Here's the command I was using(as part of a larger program I'm working on)

ffmpeg -framerate 7 -i "B:\\documents\\Visual Studio\\Projects\\WindowsFormsApp1\\bin\\Debug\\tmp\\%d.bmp" -lavfi palettegen=stats_mode=diff:max_colors=256:reserve_transparent=1[pal],[0:v][pal]paletteuse=new=1:dither=none:alpha_threshold=128 -loop 0 "B:\\Pictures\\Gif frames dump\\output.gif" -y

but more simplified

ffmpeg -framerate 7 -i image%d.png -lavfi palettegen[pal],[0:v][pal]paletteuse output.gif

Here are the frames that got overlapped and here are the input images

Edit: I tried on this the nightly(ffmpeg version N-93851-gdcc999819d), 4.1.3, 4.1.1 and 4.0 windows 64 static builds. All had the same result. I've gotten the same result from simply trying to convert an apng to gif.

Only the first frame sticks around if stats mode is "full", or "diff"; however, every frame stayed onscreen when set to "single". So I'd definitely say there is something funky going on with the disposal method

  • Possible duplicate of Banding/ Trailing while resizing a transparent GIF through FFMPEG – Gyan May 5 '19 at 7:49
  • Share the input images. – Gyan May 5 '19 at 11:41
  • After digging around a bit the issue appears to be with ffmpeg's gif encoding. I think its either something to do with the disposal method or transparency crop. I also encountered a bug that sometimes resulted in something like "failed to finish filters". I Don't think its related though. – kolopo May 15 '19 at 6:24
  • Was this fixed? I am unable to get get the transparency working correctly on ffmpeg 4.2.x – Liam Martens Sep 12 '19 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.