
8/16/2024 · Sasha Huang
What this post added
Introduced high-definition portrait video support for Cloudflare Stream by modifying the encoding pipeline to process portrait videos with constrained target width and a new set of standard resolutions (e.g., 240x426 up to 1080x1920). This involved updating the Stream API service to enqueue portrait rendition jobs, modifying the on-the-fly encoding pipeline (hosted on Cloudflare Workers) to generate portrait resolutions, and adjusting the Stream player to display quality levels based on the constraining dimension. The change resulted in visibly higher quality portrait videos, confirmed by PSNR analysis showing up to an 8% increase. Addressed implementation challenges including ensuring correct renditions for downloads and clipping, and fixed edge cases related to negative bitrates in livestream renditions and incorrect aspect ratio scaling for small videos.