Skip to content

🎥 Make videos programmatically with React

force all videos to be stereo

Jonny Burger830dc023da0f
diff --git a/packages/example/src/22KhzAudio/index.tsx b/packages/example/src/22KhzAudio/index.tsx
index c6b21376ae..1a7516056f 100644
--- a/packages/example/src/22KhzAudio/index.tsx
+++ b/packages/example/src/22KhzAudio/index.tsx
@@ -1,18 +1,15 @@
-import {Video} from 'remotion';
import {Audio, Sequence} from 'remotion';
import {AbsoluteFill, staticFile} from 'remotion';
-import music from '../AudioTesting/music.mp3';
export const TwentyTwoKHzAudio = () => {
const twenty = staticFile('22khz.wav');
return (
<AbsoluteFill>
<Sequence from={1} durationInFrames={30}>
- <Audio src={music} />
+ <Audio src={staticFile('music.mp3')} />
</Sequence>
- <Sequence from={31} durationInFrames={60}>
+ <Sequence from={31} durationInFrames={100}>
<Audio src={twenty} />
- <Video src="./assets/CoffinDance.mp4" />
</Sequence>
</AbsoluteFill>
);
diff --git a/packages/lambda/remotionlambda.zip b/packages/lambda/remotionlambda.zip
index 79e93894a7..b126da4b28 100644
Binary files a/packages/lambda/remotionlambda.zip and b/packages/lambda/remotionlambda.zip differ
diff --git a/packages/renderer/src/stitcher.ts b/packages/renderer/src/stitcher.ts
index f76ba0f6ca..de14be1023 100644
--- a/packages/renderer/src/stitcher.ts
+++ b/packages/renderer/src/stitcher.ts
@@ -213,6 +213,10 @@ export const spawnFfmpeg = async (options: StitcherOptions) => {
]),
'-ar',
String(DEFAULT_SAMPLE_RATE),
+ // Stereo sound, even force mono to be stereo
+ // Otherwise mixing mono + stereo ends up speeding up the audio
+ '-ac',
+ '2',
audioCodecName ? ['-c:a', audioCodecName] : null,
complexFilterFlag,
// Ignore audio from image sequence