@remotion/web-renderer 4.0.380 → 4.0.381

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/esm/index.mjs +190 -95
  2. package/package.json +6 -6
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/misc.js
1
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/misc.js
2
2
  /*!
3
3
  * Copyright (c) 2025-present, Vanilagy and contributors
4
4
  *
@@ -114,26 +114,22 @@ var writeBits = (bytes, start, end, value) => {
114
114
  var toUint8Array = (source) => {
115
115
  if (source.constructor === Uint8Array) {
116
116
  return source;
117
- } else if (source instanceof ArrayBuffer) {
118
- return new Uint8Array(source);
119
- } else {
117
+ } else if (ArrayBuffer.isView(source)) {
120
118
  return new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
119
+ } else {
120
+ return new Uint8Array(source);
121
121
  }
122
122
  };
123
123
  var toDataView = (source) => {
124
124
  if (source.constructor === DataView) {
125
125
  return source;
126
- } else if (source instanceof ArrayBuffer) {
127
- return new DataView(source);
128
- } else {
126
+ } else if (ArrayBuffer.isView(source)) {
129
127
  return new DataView(source.buffer, source.byteOffset, source.byteLength);
128
+ } else {
129
+ return new DataView(source);
130
130
  }
131
131
  };
132
- var textDecoder = new TextDecoder;
133
- var textEncoder = new TextEncoder;
134
- var invertObject = (object) => {
135
- return Object.fromEntries(Object.entries(object).map(([key, value]) => [value, key]));
136
- };
132
+ var textEncoder = /* @__PURE__ */ new TextEncoder;
137
133
  var COLOR_PRIMARIES_MAP = {
138
134
  bt709: 1,
139
135
  bt470bg: 5,
@@ -141,7 +137,6 @@ var COLOR_PRIMARIES_MAP = {
141
137
  bt2020: 9,
142
138
  smpte432: 12
143
139
  };
144
- var COLOR_PRIMARIES_MAP_INVERSE = invertObject(COLOR_PRIMARIES_MAP);
145
140
  var TRANSFER_CHARACTERISTICS_MAP = {
146
141
  bt709: 1,
147
142
  smpte170m: 6,
@@ -150,7 +145,6 @@ var TRANSFER_CHARACTERISTICS_MAP = {
150
145
  pq: 16,
151
146
  hlg: 18
152
147
  };
153
- var TRANSFER_CHARACTERISTICS_MAP_INVERSE = invertObject(TRANSFER_CHARACTERISTICS_MAP);
154
148
  var MATRIX_COEFFICIENTS_MAP = {
155
149
  rgb: 0,
156
150
  bt709: 1,
@@ -158,7 +152,6 @@ var MATRIX_COEFFICIENTS_MAP = {
158
152
  smpte170m: 6,
159
153
  "bt2020-ncl": 9
160
154
  };
161
- var MATRIX_COEFFICIENTS_MAP_INVERSE = invertObject(MATRIX_COEFFICIENTS_MAP);
162
155
  var colorSpaceIsComplete = (colorSpace) => {
163
156
  return !!colorSpace && !!colorSpace.primaries && !!colorSpace.transfer && !!colorSpace.matrix && colorSpace.fullRange !== undefined;
164
157
  };
@@ -298,7 +291,7 @@ var polyfillSymbolDispose = () => {
298
291
  Symbol.dispose ??= Symbol("Symbol.dispose");
299
292
  };
300
293
 
301
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/tags.js
294
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/metadata.js
302
295
  /*!
303
296
  * Copyright (c) 2025-present, Vanilagy and contributors
304
297
  *
@@ -413,8 +406,31 @@ var validateMetadataTags = (tags) => {
413
406
  }
414
407
  }
415
408
  };
409
+ var validateTrackDisposition = (disposition) => {
410
+ if (!disposition || typeof disposition !== "object") {
411
+ throw new TypeError("disposition must be an object.");
412
+ }
413
+ if (disposition.default !== undefined && typeof disposition.default !== "boolean") {
414
+ throw new TypeError("disposition.default must be a boolean.");
415
+ }
416
+ if (disposition.forced !== undefined && typeof disposition.forced !== "boolean") {
417
+ throw new TypeError("disposition.forced must be a boolean.");
418
+ }
419
+ if (disposition.original !== undefined && typeof disposition.original !== "boolean") {
420
+ throw new TypeError("disposition.original must be a boolean.");
421
+ }
422
+ if (disposition.commentary !== undefined && typeof disposition.commentary !== "boolean") {
423
+ throw new TypeError("disposition.commentary must be a boolean.");
424
+ }
425
+ if (disposition.hearingImpaired !== undefined && typeof disposition.hearingImpaired !== "boolean") {
426
+ throw new TypeError("disposition.hearingImpaired must be a boolean.");
427
+ }
428
+ if (disposition.visuallyImpaired !== undefined && typeof disposition.visuallyImpaired !== "boolean") {
429
+ throw new TypeError("disposition.visuallyImpaired must be a boolean.");
430
+ }
431
+ };
416
432
 
417
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/codec.js
433
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/codec.js
418
434
  /*!
419
435
  * Copyright (c) 2025-present, Vanilagy and contributors
420
436
  *
@@ -865,7 +881,7 @@ var validateSubtitleMetadata = (metadata) => {
865
881
  }
866
882
  };
867
883
 
868
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/muxer.js
884
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/muxer.js
869
885
  /*!
870
886
  * Copyright (c) 2025-present, Vanilagy and contributors
871
887
  *
@@ -882,34 +898,34 @@ class Muxer {
882
898
  this.output = output;
883
899
  }
884
900
  onTrackClose(track) {}
885
- validateAndNormalizeTimestamp(track, timestampInSeconds, isKeyFrame) {
901
+ validateAndNormalizeTimestamp(track, timestampInSeconds, isKeyPacket) {
886
902
  timestampInSeconds += track.source._timestampOffset;
887
903
  let timestampInfo = this.trackTimestampInfo.get(track);
888
904
  if (!timestampInfo) {
889
- if (!isKeyFrame) {
890
- throw new Error("First frame must be a key frame.");
905
+ if (!isKeyPacket) {
906
+ throw new Error("First packet must be a key packet.");
891
907
  }
892
908
  timestampInfo = {
893
909
  maxTimestamp: timestampInSeconds,
894
- maxTimestampBeforeLastKeyFrame: timestampInSeconds
910
+ maxTimestampBeforeLastKeyPacket: timestampInSeconds
895
911
  };
896
912
  this.trackTimestampInfo.set(track, timestampInfo);
897
913
  }
898
914
  if (timestampInSeconds < 0) {
899
915
  throw new Error(`Timestamps must be non-negative (got ${timestampInSeconds}s).`);
900
916
  }
901
- if (isKeyFrame) {
902
- timestampInfo.maxTimestampBeforeLastKeyFrame = timestampInfo.maxTimestamp;
917
+ if (isKeyPacket) {
918
+ timestampInfo.maxTimestampBeforeLastKeyPacket = timestampInfo.maxTimestamp;
903
919
  }
904
- if (timestampInSeconds < timestampInfo.maxTimestampBeforeLastKeyFrame) {
905
- throw new Error(`Timestamps cannot be smaller than the highest timestamp of the previous GOP (a GOP begins with a key` + ` frame and ends right before the next key frame). Got ${timestampInSeconds}s, but highest timestamp` + ` is ${timestampInfo.maxTimestampBeforeLastKeyFrame}s.`);
920
+ if (timestampInSeconds < timestampInfo.maxTimestampBeforeLastKeyPacket) {
921
+ throw new Error(`Timestamps cannot be smaller than the largest timestamp of the previous GOP (a GOP begins with a key` + ` packet and ends right before the next key packet). Got ${timestampInSeconds}s, but largest` + ` timestamp is ${timestampInfo.maxTimestampBeforeLastKeyPacket}s.`);
906
922
  }
907
923
  timestampInfo.maxTimestamp = Math.max(timestampInfo.maxTimestamp, timestampInSeconds);
908
924
  return timestampInSeconds;
909
925
  }
910
926
  }
911
927
 
912
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/codec-data.js
928
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/codec-data.js
913
929
  /*!
914
930
  * Copyright (c) 2025-present, Vanilagy and contributors
915
931
  *
@@ -1024,44 +1040,22 @@ var extractAvcDecoderConfigurationRecord = (packetData) => {
1024
1040
  return null;
1025
1041
  }
1026
1042
  const spsData = spsUnits[0];
1027
- const bitstream = new Bitstream(removeEmulationPreventionBytes(spsData));
1028
- bitstream.skipBits(1);
1029
- bitstream.skipBits(2);
1030
- const nal_unit_type = bitstream.readBits(5);
1031
- if (nal_unit_type !== 7) {
1032
- console.error("Invalid SPS NAL unit type");
1033
- return null;
1034
- }
1035
- const profile_idc = bitstream.readAlignedByte();
1036
- const constraint_flags = bitstream.readAlignedByte();
1037
- const level_idc = bitstream.readAlignedByte();
1038
- const record = {
1043
+ const spsInfo = parseAvcSps(spsData);
1044
+ assert(spsInfo !== null);
1045
+ const hasExtendedData = spsInfo.profileIdc === 100 || spsInfo.profileIdc === 110 || spsInfo.profileIdc === 122 || spsInfo.profileIdc === 144;
1046
+ return {
1039
1047
  configurationVersion: 1,
1040
- avcProfileIndication: profile_idc,
1041
- profileCompatibility: constraint_flags,
1042
- avcLevelIndication: level_idc,
1048
+ avcProfileIndication: spsInfo.profileIdc,
1049
+ profileCompatibility: spsInfo.constraintFlags,
1050
+ avcLevelIndication: spsInfo.levelIdc,
1043
1051
  lengthSizeMinusOne: 3,
1044
1052
  sequenceParameterSets: spsUnits,
1045
1053
  pictureParameterSets: ppsUnits,
1046
- chromaFormat: null,
1047
- bitDepthLumaMinus8: null,
1048
- bitDepthChromaMinus8: null,
1049
- sequenceParameterSetExt: null
1054
+ chromaFormat: hasExtendedData ? spsInfo.chromaFormatIdc : null,
1055
+ bitDepthLumaMinus8: hasExtendedData ? spsInfo.bitDepthLumaMinus8 : null,
1056
+ bitDepthChromaMinus8: hasExtendedData ? spsInfo.bitDepthChromaMinus8 : null,
1057
+ sequenceParameterSetExt: hasExtendedData ? spsExtUnits : null
1050
1058
  };
1051
- if (profile_idc === 100 || profile_idc === 110 || profile_idc === 122 || profile_idc === 144) {
1052
- readExpGolomb(bitstream);
1053
- const chroma_format_idc = readExpGolomb(bitstream);
1054
- if (chroma_format_idc === 3) {
1055
- bitstream.skipBits(1);
1056
- }
1057
- const bit_depth_luma_minus8 = readExpGolomb(bitstream);
1058
- const bit_depth_chroma_minus8 = readExpGolomb(bitstream);
1059
- record.chromaFormat = chroma_format_idc;
1060
- record.bitDepthLumaMinus8 = bit_depth_luma_minus8;
1061
- record.bitDepthChromaMinus8 = bit_depth_chroma_minus8;
1062
- record.sequenceParameterSetExt = spsExtUnits;
1063
- }
1064
- return record;
1065
1059
  } catch (error) {
1066
1060
  console.error("Error building AVC Decoder Configuration Record:", error);
1067
1061
  return null;
@@ -1112,6 +1106,81 @@ var serializeAvcDecoderConfigurationRecord = (record) => {
1112
1106
  }
1113
1107
  return new Uint8Array(bytes);
1114
1108
  };
1109
+ var parseAvcSps = (sps) => {
1110
+ try {
1111
+ const bitstream = new Bitstream(removeEmulationPreventionBytes(sps));
1112
+ bitstream.skipBits(1);
1113
+ bitstream.skipBits(2);
1114
+ const nalUnitType = bitstream.readBits(5);
1115
+ if (nalUnitType !== 7) {
1116
+ return null;
1117
+ }
1118
+ const profileIdc = bitstream.readAlignedByte();
1119
+ const constraintFlags = bitstream.readAlignedByte();
1120
+ const levelIdc = bitstream.readAlignedByte();
1121
+ readExpGolomb(bitstream);
1122
+ let chromaFormatIdc = null;
1123
+ let bitDepthLumaMinus8 = null;
1124
+ let bitDepthChromaMinus8 = null;
1125
+ if (profileIdc === 100 || profileIdc === 110 || profileIdc === 122 || profileIdc === 244 || profileIdc === 44 || profileIdc === 83 || profileIdc === 86 || profileIdc === 118 || profileIdc === 128) {
1126
+ chromaFormatIdc = readExpGolomb(bitstream);
1127
+ if (chromaFormatIdc === 3) {
1128
+ bitstream.skipBits(1);
1129
+ }
1130
+ bitDepthLumaMinus8 = readExpGolomb(bitstream);
1131
+ bitDepthChromaMinus8 = readExpGolomb(bitstream);
1132
+ bitstream.skipBits(1);
1133
+ const seqScalingMatrixPresentFlag = bitstream.readBits(1);
1134
+ if (seqScalingMatrixPresentFlag) {
1135
+ for (let i = 0;i < (chromaFormatIdc !== 3 ? 8 : 12); i++) {
1136
+ const seqScalingListPresentFlag = bitstream.readBits(1);
1137
+ if (seqScalingListPresentFlag) {
1138
+ const sizeOfScalingList = i < 6 ? 16 : 64;
1139
+ let lastScale = 8;
1140
+ let nextScale = 8;
1141
+ for (let j = 0;j < sizeOfScalingList; j++) {
1142
+ if (nextScale !== 0) {
1143
+ const deltaScale = readSignedExpGolomb(bitstream);
1144
+ nextScale = (lastScale + deltaScale + 256) % 256;
1145
+ }
1146
+ lastScale = nextScale === 0 ? lastScale : nextScale;
1147
+ }
1148
+ }
1149
+ }
1150
+ }
1151
+ }
1152
+ readExpGolomb(bitstream);
1153
+ const picOrderCntType = readExpGolomb(bitstream);
1154
+ if (picOrderCntType === 0) {
1155
+ readExpGolomb(bitstream);
1156
+ } else if (picOrderCntType === 1) {
1157
+ bitstream.skipBits(1);
1158
+ readSignedExpGolomb(bitstream);
1159
+ readSignedExpGolomb(bitstream);
1160
+ const numRefFramesInPicOrderCntCycle = readExpGolomb(bitstream);
1161
+ for (let i = 0;i < numRefFramesInPicOrderCntCycle; i++) {
1162
+ readSignedExpGolomb(bitstream);
1163
+ }
1164
+ }
1165
+ readExpGolomb(bitstream);
1166
+ bitstream.skipBits(1);
1167
+ readExpGolomb(bitstream);
1168
+ readExpGolomb(bitstream);
1169
+ const frameMbsOnlyFlag = bitstream.readBits(1);
1170
+ return {
1171
+ profileIdc,
1172
+ constraintFlags,
1173
+ levelIdc,
1174
+ frameMbsOnlyFlag,
1175
+ chromaFormatIdc,
1176
+ bitDepthLumaMinus8,
1177
+ bitDepthChromaMinus8
1178
+ };
1179
+ } catch (error) {
1180
+ console.error("Error parsing AVC SPS:", error);
1181
+ return null;
1182
+ }
1183
+ };
1115
1184
  var extractNalUnitTypeForHevc = (data) => {
1116
1185
  return data[0] >> 1 & 63;
1117
1186
  };
@@ -1561,7 +1630,7 @@ var FlacBlockType;
1561
1630
  FlacBlockType2[FlacBlockType2["PICTURE"] = 6] = "PICTURE";
1562
1631
  })(FlacBlockType || (FlacBlockType = {}));
1563
1632
 
1564
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/custom-coder.js
1633
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/custom-coder.js
1565
1634
  /*!
1566
1635
  * Copyright (c) 2025-present, Vanilagy and contributors
1567
1636
  *
@@ -1571,7 +1640,7 @@ var FlacBlockType;
1571
1640
  */
1572
1641
  var customVideoEncoders = [];
1573
1642
 
1574
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/packet.js
1643
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/packet.js
1575
1644
  /*!
1576
1645
  * Copyright (c) 2025-present, Vanilagy and contributors
1577
1646
  *
@@ -1579,7 +1648,7 @@ var customVideoEncoders = [];
1579
1648
  * License, v. 2.0. If a copy of the MPL was not distributed with this
1580
1649
  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
1581
1650
  */
1582
- var PLACEHOLDER_DATA = new Uint8Array(0);
1651
+ var PLACEHOLDER_DATA = /* @__PURE__ */ new Uint8Array(0);
1583
1652
 
1584
1653
  class EncodedPacket {
1585
1654
  constructor(data, type, timestamp, duration, sequenceNumber = -1, byteLength, sideData) {
@@ -1703,7 +1772,7 @@ class EncodedPacket {
1703
1772
  }
1704
1773
  }
1705
1774
 
1706
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/sample.js
1775
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/sample.js
1707
1776
  /*!
1708
1777
  * Copyright (c) 2025-present, Vanilagy and contributors
1709
1778
  *
@@ -2056,12 +2125,14 @@ class VideoSample {
2056
2125
  dx = (canvasWidth - newWidth) / 2;
2057
2126
  dy = (canvasHeight - newHeight) / 2;
2058
2127
  }
2128
+ context.save();
2059
2129
  const aspectRatioChange = rotation % 180 === 0 ? 1 : newWidth / newHeight;
2060
2130
  context.translate(canvasWidth / 2, canvasHeight / 2);
2061
2131
  context.rotate(rotation * Math.PI / 180);
2062
2132
  context.scale(1 / aspectRatioChange, aspectRatioChange);
2063
2133
  context.translate(-canvasWidth / 2, -canvasHeight / 2);
2064
2134
  context.drawImage(this.toCanvasImageSource(), sx, sy, sWidth, sHeight, dx, dy, newWidth, newHeight);
2135
+ context.restore();
2065
2136
  }
2066
2137
  _rotateSourceRegion(sx, sy, sWidth, sHeight, rotation) {
2067
2138
  if (rotation === 90) {
@@ -2151,7 +2222,7 @@ var validateCropRectangle = (crop, prefix) => {
2151
2222
  };
2152
2223
  var AUDIO_SAMPLE_FORMATS = new Set(["f32", "f32-planar", "s16", "s16-planar", "s32", "s32-planar", "u8", "u8-planar"]);
2153
2224
 
2154
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-misc.js
2225
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-misc.js
2155
2226
  /*!
2156
2227
  * Copyright (c) 2025-present, Vanilagy and contributors
2157
2228
  *
@@ -2169,7 +2240,7 @@ var buildIsobmffMimeType = (info) => {
2169
2240
  return string;
2170
2241
  };
2171
2242
 
2172
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-reader.js
2243
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-reader.js
2173
2244
  /*!
2174
2245
  * Copyright (c) 2025-present, Vanilagy and contributors
2175
2246
  *
@@ -2180,7 +2251,7 @@ var buildIsobmffMimeType = (info) => {
2180
2251
  var MIN_BOX_HEADER_SIZE = 8;
2181
2252
  var MAX_BOX_HEADER_SIZE = 16;
2182
2253
 
2183
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/matroska/ebml.js
2254
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/matroska/ebml.js
2184
2255
  /*!
2185
2256
  * Copyright (c) 2025-present, Vanilagy and contributors
2186
2257
  *
@@ -2241,6 +2312,10 @@ var EBMLId;
2241
2312
  EBMLId2[EBMLId2["FlagEnabled"] = 185] = "FlagEnabled";
2242
2313
  EBMLId2[EBMLId2["FlagDefault"] = 136] = "FlagDefault";
2243
2314
  EBMLId2[EBMLId2["FlagForced"] = 21930] = "FlagForced";
2315
+ EBMLId2[EBMLId2["FlagOriginal"] = 21934] = "FlagOriginal";
2316
+ EBMLId2[EBMLId2["FlagHearingImpaired"] = 21931] = "FlagHearingImpaired";
2317
+ EBMLId2[EBMLId2["FlagVisualImpaired"] = 21932] = "FlagVisualImpaired";
2318
+ EBMLId2[EBMLId2["FlagCommentary"] = 21935] = "FlagCommentary";
2244
2319
  EBMLId2[EBMLId2["FlagLacing"] = 156] = "FlagLacing";
2245
2320
  EBMLId2[EBMLId2["Name"] = 21358] = "Name";
2246
2321
  EBMLId2[EBMLId2["Language"] = 2274716] = "Language";
@@ -2586,7 +2661,7 @@ var CODEC_STRING_MAP = {
2586
2661
  webvtt: "S_TEXT/WEBVTT"
2587
2662
  };
2588
2663
 
2589
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/matroska/matroska-misc.js
2664
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/matroska/matroska-misc.js
2590
2665
  /*!
2591
2666
  * Copyright (c) 2025-present, Vanilagy and contributors
2592
2667
  *
@@ -2604,7 +2679,7 @@ var buildMatroskaMimeType = (info) => {
2604
2679
  return string;
2605
2680
  };
2606
2681
 
2607
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/subtitles.js
2682
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/subtitles.js
2608
2683
  /*!
2609
2684
  * Copyright (c) 2025-present, Vanilagy and contributors
2610
2685
  *
@@ -2628,7 +2703,7 @@ var formatSubtitleTimestamp = (timestamp) => {
2628
2703
  return hours.toString().padStart(2, "0") + ":" + minutes.toString().padStart(2, "0") + ":" + seconds.toString().padStart(2, "0") + "." + milliseconds.toString().padStart(3, "0");
2629
2704
  };
2630
2705
 
2631
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-boxes.js
2706
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-boxes.js
2632
2707
  /*!
2633
2708
  * Copyright (c) 2025-present, Vanilagy and contributors
2634
2709
  *
@@ -2719,8 +2794,8 @@ class IsobmffBoxWriter {
2719
2794
  }
2720
2795
  }
2721
2796
  }
2722
- var bytes = new Uint8Array(8);
2723
- var view = new DataView(bytes.buffer);
2797
+ var bytes = /* @__PURE__ */ new Uint8Array(8);
2798
+ var view = /* @__PURE__ */ new DataView(bytes.buffer);
2724
2799
  var u8 = (value) => {
2725
2800
  return [(value % 256 + 256) % 256];
2726
2801
  };
@@ -2808,7 +2883,7 @@ var rotationMatrix = (rotationInDegrees) => {
2808
2883
  1
2809
2884
  ];
2810
2885
  };
2811
- var IDENTITY_MATRIX = rotationMatrix(0);
2886
+ var IDENTITY_MATRIX = /* @__PURE__ */ rotationMatrix(0);
2812
2887
  var matrixToBytes = (matrix) => {
2813
2888
  return [
2814
2889
  fixed_16_16(matrix[0]),
@@ -2907,7 +2982,11 @@ var tkhd = (trackData, creationTime) => {
2907
2982
  } else {
2908
2983
  matrix = IDENTITY_MATRIX;
2909
2984
  }
2910
- return fullBox("tkhd", +needsU64, 3, [
2985
+ let flags = 2;
2986
+ if (trackData.track.metadata.disposition?.default !== false) {
2987
+ flags |= 1;
2988
+ }
2989
+ return fullBox("tkhd", +needsU64, flags, [
2911
2990
  u32OrU64(creationTime),
2912
2991
  u32OrU64(creationTime),
2913
2992
  u32(trackData.track.id),
@@ -3006,7 +3085,7 @@ var stbl = (trackData) => {
3006
3085
  var stsd = (trackData) => {
3007
3086
  let sampleDescription;
3008
3087
  if (trackData.type === "video") {
3009
- sampleDescription = videoSampleDescription(VIDEO_CODEC_TO_BOX_NAME[trackData.track.source._codec], trackData);
3088
+ sampleDescription = videoSampleDescription(videoCodecToBoxName(trackData.track.source._codec, trackData.info.decoderConfig.codec), trackData);
3010
3089
  } else if (trackData.type === "audio") {
3011
3090
  const boxName = audioCodecToBoxName(trackData.track.source._codec, trackData.muxer.isQuickTime);
3012
3091
  assert(boxName);
@@ -3794,12 +3873,19 @@ var dataStringBoxLong = (value) => {
3794
3873
  ...textEncoder.encode(value)
3795
3874
  ]);
3796
3875
  };
3797
- var VIDEO_CODEC_TO_BOX_NAME = {
3798
- avc: "avc1",
3799
- hevc: "hvc1",
3800
- vp8: "vp08",
3801
- vp9: "vp09",
3802
- av1: "av01"
3876
+ var videoCodecToBoxName = (codec, fullCodecString) => {
3877
+ switch (codec) {
3878
+ case "avc":
3879
+ return fullCodecString.startsWith("avc3") ? "avc3" : "avc1";
3880
+ case "hevc":
3881
+ return "hvc1";
3882
+ case "vp8":
3883
+ return "vp08";
3884
+ case "vp9":
3885
+ return "vp09";
3886
+ case "av1":
3887
+ return "av01";
3888
+ }
3803
3889
  };
3804
3890
  var VIDEO_CODEC_TO_CONFIGURATION_BOX = {
3805
3891
  avc: avcC,
@@ -3951,7 +4037,7 @@ var getLanguageCodeInt = (code) => {
3951
4037
  return language;
3952
4038
  };
3953
4039
 
3954
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/writer.js
4040
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/writer.js
3955
4041
  /*!
3956
4042
  * Copyright (c) 2025-present, Vanilagy and contributors
3957
4043
  *
@@ -4079,7 +4165,7 @@ class BufferTargetWriter extends Writer {
4079
4165
  }
4080
4166
  var DEFAULT_CHUNK_SIZE = 2 ** 24;
4081
4167
 
4082
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/target.js
4168
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/target.js
4083
4169
  var nodeAlias = (() => ({}));
4084
4170
  /*!
4085
4171
  * Copyright (c) 2025-present, Vanilagy and contributors
@@ -4105,7 +4191,7 @@ class BufferTarget extends Target {
4105
4191
  }
4106
4192
  }
4107
4193
 
4108
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-muxer.js
4194
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-muxer.js
4109
4195
  /*!
4110
4196
  * Copyright (c) 2025-present, Vanilagy and contributors
4111
4197
  *
@@ -4932,7 +5018,7 @@ class IsobmffMuxer extends Muxer {
4932
5018
  }
4933
5019
  }
4934
5020
 
4935
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/matroska/matroska-muxer.js
5021
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/matroska/matroska-muxer.js
4936
5022
  /*!
4937
5023
  * Copyright (c) 2025-present, Vanilagy and contributors
4938
5024
  *
@@ -5087,6 +5173,12 @@ class MatroskaMuxer extends Muxer {
5087
5173
  { id: EBMLId.TrackNumber, data: trackData.track.id },
5088
5174
  { id: EBMLId.TrackUID, data: trackData.track.id },
5089
5175
  { id: EBMLId.TrackType, data: TRACK_TYPE_MAP[trackData.type] },
5176
+ trackData.track.metadata.disposition?.default === false ? { id: EBMLId.FlagDefault, data: 0 } : null,
5177
+ trackData.track.metadata.disposition?.forced ? { id: EBMLId.FlagForced, data: 1 } : null,
5178
+ trackData.track.metadata.disposition?.hearingImpaired ? { id: EBMLId.FlagHearingImpaired, data: 1 } : null,
5179
+ trackData.track.metadata.disposition?.visuallyImpaired ? { id: EBMLId.FlagVisualImpaired, data: 1 } : null,
5180
+ trackData.track.metadata.disposition?.original ? { id: EBMLId.FlagOriginal, data: 1 } : null,
5181
+ trackData.track.metadata.disposition?.commentary ? { id: EBMLId.FlagCommentary, data: 1 } : null,
5090
5182
  { id: EBMLId.FlagLacing, data: 0 },
5091
5183
  { id: EBMLId.Language, data: trackData.track.metadata.languageCode ?? UNDETERMINED_LANGUAGE },
5092
5184
  { id: EBMLId.CodecID, data: codecId },
@@ -5809,7 +5901,7 @@ ${cue.notes ?? ""}`;
5809
5901
  }
5810
5902
  }
5811
5903
 
5812
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/output-format.js
5904
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/output-format.js
5813
5905
  /*!
5814
5906
  * Copyright (c) 2025-present, Vanilagy and contributors
5815
5907
  *
@@ -6027,7 +6119,7 @@ class WebMOutputFormat extends MkvOutputFormat {
6027
6119
  }
6028
6120
  }
6029
6121
 
6030
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/encode.js
6122
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/encode.js
6031
6123
  /*!
6032
6124
  * Copyright (c) 2025-present, Vanilagy and contributors
6033
6125
  *
@@ -6170,13 +6262,13 @@ class Quality {
6170
6262
  return Math.round(finalBitrate / 1000) * 1000;
6171
6263
  }
6172
6264
  }
6173
- var QUALITY_VERY_LOW = new Quality(0.3);
6174
- var QUALITY_LOW = new Quality(0.6);
6175
- var QUALITY_MEDIUM = new Quality(1);
6176
- var QUALITY_HIGH = new Quality(2);
6177
- var QUALITY_VERY_HIGH = new Quality(4);
6265
+ var QUALITY_VERY_LOW = /* @__PURE__ */ new Quality(0.3);
6266
+ var QUALITY_LOW = /* @__PURE__ */ new Quality(0.6);
6267
+ var QUALITY_MEDIUM = /* @__PURE__ */ new Quality(1);
6268
+ var QUALITY_HIGH = /* @__PURE__ */ new Quality(2);
6269
+ var QUALITY_VERY_HIGH = /* @__PURE__ */ new Quality(4);
6178
6270
 
6179
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/media-source.js
6271
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/media-source.js
6180
6272
  /*!
6181
6273
  * Copyright (c) 2025-present, Vanilagy and contributors
6182
6274
  *
@@ -6817,7 +6909,7 @@ class SubtitleSource extends MediaSource {
6817
6909
  }
6818
6910
  }
6819
6911
 
6820
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/output.js
6912
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/output.js
6821
6913
  /*!
6822
6914
  * Copyright (c) 2025-present, Vanilagy and contributors
6823
6915
  *
@@ -6836,6 +6928,9 @@ var validateBaseTrackMetadata = (metadata) => {
6836
6928
  if (metadata.name !== undefined && typeof metadata.name !== "string") {
6837
6929
  throw new TypeError("metadata.name, when provided, must be a string.");
6838
6930
  }
6931
+ if (metadata.disposition !== undefined) {
6932
+ validateTrackDisposition(metadata.disposition);
6933
+ }
6839
6934
  if (metadata.maximumPacketCount !== undefined && (!Number.isInteger(metadata.maximumPacketCount) || metadata.maximumPacketCount < 0)) {
6840
6935
  throw new TypeError("metadata.maximumPacketCount, when provided, must be a non-negative integer.");
6841
6936
  }
@@ -7028,7 +7123,7 @@ class Output {
7028
7123
  })();
7029
7124
  }
7030
7125
  }
7031
- // ../../node_modules/.bun/mediabunny@1.24.5/node_modules/mediabunny/dist/modules/src/index.js
7126
+ // ../../node_modules/.bun/mediabunny@1.25.3/node_modules/mediabunny/dist/modules/src/index.js
7032
7127
  /*!
7033
7128
  * Copyright (c) 2025-present, Vanilagy and contributors
7034
7129
  *
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/web-renderer"
4
4
  },
5
5
  "name": "@remotion/web-renderer",
6
- "version": "4.0.380",
6
+ "version": "4.0.381",
7
7
  "main": "dist/index.js",
8
8
  "sideEffects": false,
9
9
  "scripts": {
@@ -16,13 +16,13 @@
16
16
  "author": "Remotion <jonny@remotion.dev>",
17
17
  "license": "UNLICENSED",
18
18
  "dependencies": {
19
- "remotion": "4.0.380",
20
- "mediabunny": "1.24.5"
19
+ "remotion": "4.0.381",
20
+ "mediabunny": "1.25.3"
21
21
  },
22
22
  "devDependencies": {
23
- "@remotion/eslint-config-internal": "4.0.380",
24
- "@remotion/player": "4.0.380",
25
- "@remotion/media": "4.0.380",
23
+ "@remotion/eslint-config-internal": "4.0.381",
24
+ "@remotion/player": "4.0.381",
25
+ "@remotion/media": "4.0.381",
26
26
  "@vitejs/plugin-react": "^5.1.0",
27
27
  "@vitest/browser-playwright": "4.0.9",
28
28
  "playwright": "1.55.1",