Skip to content

🎥 Make videos programmatically with React

chrome audio codec override

Jonny Burgerfe6568f2ee19
diff --git a/packages/media-parser/src/boxes/iso-base-media/esds/decoder-specific-config.ts b/packages/media-parser/src/boxes/iso-base-media/esds/decoder-specific-config.ts
index bf3af5c390..424850d1d1 100644
--- a/packages/media-parser/src/boxes/iso-base-media/esds/decoder-specific-config.ts
+++ b/packages/media-parser/src/boxes/iso-base-media/esds/decoder-specific-config.ts
@@ -54,7 +54,19 @@ export const parseDecoderSpecificConfig = (
iterator.discard(layerSize - read);
}
+ let patchedBytes = bytes;
+
+ if (bytes[0] === 18 && bytes[1] === 16) {
+ // riverside_use_cursor_.mp4
+ patchedBytes = new Uint8Array([18, 8]);
+ Log.warn(
+ logLevel,
+ 'Chrome has a bug and might not be able to decode this audio. It will be fixed, see: https://issues.chromium.org/issues/360083330',
+ );
+ }
+
if (bytes.byteLength === 2 && bytes[0] === 17 && bytes[1] === 136) {
+ patchedBytes = new Uint8Array([18, 144]);
Log.warn(
logLevel,
'Chrome has a bug and might not be able to decode this audio. It will be fixed, see: https://issues.chromium.org/issues/360083330',
@@ -66,6 +78,6 @@ export const parseDecoderSpecificConfig = (
audioObjectType,
samplingFrequencyIndex,
channelConfiguration,
- asBytes: bytes,
+ asBytes: patchedBytes,
};
};