Skip to content

Fork with possibility to change sizes to emoji's size.

Notifications You must be signed in to change notification settings

dreit-p/gif2tgsticker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gif2tgsticker

Tool for converting gif to WebM video for Telegram Video Sticker

This tool also supports non-GIF files(mp4, apng...) despite its name, but it's optimized for converting small-short videos.

How to use

Windows

Download gif2tgsticker.exe from releases and put together with FFmpeg files.

Other platform

poetry install
poetry run python gif2tgsticker.py

Options

FPS

Telegram supports up to 30 FPS.

Note that Video Stickers have 256KB file size limit, lowering framerate can help for fitting.

Resize mode

Since Telegram requires video to have 512px on one side, it tries to adjust it.

  • Scale: Scale up/down image itself.
    • Landscape video will have 512px width, height will be resized within aspect ratio.
    • Vertical video will have 512px height, width will be resized within aspect ratio.
  • Pad: Add transparent padding
    • Landscape video will have left, right padding.
    • Vertical video will have top, bottom padding.

Smart speed adjust duration limit

Telegram Video Sticker have 3 seconds duration limit.

If the video is longer than 3 seconds, this tool will try to fit this duration by speeding up playback.

Smart speed adjust fallback PTS modifier

If this tool is unable to get playback duration from file, this value will be used as PTS(Presentation Time Stamp) modifier.

  • 1.0 means 1x playback speed
  • 0.5 means 2x playback speed

Dependencies

Packaging

poetry install
poetry shell
pyinstaller gif2tgsticker.spec

About

Fork with possibility to change sizes to emoji's size.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%