Getting started

Integration & migration

Image & video API

Video Player SDK

DAM user guide

API overview

Account

Adaptive bitrate streaming

Learn how to use Adaptive Bitrate Streaming for long videos with ImageKit and the Video Player SDK.


Adaptive Bitrate Streaming (ABS) automatically adjusts video quality based on each viewer's network speed and device capabilities. This eliminates buffering, speeds up playback startup, and delivers the best possible experience across all connections.

Why ABS matters

  • Zero buffering: Video automatically adapts to network conditions in real-time
  • Fast startup: Begins playback immediately at the lowest quality, then upgrades as bandwidth becomes available
  • Universal compatibility: Works seamlessly across all devices from mobile to 4K displays
  • Cost efficient: Viewers on slow connections download smaller files, reducing bandwidth costs

Quick start

Recommended: Use the Video Player SDK for production implementations. It handles ABS automatically with zero configuration complexity:

Copy
const player = videoPlayer('my-video', {
  imagekitId: 'YOUR_IMAGEKIT_ID',
  abs: {
    protocol: 'hls', // or 'dash'
    sr: [240, 360, 480, 720, 1080] // Available resolutions
  }
});

player.src({
  src: 'https://ik.imagekit.io/<your-imagekit-id>/video.mp4'
});

That's it! The Video Player SDK handles:

  • Manifest generation
  • Quality adaptation based on bandwidth
  • Seamless transitions between quality levels
  • Playback optimization

How ABS works

Adaptive Bitrate Streaming works by splitting your video into multiple quality variants. The viewer's client (video player) loads the manifest file and continuously adapts playback:

  1. Player loads manifest file with all available variants
  2. Player starts playback at lowest bitrate for fast startup
  3. Player monitors network speed and device capabilities
  4. Player requests higher quality segments as bandwidth allows
  5. Player downgrades quality if network slows down

This continuous adaptation creates a smooth experience without buffering or interruptions.

How ImageKit handles ABS

ImageKit automatically generates all required variants and manifest files from your original video. You only need to provide the source video—ImageKit creates everything else:

  • Generates multiple quality versions (240p through 4K)
  • Creates HLS and/or DASH manifest files
  • Serves all files through ImageKit's CDN
  • Caches aggressively for performance

The original video can be hosted in ImageKit Storage or external storage integrated with your ImageKit account.

Streaming protocols

ImageKit supports both major ABS protocols. Both work with all modern video players and leverage standard HTTP infrastructure including CDN caching:

  • HTTP Live Streaming (HLS): Apple's standard, excellent compatibility with all devices
  • MPEG-DASH: Industry standard, more flexible and efficient

Choose based on your target audience and player requirements. The Video Player SDK supports both seamlessly.

Manual implementation

For custom implementations or when not using the Video Player SDK, construct manifest URLs directly.

HLS manifest URL

Copy
https://ik.imagekit.io/YOUR_ID/path/to/video.mp4/ik-master.m3u8?tr=sr-240_360_480_720_1080

DASH manifest URL

Copy
https://ik.imagekit.io/YOUR_ID/path/to/video.mp4/ik-master.mpd?tr=sr-240_360_480_720_1080

Generation timing

When you first request a manifest URL:

  • Returns 202 Accepted status (processing)
  • ImageKit generates variants in the background (takes seconds to minutes depending on file size)
  • Second request returns 200 OK with the manifest

Use the <video> element with the appropriate MIME type for your chosen protocol (HLS uses application/x-mpegURL, DASH uses application/dash+xml).

Quality representations (sr parameter)

Use the sr parameter to specify which quality variants to generate. You can include any combination of the supported representations below:

Usage: sr-240_360_480_720_1080

This tells ImageKit to generate 5 variants: 240p, 360p, 480p, 720p, and 1080p.

Supported resolutions

RepresentationsResolutionMax BitrateVideo CodecAudio CodecFormat
240426x240200Kh264aacmp4
360640x360400Kh264aacmp4
480854x480800Kh264aacmp4
7201280x7203300Kh264aacmp4
10801920x10805500Kh264aacmp4
14402560x144012000Kh264aacmp4
21603840x216018000Kh264aacmp4

ImageKit uses H.264 codec for encoding video and AAC for encoding audio for both HLS and DASH.

All ABS representations will use at_max cropping strategy to resize the representations. Output will match the aspect ratio of the original video after this change.

Best practices

  • Use Video Player SDK: The Video Player SDK handles ABS automatically with optimal quality adaptation.
  • Include 360p and higher: Always include at least 360p for mobile, then 720p and 1080p for desktop.
  • Test manifest generation: Allow 2-5 minutes for processing on first request depending on video size.

Transformation limitations: You cannot apply width (w), height (h), aspect ratio (ar), format (f), video codec (vc), audio codec (ac), or quality (q) transformations when using ABS. All other transformations work normally.