Search Documentation
Search across all documentation pages
Streaming

Streaming

Transcodely supports packaging transcoded video into HLS and DASH adaptive streaming formats. A single output can contain multiple video variants (an ABR ladder) that players switch between based on the viewer’s bandwidth.

Output Types

TypeAPI ValueProducesUse Case
HLShls.m3u8 master + variant playlists + segmentsApple devices, Safari, most web players
DASHdash.mpd manifest + segmentsAndroid, Chrome, cross-platform
AdaptiveadaptiveBoth HLS + DASH from shared CMAF segmentsMaximum compatibility with minimal storage

Basic HLS Output

Create an HLS output with an ABR ladder of three resolutions:

{
  "type": "hls",
  "video": [
    {"codec": "h264", "resolution": "1080p", "quality": "standard"},
    {"codec": "h264", "resolution": "720p", "quality": "standard"},
    {"codec": "h264", "resolution": "480p", "quality": "economy"}
  ]
}

This produces:

  • master.m3u8 — Master playlist referencing all variants
  • h264_1080p.m3u8 — Variant playlist for 1080p
  • h264_720p.m3u8 — Variant playlist for 720p
  • h264_480p.m3u8 — Variant playlist for 480p
  • Segment files (.m4s with fMP4, or .ts with legacy TS)

Basic DASH Output

{
  "type": "dash",
  "video": [
    {"codec": "h264", "resolution": "1080p", "quality": "standard"},
    {"codec": "h264", "resolution": "720p", "quality": "standard"}
  ]
}

This produces:

  • manifest.mpd — DASH manifest
  • Segment files (.m4s in fMP4 format)

Without an explicit segments block, DASH-only outputs default to 4-second segments (HLS and adaptive outputs default to 6). Set segments.duration if you need a specific length — see Segment Configuration.

CMAF / Adaptive Output

The adaptive type produces both HLS and DASH manifests from the same set of CMAF (Common Media Application Format) segments. This halves your storage costs compared to generating HLS and DASH separately.

{
  "type": "adaptive",
  "video": [
    {"codec": "h264", "resolution": "1080p", "quality": "standard"},
    {"codec": "h264", "resolution": "720p", "quality": "standard"}
  ]
}

This produces:

  • master.m3u8 — HLS master playlist
  • manifest.mpd — DASH manifest
  • Shared .m4s segments used by both

Segment Configuration

Control how the video is split into segments for streaming. These settings apply to all streaming output types.

{
  "type": "hls",
  "video": [...],
  "segments": {
    "duration": 6,
    "gop_alignment": "aligned"
  }
}
ParameterRangeDefaultDescription
duration1-30 seconds6 (HLS/adaptive), 4 (DASH)Segment duration
gop_alignmentaligned, fixedalignedHow keyframes align with segments
gop_size1-10 secondsN/AFixed GOP size (only when gop_alignment: "fixed")

When you omit the segments block entirely, the default duration depends on the output type: HLS and adaptive outputs use 6-second segments, while DASH-only outputs use 4-second segments. Set duration explicitly to get consistent segment lengths across every output type.

Segment duration recommendations:

DurationTradeoff
2 secondsLow latency, more CDN requests, higher overhead
4 secondsGood balance (Bitmovin default; Transcodely DASH default)
6 secondsApple recommended, fewer requests (Transcodely HLS/adaptive default)
10 secondsHigher latency, most efficient for long-form content

GOP Alignment

GOP (Group of Pictures) alignment controls how keyframes line up with segment boundaries.

Aligned mode (default, recommended): The GOP size matches the segment duration. Every segment starts with a keyframe, ensuring clean switching between bitrate variants.

{
  "segments": {
    "duration": 6,
    "gop_alignment": "aligned"
  }
}

Fixed mode: Use a fixed GOP size independent of segment duration. Useful for ad insertion (DAI) or specific keyframe requirements.

{
  "segments": {
    "duration": 6,
    "gop_alignment": "fixed",
    "gop_size": 2
  }
}

HLS Configuration

Customize HLS-specific options:

{
  "type": "hls",
  "video": [...],
  "hls": {
    "manifest": "index",
    "segment_format": "fmp4",
    "playlist_type": "vod",
    "variant_pattern": "{codec}_{resolution}"
  }
}
ParameterDefaultDescription
manifest"master"Master playlist name (produces {name}.m3u8)
segment_format"fmp4"Segment format: "fmp4" (CMAF) or "ts" (legacy)
playlist_type"vod"Playlist type: "vod" or "event"
variant_pattern"{codec}_{resolution}"Pattern for variant playlist names

Segment format comparison:

FormatFile ExtensionCodecsNotes
fMP4 (CMAF).m4sH.264, H.265, VP9, AV1Modern, recommended
TS.tsH.264 onlyLegacy, widest device support

Playlist types:

TypeUse Case
vodOn-demand content — complete, immutable playlist
eventLive-to-VOD transitions — append-only playlist

DASH Configuration

Customize DASH-specific options:

{
  "type": "dash",
  "video": [...],
  "dash": {
    "manifest": "stream"
  }
}
ParameterDefaultDescription
manifest"manifest"Manifest name (produces {name}.mpd)

DASH always uses fMP4 segments regardless of any segment format setting.

Multi-Codec ABR Ladders

You can mix codecs within a single streaming output for modern multi-codec delivery:

{
  "type": "hls",
  "video": [
    {"codec": "h264", "resolution": "1080p", "quality": "standard"},
    {"codec": "h264", "resolution": "720p", "quality": "standard"},
    {"codec": "h265", "resolution": "1080p", "quality": "standard"},
    {"codec": "h265", "resolution": "720p", "quality": "standard"}
  ],
  "hls": {
    "segment_format": "fmp4"
  }
}

Players that support H.265 will select those variants for better quality at the same bandwidth, while older devices fall back to H.264. Note that multi-codec HLS requires fMP4 segments (not TS).

Multi-Audio Streaming

Add multiple audio language tracks to streaming outputs:

{
  "type": "hls",
  "video": [
    {"codec": "h264", "resolution": "1080p", "quality": "standard"}
  ],
  "audio": [
    {"language": "eng", "label": "English", "is_default": true},
    {"language": "spa", "label": "Spanish", "source_track": 1}
  ]
}

Audio tracks appear as selectable language options in the player UI. Up to 8 audio tracks per output are supported.

Complete Streaming Example

A production-ready HLS output with a 3-tier ABR ladder, custom manifest names, and multi-audio:

{
  "type": "hls",
  "video": [
    {"codec": "h264", "resolution": "1080p", "quality": "premium", "framerate": 30},
    {"codec": "h264", "resolution": "720p", "quality": "standard", "framerate": 30},
    {"codec": "h264", "resolution": "480p", "quality": "economy", "framerate": 30}
  ],
  "audio": [
    {"language": "eng", "label": "English", "is_default": true},
    {"language": "spa", "label": "Spanish", "source_track": 1}
  ],
  "hls": {
    "manifest": "index",
    "segment_format": "fmp4",
    "playlist_type": "vod",
    "variant_pattern": "video_{resolution}"
  },
  "segments": {
    "duration": 6,
    "gop_alignment": "aligned"
  }
}

The three video rungs — premium 1080p, standard 720p, and economy 480p, all at 30 fps — give players an ABR ladder to adapt across bandwidths, while the two audio entries add selectable English (default) and Spanish tracks. The hls block names the master playlist index.m3u8, emits fMP4/CMAF segments, and marks the playlist vod, while the segments block cuts 6-second, GOP-aligned segments so variants switch cleanly.

Variant Pricing

Each variant in a streaming output is priced independently. The per-variant cost is calculated using the same formula:

variant_cost = (duration_minutes) x base_price x codec_mult x resolution_mult x framerate_mult x quality_mult

The total output cost is the sum of all variant costs. During encoding, per-variant progress is tracked in the variant_pricing array of the job response.