Skip to content

🎥 Make videos programmatically with React

fix no audio

Jonny Burgercde4a24a6170
diff --git a/packages/example/src/AudioTesting/music.mp3 b/packages/example/public/music.mp3
similarity index 100%
rename from packages/example/src/AudioTesting/music.mp3
rename to packages/example/public/music.mp3
diff --git a/packages/example/src/AudioTesting/index.tsx b/packages/example/src/AudioTesting/index.tsx
index 6c03469f66..0c209de017 100644
--- a/packages/example/src/AudioTesting/index.tsx
+++ b/packages/example/src/AudioTesting/index.tsx
@@ -1,5 +1,5 @@
+import {staticFile} from 'remotion';
import {Audio, interpolate, Sequence} from 'remotion';
-import music from './music.mp3';
const AudioTesting: React.FC = () => {
return (
@@ -8,7 +8,7 @@ const AudioTesting: React.FC = () => {
<Audio
startFrom={100}
endAt={200}
- src={music}
+ src={staticFile('music.mp3')}
volume={(f) =>
interpolate(f, [0, 50, 100], [0, 1, 0], {
extrapolateLeft: 'clamp',
diff --git a/packages/example/src/TenFrameTester/index.tsx b/packages/example/src/TenFrameTester/index.tsx
index 616d5d76c1..1346d7470b 100644
--- a/packages/example/src/TenFrameTester/index.tsx
+++ b/packages/example/src/TenFrameTester/index.tsx
@@ -1,4 +1,10 @@
+import {AbsoluteFill, Audio, staticFile} from 'remotion';
import ReactSvg from '../ReactSvg';
// Short video that is fast to render for testing
-export const TenFrameTester: React.FC = () => <ReactSvg transparent={false} />;
+export const TenFrameTester: React.FC = () => (
+ <AbsoluteFill>
+ <ReactSvg transparent={false} />
+ <Audio src={staticFile('music.mp3')} />
+ </AbsoluteFill>
+);
diff --git a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
index df78d383b0..45c3fcffa7 100644
--- a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
+++ b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
@@ -36,7 +36,7 @@ test('Should make a transparent video', async () => {
serveUrl: 'https://competent-mccarthy-56f7c9.netlify.app/',
chromiumOptions: {},
codec: 'vp8',
- composition: 'react-svg',
+ composition: 'ten-frame-tester',
crf: 9,
enableChunkOptimization: false,
envVariables: {},
diff --git a/packages/renderer/src/render-media.ts b/packages/renderer/src/render-media.ts
index 82d266aeba..2d96ceba89 100644
--- a/packages/renderer/src/render-media.ts
+++ b/packages/renderer/src/render-media.ts
@@ -228,7 +228,7 @@ export const renderMedia = async ({
fps: composition.fps,
outputLocation,
internalOptions: {
- parallelEncoding,
+ parallelEncoding: false,
preEncodedFileLocation,
},
force: overwrite ?? Internals.DEFAULT_OVERWRITE,
diff --git a/tests/integration/rendering.test.ts b/tests/integration/rendering.test.ts
index 783d773fd5..9dde929530 100644
--- a/tests/integration/rendering.test.ts
+++ b/tests/integration/rendering.test.ts
@@ -37,6 +37,7 @@ test("Should be able to render video", async () => {
expect(data).toContain("yuv420p");
expect(data).toContain("1080x1080");
expect(data).toContain("30 fps");
+ expect(data).toContain("Audio: aac");
});
test("Should fail to render out of range CRF", async () => {