Animated AVIF Frame Rate and Duration Limits
Animated AVIF (AV1 Image File Format) utilizes the ISO Base Media File Format (ISOBMFF) container to store AV1-encoded image sequences, replacing older formats like animated GIF and WebP. This article details the technical ceilings and practical constraints governing animated AVIF files, specifically focusing on maximum frame rates, playback duration, container-level capabilities, and real-world browser implementations.
Theoretical Format Limits
From a pure specification standpoint, animated AVIF files inherit the capabilities of both the ISOBMFF container and the AV1 video standard.
- Frame Rate: The timing of frames in an AVIF image
sequence is defined by a
timescaleanddurationper sample (frame) within the container's track header (mdhdandsttsboxes). Because the container supports 32-bit and 64-bit integer values for timescales, the theoretical maximum frame rate is virtually unlimited, easily accommodating thousands of frames per second. - Duration: Durations in the ISOBMFF structure are stored using 32-bit or 64-bit integers. With a standard millisecond timescale, a 32-bit integer allows for continuous playback of over 49 days, while a 64-bit integer allows durations spanning billions of years. AVIF has no specification-imposed maximum file duration.
Practical and Implementation Limits
While the file specification allows extreme values, real-world
playback relies on hardware decoders, operating system libraries (such
as libavif), and web browser rendering engines (Blink,
Gecko, and WebKit).
1. Real-World Frame Rate Limits
- Browser Throttling: Modern web browsers tie
animation rendering to the display's refresh cycle via
requestAnimationFrameor the internal compositor. In practice, animated AVIF playback is capped at the host display’s refresh rate, typically 60 Hz, 120 Hz, or 144 Hz. - Minimum Frame Duration: Similar to legacy handling of animated GIFs, browsers enforce internal timing floors. Attempting to set an excessively low frame duration (such as 0ms or sub-1ms intervals) will usually cause the decoder to fall back to a default interval (typically 10ms or 100ms) to prevent CPU starvation.
- Decoder Throughput: High frame rates require significant computational overhead. Decoding AV1 frames at rates higher than 60 fps at high resolutions can quickly cause dropped frames on devices lacking dedicated hardware AV1 decoding blocks.
2. Real-World Duration Limits
- Memory Constraints: Unlike standard streaming video (e.g., MP4 or WebM), animated AVIF is treated as an image asset by rendering engines. Browsers often decode and cache animated image frames directly into system RAM. Excessively long animations can cause significant memory bloat, resulting in browser tab crashes on resource-constrained devices like smartphones.
- File Size and Parsing: AV1 intra-frame and inter-frame compression is efficient, but long animations result in large file downloads before rendering can reliably loop, causing initial display latency.
- Lack of Audio: AVIF is strictly an image format and does not support audio tracks. While a visual sequence could theoretically run for hours, doing so in an AVIF container provides no benefit over a dedicated video container.
Recommended Best Practices
- Frame Rate: Target 30 fps or 60 fps. This provides fluid motion for UI elements and animations while staying well within the reliable processing capabilities of both software and hardware decoders.
- Duration: Keep animations under 10 to 30 seconds. For sequences requiring longer durations or sound synchronization, use standard AV1 video inside an MP4 or WebM container instead of animated AVIF.