Skip to content

feat: add multi-audio track metadata support to Multiplex provider#2071

Open
nums wants to merge 7 commits intoOvenMediaLabs:masterfrom
nums:feat/multiplex-audio-tracks
Open

feat: add multi-audio track metadata support to Multiplex provider#2071
nums wants to merge 7 commits intoOvenMediaLabs:masterfrom
nums:feat/multiplex-audio-tracks

Conversation

@nums
Copy link
Copy Markdown
Contributor

@nums nums commented Apr 17, 2026

feat: add multi-audio track metadata support to Multiplex provider

Summary

Extends the Multiplex provider's TrackMap to support per-track audio metadata (PublicName, Language, Characteristics) and an AudioIndex field to differentiate multiple audio tracks sharing the same SourceTrackName. This brings multi-language audio support to the Multiplex provider, on par with what the Scheduled provider already offers.

Implemented with the help of Claude (Anthropic AI assistant).

What this does

  • Adds PublicName, Language, Characteristics and AudioIndex fields to NewTrackInfo in MultiplexProfile
  • When multiple audio tracks in a source stream share the same variant name, AudioIndex (0-based) selects which occurrence receives which metadata
  • Without AudioIndex, a single <Track> entry acts as a catch-all and preserves the original track metadata from the source stream
  • Both XML (.mux files) and JSON (REST API) formats are supported
  • Metadata is applied at track creation time and flows through to LL-HLS
    EXT-X-MEDIA attributes (NAME, LANGUAGE, CHARACTERISTICS)
  • Updates documentation with a multi-audio example

Why it's needed

The Multiplex provider is commonly used to combine streams for ABR delivery. Sources such as SRT streams or broadcast feeds often carry multiple embedded audio tracks. Without this feature, only one audio track per source variant could be mapped (additional tracks sharing the same SourceTrackName were silently dropped) making it impossible to expose multiple language tracks simultaneously in the LL-HLS master playlist.

Files changed

  • providers/multiplex/multiplex_profile.h - added fields to NewTrackInfo, changed _new_track_infos_map to support multiple entries per SourceTrackName (vector), updated GetNewTrackInfo signature to accept an occurrence index
  • providers/multiplex/multiplex_profile.cpp - XML/JSON parsing and serialization for the new fields
  • providers/multiplex/multiplex_stream.cpp - occurrence tracking per variant name, apply metadata overrides when cloning tracks
  • docs/live-source/multiplex-channel.md - added multi-audio example with AudioIndex, PublicName and Language

@nums nums requested a review from a team as a code owner April 17, 2026 08:49
@nums nums requested review from getroot and removed request for a team April 17, 2026 08:49
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 17, 2026

CLA assistant check
All committers have signed the CLA.

@getroot getroot changed the title add multi-audio track metadata support to Multiplex provider feat: add multi-audio track metadata support to Multiplex provider Apr 17, 2026
@getroot getroot requested a review from Copilot April 17, 2026 11:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds multi-audio track metadata mapping to the Multiplex provider so multiple audio tracks sharing the same source variant name can be exposed with distinct HLS EXT-X-MEDIA attributes (e.g., language/name/characteristics).

Changes:

  • Extend MultiplexProfile::NewTrackInfo with PublicName, Language, Characteristics, and AudioIndex, and update TrackMap to store multiple entries per SourceTrackName.
  • Update XML/JSON parsing + serialization to read/write the new per-track audio metadata fields.
  • Update MultiplexStream cloning logic to apply metadata overrides per occurrence and improve log output; update docs with a multi-audio example.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/projects/providers/multiplex/multiplex_stream.cpp Tracks per-variant occurrence and applies per-track audio metadata overrides during track cloning.
src/projects/providers/multiplex/multiplex_profile.h Expands NewTrackInfo, changes TrackMap to vector per source name, and adds occurrence-aware lookup.
src/projects/providers/multiplex/multiplex_profile.cpp Adds XML/JSON read/write support for new metadata + AudioIndex, and updates serialization loops for vectors.
docs/live-source/multiplex-channel.md Documents configuration for multi-audio mapping using AudioIndex and audio metadata fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/projects/providers/multiplex/multiplex_profile.h Outdated
Comment thread src/projects/providers/multiplex/multiplex_profile.h Outdated
Comment thread docs/live-source/multiplex-channel.md Outdated
Comment thread src/projects/providers/multiplex/multiplex_profile.cpp
Comment thread src/projects/providers/multiplex/multiplex_stream.cpp Outdated
@getroot
Copy link
Copy Markdown
Member

getroot commented Apr 17, 2026

@nums
Thank you for submitting the PR.

Recently, our internal developers have also been committing changes through PRs, and receiving a Copilot review is now required. Could you please review Copilot’s comments first?

nums and others added 5 commits April 17, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants