Add read/write support for track disposition information

This commit is contained in:
Vanilagy
2025-11-13 11:00:42 +01:00
parent 2c96ec0f1b
commit 217b383f12
27 changed files with 307 additions and 30 deletions
+5 -3
View File
@@ -48,7 +48,7 @@ import {
import { Output, TrackType } from './output';
import { Mp4OutputFormat } from './output-format';
import { AudioSample, clampCropRectangle, validateCropRectangle, VideoSample } from './sample';
import { MetadataTags, validateMetadataTags } from './tags';
import { MetadataTags, validateMetadataTags } from './metadata';
import { NullTarget } from './target';
/**
@@ -1184,9 +1184,10 @@ export class Conversion {
this.output.addVideoTrack(videoSource, {
frameRate: trackOptions.frameRate,
// TEMP: This condition can be removed when all demuxers properly homogenize to BCP47 in v2
// TODO: This condition can be removed when all demuxers properly homogenize to BCP47 in v2
languageCode: isIso639Dash2LanguageCode(track.languageCode) ? track.languageCode : undefined,
name: track.name ?? undefined,
disposition: track.disposition,
rotation: needsRerender ? 0 : totalRotation, // Rerendering will bake the rotation into the output
});
this._addedCounts.video++;
@@ -1423,9 +1424,10 @@ export class Conversion {
}
this.output.addAudioTrack(audioSource, {
// TEMP: This condition can be removed when all demuxers properly homogenize to BCP47 in v2
// TODO: This condition can be removed when all demuxers properly homogenize to BCP47 in v2
languageCode: isIso639Dash2LanguageCode(track.languageCode) ? track.languageCode : undefined,
name: track.name ?? undefined,
disposition: track.disposition,
});
this._addedCounts.audio++;
this._totalTrackCount++;