Tencent Video Image Optimization: AVIF Compression and Sampling to Reduce Static Bandwidth Costs
Tencent Video slashed static image bandwidth costs by over 60% using AVIF compression and on‑the‑fly image sampling, which together cut average image size by more than half, reduced memory, latency and decode time, and saved tens of millions of yuan across billions of daily requests.
In the context of cost‑reduction and efficiency improvement in the Internet industry, Tencent Video faces a massive static image bandwidth cost problem. The platform serves over 2 billion daily users, and its images are downloaded more than 100 billion times per day with an average size exceeding 100 KB, resulting in a monthly static bandwidth expense of tens of millions of yuan.
The article first introduces basic concepts of image processing, including lossless and lossy compression, common algorithms (run‑length encoding, entropy coding, transform coding, fractal compression), and popular image formats such as JPEG, PNG, GIF, APNG, WEBP, SHARPP, and AVIF.
Two key techniques are presented to cut static bandwidth costs:
AVIF compression : AVIF, based on the AV1 video codec, offers a compression ratio >50 % compared with JPEG/WEBP while preserving visual quality. Tencent Cloud’s Data 万象 service provides AVIF transcoding using the in‑house TXAV1 encoder, achieving higher PSNR and SSIM than WEBP at the same quality level.
Image sampling (dynamic resizing) : By leveraging Data 万象’s on‑the‑fly resizing and cropping, the client requests an image that matches the actual view dimensions, eliminating unnecessary pixel transmission and memory usage.
Implementation details include adding image/avif to the Accept header, using URL parameters to trigger AVIF conversion, and enabling domain‑wide optimization via the Tencent Cloud CDN switch.
Extensive measurements show the impact of these techniques:
AVIF reduces image size by >30 % compared with WEBP and >50 % compared with PNG.
After applying sampling, average image download size decreased by 53 %, memory usage by 24.3 %, download latency by 7.8 %, and decode time by 35.3 %.
Overall, static bandwidth for the top 10 image domains dropped from ~650 GB/month to ~250 GB/month (≈60 % reduction), saving over ten million yuan in cost.
The combined use of AVIF compression and sampling has been rolled out to 80 % of Tencent Video’s images, handling 3.5 billion AVIF requests daily, cutting average image size to ~20 KB and reducing decode time by 20 %.
These practices have been shared with other Tencent products (e.g., Tencent Anime, Tencent News) to help them achieve similar cost savings.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.