Skip to content

Commit

Permalink
Duplicate video tracks when track id is missing in manifest.
Browse files Browse the repository at this point in the history
Do not assume track id to be 1 for all tracks.
But if audio and video are in same file both can't be track 1. Use
stream type instead of track id where possible.
  • Loading branch information
duggaraju authored and pohhsu committed Jun 5, 2024
1 parent 4d1a371 commit 96cc7f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion migrationTool/transform/PackageTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected override async Task<string> TransformAsync(
var inputPaths = inputFiles.Select(f => Path.Combine(workingDirectory, f))
.ToArray();

// Anything not package and can be uploaded is uploaded directly.
// Anything not packaged and can be uploaded is uploaded directly.
var blobs = await container.GetListOfBlobsRemainingAsync(manifest, cancellationToken);
allTasks.Add(Task.WhenAll(blobs.Select(async blob =>
{
Expand Down
3 changes: 2 additions & 1 deletion migrationTool/transform/ShakaPackager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ private IEnumerable<string> GetArguments(IList<string> inputs, IList<string> out
var stream = t.Type.ToString().ToLowerInvariant();
var language = string.IsNullOrEmpty(t.SystemLanguage) || t.SystemLanguage == "und" ? string.Empty : $",language={t.SystemLanguage},";
var role = t is TextTrack ? $",dash_role={values[text_tracks++ % values.Length].ToString().ToLowerInvariant()}" : string.Empty;
return $"stream={t.TrackID - 1},in={inputFile},out={outputs[i]},playlist_name={manifests[i]}{language}{drm_label}{role}";
var useType = SelectedTracks.Count(x => x.Source == t.Source && x.Type == t.Type) == 1;
return $"stream={(useType ? stream: t.TrackID - 1)},in={inputFile},out={outputs[i]},playlist_name={manifests[i]}{language}{drm_label}{role}";
}
else
{
Expand Down

0 comments on commit 96cc7f8

Please sign in to comment.