Introducing high-definition portrait video support for Cloudflare Stream

This post details the technical implementation of high-definition portrait video support for Cloudflare Stream. The core change involves modifying the video encoding pipeline to identify and process portrait videos using a constrained target width instead of solely relying on height. This required updates to the Stream API service to enqueue portrait-specific encoding jobs and modifications to the on-the-fly encoding pipeline (hosted on Cloudflare Workers) to generate portrait renditions. The Stream player's quality selection labels were also updated to reflect the new portrait resolutions. The post also discusses two post-release bugs: one related to negative bitrates for portrait livestream renditions due to incorrect use of constraining dimensions for bitrate observation, and another causing download failures for small videos due to incorrect aspect ratio scaling. These bugs were addressed by expanding end-to-end testing and adding more unit tests for small videos.
More from the Video Streaming with Cloudflare Stream trail
- An API for MoQ: provision your own isolated relays
- Innovating to address streaming abuse — and our latest transparency report
- Extract audio from your videos with Cloudflare Stream
- MoQ: Refactoring the Internet's real-time media stack
- Make your apps truly interactive with Cloudflare Realtime and RealtimeKit