Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support to TGS (Lottie/Bodymovin) Animated Stickers #63

Open
blueset opened this issue Jul 12, 2019 · 4 comments
Open

Support to TGS (Lottie/Bodymovin) Animated Stickers #63

blueset opened this issue Jul 12, 2019 · 4 comments

Comments

@blueset
Copy link
Member

blueset commented Jul 12, 2019

Background

On 5 July 2019, Telegram released new animated stickers feature, which is using a vector based format generated using After Effect with a tailored extension.

Technical details

Through inspection of the extension and some sample files, Telegram is found to be using a subset/fork of Lottie (a.k.a. Bodymovin), which is led by Airbnb. The TGS format is a gzip-ed JSON file with a similar structure with Lottie, and an extra attribute "tgs": 1. By a simple look through, TGS is semmingly compatible with Lottie format.

Issues on supporting animated stickers

  1. Telegram Bot API

    As of when the issue is created, bot API is yet to support the new message type, this prevents ETM to send or receive any TGS animated stickers. We need to wait Telegram Bot API updates to process this kind of message.

    [Update 31 July 2019]:
    Telegram Bot API has released animated sticker support. [3]

  2. python-telegram-bot (PTB) support of new bot API

    Our upstream dependency, PTB need to update to support the latest bot API update which incorporates the new animated stickers format.

    Update: Animated sticker support has arrived in PTB.

  3. Lottie animation rendering

    Despite being able to render in a wide range of platforms (Android, iOS, Web, React Native, and Windows), we did not find a way to encode Lottie animation into a more universally accepted format (e.g. MP4 [1, 2]). This prevent us to pass on TGS animations to other IM platforms as Telegram is seemingly the only IM platform that renders Lottie animations.

@blueset
Copy link
Member Author

blueset commented Aug 4, 2019

Update:

mattia.basaglia/tgs has provided a Python toolkit on a wide variety of helpers to deal with TGS format, including converting TGS to GIF of MP4.

Further details including external dependencies, usability and performance will be investigated in near future.

@blueset
Copy link
Member Author

blueset commented Oct 6, 2019

Support to tgs format has been added to the latest version of ETM, but has been hidden behind a experimental flag due to it unstability.

@TTTPOB
Copy link

TTTPOB commented Apr 24, 2020

according to the project page, the module tgs has been moved/renamed to lottie, and yesterday the author uploaded a broken version of tgs
image
, dont yet know if it was intended.

@blueset
Copy link
Member Author

blueset commented Apr 27, 2020

according to the project page, the module tgs has been moved/renamed to lottie

Thanks for the update, I have pushed a commit (f668a8e) to address this change, it should be there in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants