Telegram on iOS crashes when browsing stickers or gifs longer than 30 second
If you open the sticker/gif panel when entering a message, flip, twist, rotate, no matter how, but view them, 15-20 seconds - the application crashes. Steps to reproduce Entering a message; Click on the…
1. It is not at all obvious, but AVC (x264) compresses much better or much faster with the same video quality on low-resolution images (480p and less) - and these are the resolutions used in GIFs.
2. speed. VP9 has a terrible encoding speed, and even more so the decoding speed. While AVC has a lot of ways to make videos faster in speed. The easiest way is to set LEVEL 2.2 or less. but the codec also has such features as Fast decoding (disabling the unblocking filter and other complex conversion algorithms), as well as a low delay function - its effect is especially video at the moment when the animation reaches the end and starts from the beginning, if this function is not enabled, a lag for a fraction of a second will be noticeable, including this parameter corrects this flaw.
I will also add from myself that the choice of VP9 for stickers was unexpected and the worst decision. Because there was already an ideal candidate, this is WEBP (vp8), which already has animation built in. It is very much faster and supports transparency. And for drawn-art animation there is a lossless compression mode. A very bad decision was to choose VP9 and watch how everything freezes bad when opening the sticker pack.