Repository navigation
feat(resolver): track selection and rendition audio names (TDD 0015, stage 1) - #40
Merged
Merged
Conversation
v1-a1, a2, v0-a0: for each kind of track, none, every one, or the nth in file order. Applying it keeps the chosen tracks, numbers the audio afresh, and fails only when nothing is left, so the default v1-a1 still serves a file with no audio. Part of TDD 0015, stage 1.
The answer's tracks field takes nginx-vod-module's selector (v1-a1, a2, v0-a0) for a single file. The selection is applied when the asset is assembled, the audio left is numbered audio-1, audio-2 afresh, and the selection is part of the URL version, but only when set, so an asset that serves every track keeps its version. A changed selection under an unchanged mapper version reloads the asset. Part of TDD 0015, stage 1.
A rendition or a clip takes the same tracks selector as a single file, so one file can contribute its video to one rendition and a chosen audio track to another. A bad selector names the rendition or the clip; one that leaves nothing fails the asset. A clip's selection is part of its version, and a changed selection under an unchanged mapper version reloads the asset. Part of TDD 0015, stage 1.
A rendition takes language, label, and default for the audio it brings, in place of what its file says. The language replaces the track's, the label replaces the name made from its position and language (HLS NAME, DASH Label, quoted and escaped), and default makes it the group's default instead of the first; at most one rendition may. They need exactly one audio track to name, are part of the asset's version, and a change under an unchanged mapper version reloads it. Part of TDD 0015, stage 1.
The mapper API describes tracks (on a file, a rendition, or a clip) and a rendition's language, label, and default. TDD 0015 records stage 1 as implemented and what it settled, and the roadmap marks track selection done.
…out of labels A clip's track selection is applied to the file's index before the clip is trimmed, so a track the clip drops can no longer decide where the window lies or fail it by having no samples inside it (a second audio track that ends early failed a later window). The test uses a file with such a track. A rendition label with U+FFFE or U+FFFF passed validation and would have made the DASH manifest ill-formed XML; it is now refused. Both were found in review. Part of TDD 0015, stage 1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First stage of the nginx-vod-module migration layer (TDD 0015, which this PR also adds): two additions to segmentor's own mapper answer that the later adapter needs to translate nginx's mapped-mode JSON faithfully. Both are optional fields, so existing mappers are unaffected, and native mappers can use them.
trackson a single file, each rendition and each clip, in nginx-vod-module's syntax (v1-a1,a2,v0-a0). Selected audio is renumberedaudio-1,audio-2… A selector that matches nothing of one kind still serves the rest, so the nginx defaultv1-a1works on a file with no audio; only an empty selection fails the asset.language,label,defaulton a rendition, for the one audio track it brings: HLSLANGUAGE/NAME/DEFAULT, DASHlang/<Label>(escaped). They need exactly one audio track to name; at most one rendition may be the default.A selection or an override enters a URL version only when set, so every existing asset keeps its URLs; a change under an unchanged mapper
versionreloads the asset.Not in this PR: the translator and the
vod-moduledialect (stages 2 and 3 of the design), adaptive playlists, DRM, URL compatibility.Review
A fresh review found one real defect, fixed here with a test: a clip was trimmed on the whole file before its selection was applied, so a short track the clip drops could fail a later window. It also found that a label containing U+FFFE/U+FFFF would have produced an ill-formed DASH manifest; those are now refused. Deferred and noted in the spec: duplicate labels give duplicate HLS
NAMEs, and overrides on a video rendition whose audio is not in the group have no effect (and no log line).How it was checked
make cipasses locally on the current stable Rust.Known limits
<Label>is checked for well-formedness and escaping, not against a player or the MPD schema.a_large_srt_converts_in_bounded_timehas a hard 2 s wall-clock limit and fails on a busy machine; unrelated, but it can flake CI.Test plan
make cilocally