Open blueset opened 5 years ago
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.
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.
according to the project page
, the module tgs
has been moved/renamed to lottie
, and yesterday the author uploaded a broken version of tgs
, dont yet know if it was intended.
according to the
project page
, the moduletgs
has been moved/renamed tolottie
Thanks for the update, I have pushed a commit (f668a8e) to address this change, it should be there in the next version.
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
Telegram Bot APIAs 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]
python-telegram-bot
(PTB) support of new bot APIOur 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.
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.