Skip to content

🎥 Make videos programmatically with React

hmm

Jonny Burgerab89abf9aca8
diff --git a/packages/convert/app/tests/test-list.tsx b/packages/convert/app/tests/test-list.tsx
index ee33491886..6f9d3f011f 100644
--- a/packages/convert/app/tests/test-list.tsx
+++ b/packages/convert/app/tests/test-list.tsx
@@ -161,6 +161,7 @@ export const offsetTimestamps = (): TestStructure => {
await convertMedia({
src,
container: 'webm',
+ onAudioTrack: allowSafariAudioDrop,
onProgress: makeProgressReporter(onUpdate),
});
},
@@ -178,6 +179,7 @@ export const transportStream = (): TestStructure => {
await convertMedia({
src,
container: 'webm',
+ onAudioTrack: allowSafariAudioDrop,
onProgress: makeProgressReporter(onUpdate),
});
},
diff --git a/packages/webcodecs/src/on-audio-track.ts b/packages/webcodecs/src/on-audio-track.ts
index a0eccfe3c7..434adc1366 100644
--- a/packages/webcodecs/src/on-audio-track.ts
+++ b/packages/webcodecs/src/on-audio-track.ts
@@ -55,7 +55,7 @@ export const makeAudioTrackHandler =
if (audioOperation.type === 'fail') {
throw new Error(
- `Audio track with ID ${track.trackId} could resolved with {"type": "fail"}. This could mean that this audio track could neither be copied to the output container or re-encoded. You have the option to drop the track instead of failing it: https://remotion.dev/docs/webcodecs/track-transformation`,
+ `Audio track with ID ${track.trackId} resolved with {"type": "fail"}. This could mean that this audio track could neither be copied to the output container or re-encoded. You have the option to drop the track instead of failing it: https://remotion.dev/docs/webcodecs/track-transformation`,
);
}
diff --git a/packages/webcodecs/src/on-frame.ts b/packages/webcodecs/src/on-frame.ts
index 7f9a72b129..0aa95d2172 100644
--- a/packages/webcodecs/src/on-frame.ts
+++ b/packages/webcodecs/src/on-frame.ts
@@ -1,4 +1,5 @@
import type {VideoTrack} from '@remotion/media-parser';
+import {isSafari} from './browser-quirks';
import type {ConvertMediaOnVideoFrame} from './convert-media';
import {convertToCorrectVideoFrame} from './convert-to-correct-videoframe';
import type {ConvertMediaVideoCodec} from './get-available-video-codecs';
@@ -44,7 +45,9 @@ export const onFrame = async ({
);
}
- if (userProcessedFrame.timestamp !== rotated.timestamp) {
+ // In Safari, calling new VideoFrame() might change the timestamp
+ // In flipVideo test from 803000 to 803299
+ if (userProcessedFrame.timestamp !== rotated.timestamp && !isSafari()) {
throw new Error(
`Returned VideoFrame of track ${track.trackId} has different timestamp (${userProcessedFrame.timestamp}) than the input frame (${rotated.timestamp}). When calling new VideoFrame(), pass {timestamp: frame.timestamp} as second argument`,
);
diff --git a/packages/webcodecs/src/on-video-track.ts b/packages/webcodecs/src/on-video-track.ts
index 7a87fd7022..508cfa3c01 100644
--- a/packages/webcodecs/src/on-video-track.ts
+++ b/packages/webcodecs/src/on-video-track.ts
@@ -67,7 +67,7 @@ export const makeVideoTrackHandler =
if (videoOperation.type === 'fail') {
throw new Error(
- `Video track with ID ${track.trackId} could resolved with {"type": "fail"}. This could mean that this video track could neither be copied to the output container or re-encoded. You have the option to drop the track instead of failing it: https://remotion.dev/docs/webcodecs/track-transformation`,
+ `Video track with ID ${track.trackId} could with {"type": "fail"}. This could mean that this video track could neither be copied to the output container or re-encoded. You have the option to drop the track instead of failing it: https://remotion.dev/docs/webcodecs/track-transformation`,
);
}