laggykiller / sticker-convert

Convert (animated) stickers to/from WhatsApp, Telegram, Signal, Line, Kakao, Viber, Discord, iMessage. Written in Python.
GNU General Public License v2.0
288 stars 16 forks source link

Animations play slower after converting from .tgs to .apng #4

Closed azuredusk10 closed 1 year ago

azuredusk10 commented 1 year ago

I converted this Telegram sticker set to .apng for use with Signal, however the animations in the converted stickers play more slowly than the originals.

Video recording of original Telegram stickers in Telegram for iOS

Video recording of the converted .apng stickers in Signal Desktop

You can see that the converted files play about half as quickly as the originals, making it look like the stickers are moving in slow motion.

Steps to reproduce:

  1. Convert the "Colored Cats" Telegram sticker pack to Signal .apng in a local directory, using the following settings. This step took a long time, so you can also download a few of the converted .apng files here for 21 days.

    Screenshot 2022-12-29 at 00 17 46
  2. Open Signal Desktop's sticker pack creator (File > Create/upload sticker pack)

  3. Drag the converted .apng files into Signal Desktop's sticker pack creator.

Is this due to the settings I've used or could this be a bug in the conversion process?

Thanks

laggykiller commented 1 year ago

Thank you for your report

The slow animation is caused by tgs is handled by converting to webp first, which the fps is not written properly into webp file or cannot be read by ImageMagick. To fix this, tgs is now handled by converting into png files first, then use ffmpeg to generate final file with input fps specified.

Please check if v1.6.2 works for you

For long conversion time of apng, this is on my TODO list. In the meantime, you may try to reduce steps

It also seems like the resulting image is glitched, I have opened a bug report upstream: https://gitlab.com/mattbas/python-lottie/-/issues/99

btw the sticker pack url should be https://telegram.me/addstickers/ColoredCats not https://telegram.me/addstickers/ColoredCat.

azuredusk10 commented 1 year ago

This fixes the issue, thank you! The converted .apng files now play with the same fps as the input .tgs file.

I've left a comment in issue #5 about the visual glitches.

Thank you for your help, the tool is shaping up really nicely and I've enjoyed trying it out. Let me know if there's anything I can help test.