Life after Live: register for webinar!
5 min read

Same tracks, different order: how best to box out data snafus while pushing video files to two origins

So, two CMAF ingest sources walk into a bar . . .

November 27, 2026
In this article:
Share
Putting things in the right order matters. Ask any warehouse.

A spate of similar tickets has bulged our support department’s inbox.

And it has to do with using two different origins.

Now, using two different origins is not a problem in and of itself. Not at all. One encoder is pushing files out and it's pushing them to two origins. Happens every day.

But you may have a race condition whereby tracks may be received by the origins in different orders. In one case, audio track two hits one of the origins quicker, and then the order in which the isml is written shifts. The tracks are ordered in a different way than intended. Beware the ripple effect: the HLS playlist is ordered differently. The tracks are flipped.

When you're doing high availability (keeping video streams running continuously with minimal or zero downtime) and you want to have two origins, well, you want them to be exactly the same. Because if one falls over (fails), you want the other one to take over. And you don't want any differences between them.

But in one HLS playlist, one track would be at the top, and in the other HLS, the other one would be at the top. That’s the crux of the issue: you don’t want them out of order. You just don’t.

Using kind boxes to forge order from chaos

Well, trouble with CMAF track naming (doubling filenames, which leads to the above-named aches and pains) is actually a known issue with CMAF ingest. One of the usual suspects. And it can be solved by using kind boxes.

‍Support to address this issue by using kind boxes was added in Unified Streaming software version 1.15.24, to comply with the DASH-IF ingest protocol. It read like this:

live: added support for signaling switching set identifiers using track kind box according to dash-if ingest (#9604).

In the DASH-IF Live Media Ingest Protocol, see 6.4: Requirements for Signaling Switching Sets.

According to 6.4.3:

The live ingest source MAY add a “kind” box in the “udta” box in each track to signal the switching set it belongs to. The schemeURI of this “kind” box SHALL be urn:dashif:ingest:switchingset_id and the value field of the “kind” box SHALL be the switching set ID.

A conditional thang and a coupla absolutes there. SHALL we dive in and define terms?

How a switching set figures into origin redundancy

What the heck’s a switching set?

Let’s say you’re watching a live hotdog eating contest. The broadcaster (whichever lucky company won those overeating competition live rights) sends out different versions of the same live video stream.

Audio 1 track’s in English. Audio 2 track’s Spanish. Audio 3 track’s in German. Audio 4 track’s in Swahili. Basic adaptive bitrate (ABR) ladder stuff: same content, in different languages.

Back to defining switching sets. The four tracks described above belong to the same “Adaptation Set.” This adaptation set corrals interchangeable versions of a single media element (like the bitrates above) together. 

And now for the switching sets. A switching set’s bigger than an adaptation set. Think of it as an overseer. The switching set groups multiple adaptation sets together that a device can switch between, given particular compatibility rules. (The main rule: grouped adaptation set elements in a switching set have to share the same contentType and lang (and matching par and sar for video, PAR meaning picture aspect ratio, like par="16:9" and SAR meaning sample aspect ratio, the width-to-height ratio of a single pixel, like sar="1:1”). The switching set makes it so that the end user’s streaming device may be able to switch between the tracks seamlessly, based on the available internet connection.

The device (aka player) needs to know that these tracks are simply different versions of the same content. If the player needs to switch between versions, then it’s totally fine, no problem.

Schemes, values, and kindness: parsing the DASH-IF rule

Let's translate the rest of that heady DASH-IF protocol text.

“The live ingest source MAY add a "kind" box in the "udta" box in each track to signal the switching set it belongs to.”

This means that the system sending the live video to Unified Streaming can add a small piece of metadata (a “kind box”) in the metadata container (the “udta” box) that sits inside the MP4 structure of each track. And that metadata (the kind box) tells Unified Streaming which switching set the track belongs to.

So let’s say Track 1 (English), Track 2 (Spanish), Track 3 (German), and Track 4 (Swahili) all belong to different switching sets: AUDIO_1, AUDIO_2, AUDIO_3, AUDIO_4.

Thanks to these switching sets, Unified Streaming can identify which tracks belong together by reading their labels.

Then there’s this. “The schemeURI of this "kind" box SHALL be urn:dashif:ingest:switchingset_id.”

The metadata (“kind box”) needs to use a specific, agreed-upon identifier (schemeURI) so that Unified Streaming knows what the info means.

Think of it as a label that says, "This metadata field contains a switching set ID." And the identifier is: urn:dashif:ingest:switchingset_id

The final stretch: “. . . and the value field of the "kind" box SHALL be the switching set ID.”

In other words, the actual value inside the metadata must contain the ID of the switching set. This tells Unified Streaming that the track belongs to the switching set VIDEO_1.

To repeat:

  • udta = a metadata container inside the MP4 structure.
  • kind = a metadata box inside that container.
  • schemeURI = identifies what type of information the box contains.
  • value = the actual switching set ID.

You don't need to worry too much about the box structure itself. The important thing is that the information is embedded in the incoming media track.

Try this off-ramp solution: the already-populated isml body

What’s that, you say? Your encoder doesn’t support switching set IDs yet? Well, well, well. Have we got a solution for you!

Use an already-populated isml body. Start an encoder pushing to an already populated isml body. Then Origin can match to the existing tracks rather than having to generate new ones (with new names).

Instead of allowing each incoming encoder to cause Unified Origin to create its own track definitions, you pre-create the track structure so that every encoder is mapped to the same existing tracks.

The Origin’s smart and already knows what tracks it expects to receive. So if you pre-populate the isml body, you've already told the Origin: these are the tracks you're going to get. Then the playlist is always going to be in the same order. When the Origin sees this track, it's like, “Oh yeah, no. I was expecting that. And I was expecting this, too.” 

When the encoder starts sending media, Origin’s ability to associate that incoming media with the existing track definitions helps you avoid track duplication, inconsistent track naming, and archive-structure problems when using redundant CMAF ingest sources.

So try using a templated isml before starting any encoders.

Or, in a high availability setup, start a single path first. Then once that isml is populated, copy it to the Origins on the other paths.

The ordering in the isml that may happen due to race conditions doesn't matter because the origins aren’t writing anything to this file. The file's already written. The isml ordering doesn't matter because the information is in the track already, to declare what it is. And it will create the same HLS playlists irrespective of the race condition for both of the origins.

The switching sets matter because they provide the track information. The race condition (arbitrariness of timing of file arrival due to internet wonkiness) doesn't matter because the track has enough information, such that when the origins receive it, they say, “Well this track is always meant to be in this position, regardless of when I got it. It's kismet. It’s meant to be.”

Without switching sets tracks could be ordered depending on when they hit the origin. Switching sets are built-in information in the track that gives its position in the playlist.

Feeling experimental? Try the CMAF archive backend approach

Another way to go about things is to use the CMAF archive backend, which uses attributes added to the track name.

In general, kind boxes can contain fairly arbitrary scheme IDs such as URLs and URNs with free-form values. But hey, this ain’t Woodstock. It’s not anything goes. So we changed this track name to a hash code calculated from the scheme ID and value.

For example, this track name “video_avc1_16x9_urn:scte:dash:cc:cea-608:2015” is now generated as: “video_avc1_16x9_kdea0f1c7a” instead. The "k" stands for "kind," followed by 8 hexadecimal digits. (The length is always the same.)

And you could deploy this solution in order to differentiate tracks and eliminate naming issues caused by race conditions. 

Why try the CMAF archive backend route? More information is packed into the track name. This way, everything will always be in the same order, because a big long track name makes the track identifiable by that information, rather than the order in which the origin receives it.

Right now this is an experimental feature.

Want to give it a whirl? Get in touch with your Unified account manager, so that one of our solutions engineers can help guide you through it. We’re seeking real-world feedback to move the feature forward (perhaps this is a win-win).

This is the docs.unified reference text for the experimental fix.

EXPERIMENTAL Ingested fmp4 is stored as CMAF media tracks, rather than ismv. Traditionally, Unified Origin stores the ingested multiplexed media as-is in archive segment files and maintains a fragment index in a database file. When archive_cmaf is enabled, the stream is demultiplexed into separate tracks. Each track is written to a separate file which includes a SegmentIndexBox (sidx). Ingested fragments are routed and appended to the corresponding archive segment and entries gradually fill up the segment index.
A so-called Storage MPD provides high-level description of the ingested media contained in individual CMAF archive segments. Because neither ingest nor playout rely on the database index, this potentially provides better scalability.

Support: we’re up for it

We enjoy getting into the video streaming technology weeds with you. Got an issue you’re wrestling with? Let us help.