🎥 Make videos programmatically with React
use bun x more
JonnyBurgerd253a7e98f20
diff --git a/packages/example/runcloudrun.sh b/packages/example/runcloudrun.shindex 6ce282dbf8..d3eeef8732 100644--- a/packages/example/runcloudrun.sh+++ b/packages/example/runcloudrun.sh@@ -11,7 +11,7 @@ ARTIFACT_REGISTRY_ENV=development node submit.mjscd ..cd ..cd example-pnpm exec remotion cloudrun services rmall -f-pnpm exec remotion cloudrun sites create --site-name=testbed-ARTIFACT_REGISTRY_ENV=development pnpm exec remotion cloudrun services deploy --cpuLimit=4.0-pnpm exec remotion cloudrun render testbed OffthreadRemoteVideo --log=verbose+bunx remotion cloudrun services rmall -f+bunx remotion cloudrun sites create --site-name=testbed+ARTIFACT_REGISTRY_ENV=development bunx remotion cloudrun services deploy --cpuLimit=4.0+bunx remotion cloudrun render testbed OffthreadRemoteVideo --log=verbosediff --git a/packages/example/src/test/stills-and-colorspaces.test.ts b/packages/example/src/test/stills-and-colorspaces.test.tsindex a8e8dd8ef9..230d297bd8 100644--- a/packages/example/src/test/stills-and-colorspaces.test.ts+++ b/packages/example/src/test/stills-and-colorspaces.test.ts@@ -153,7 +153,7 @@ test('Bt709 encoding should work', async () => {writeFileSync('out.mp4', new Uint8Array(buffer as Buffer));- execSync('pnpm exec remotion ffmpeg -i - -frames:v 1 -c:v png out%02d.png', {+ execSync('bunx remotion ffmpeg -i - -frames:v 1 -c:v png out%02d.png', {input: new Uint8Array(buffer as Buffer),stdio: ['pipe', 'ignore', 'ignore'],});diff --git a/packages/example/testlambda.mjs b/packages/example/testlambda.mjsindex 01831796df..dee371a04f 100644--- a/packages/example/testlambda.mjs+++ b/packages/example/testlambda.mjs@@ -10,31 +10,28 @@ execSync('bunx remotion lambda functions rmall -f', {});execSync(- 'pnpm exec remotion lambda sites create --site-name=testbed-v6 --enable-folder-expiry=true --log=verbose',+ 'bunx remotion lambda sites create --site-name=testbed-v6 --enable-folder-expiry=true --log=verbose',{stdio: 'inherit',},);-execSync('pnpm exec remotion lambda functions deploy --memory=3000', {+execSync('bunx remotion lambda functions deploy --memory=3000', {stdio: 'inherit',});execSync(- 'pnpm exec remotion lambda render testbed-v6 react-svg --log=verbose --delete-after="1-day"',+ 'bunx remotion lambda render testbed-v6 react-svg --log=verbose --delete-after="1-day"',{stdio: 'inherit',},);+execSync('bunx remotion lambda still testbed-v6 huge-payload --log=verbose', {+ stdio: 'inherit',+});execSync(- 'pnpm exec remotion lambda still testbed-v6 huge-payload --log=verbose',- {- stdio: 'inherit',- },-);-execSync(- `pnpm exec remotion lambda still testbed-v6 140kb-payload --props='${JSON.stringify(+ `bunx remotion lambda still testbed-v6 140kb-payload --props='${JSON.stringify({str: 'a'.repeat(140 * 1000),date: 'remotion-date:' + new Date('2020-01-01').toISOString(),diff --git a/packages/example/testlambdaintegrations.mjs b/packages/example/testlambdaintegrations.mjsindex 930fceca84..2e6c3be18b 100644--- a/packages/example/testlambdaintegrations.mjs+++ b/packages/example/testlambdaintegrations.mjs@@ -4,7 +4,7 @@ import dotenv from 'dotenv';dotenv.config();const functionName = execSync(- `pnpm exec remotion lambda functions ls -q --compatible-only`,+ `bunx remotion lambda functions ls -q --compatible-only`,).toString('utf8').trim()diff --git a/packages/example/testoffthreadvideo.ts b/packages/example/testoffthreadvideo.tsindex 93f31431be..55b4f10ece 100644--- a/packages/example/testoffthreadvideo.ts+++ b/packages/example/testoffthreadvideo.ts@@ -10,7 +10,7 @@ const files = readdirSync('public/offthreadvideoregression').filter(for (const file of files) {console.log(`Rendering ${file}`);execSync(- `pnpm exec remotion render OffthreadRemoteVideo --props='{"src": "offthreadvideoregression/${file}"}' out/regressions/${file}.mp4 --log=verbose`,+ `bunx remotion render OffthreadRemoteVideo --props='{"src": "offthreadvideoregression/${file}"}' out/regressions/${file}.mp4 --log=verbose`,{stdio: 'inherit'},);}diff --git a/packages/it-tests/src/bundle/studio.test.ts b/packages/it-tests/src/bundle/studio.test.tsindex 3211502858..b74af738a3 100644--- a/packages/it-tests/src/bundle/studio.test.ts+++ b/packages/it-tests/src/bundle/studio.test.ts@@ -3,7 +3,7 @@ import {execSync} from 'child_process';import path from 'path';test('Should be able to start the studio without zod installed', () => {- const res = execSync('pnpm exec remotion studio --test-for-server-open', {+ const res = execSync('bunx remotion studio --test-for-server-open', {cwd: path.join(process.cwd(), '..', 'example-without-zod'),}).toString('utf-8');@@ -14,7 +14,7 @@ test('Should be able to start the studio without zod installed', () => {});test('Should be able to start the studio', () => {- const res = execSync('pnpm exec remotion studio --test-for-server-open', {+ const res = execSync('bunx remotion studio --test-for-server-open', {cwd: path.join(process.cwd(), '..', 'example'),}).toString('utf-8');// Should not print warnings or errorsdiff --git a/packages/it-tests/src/lambda/lambda-integration.test.ts b/packages/it-tests/src/lambda/lambda-integration.test.tsindex 1be851f549..fed853826b 100644--- a/packages/it-tests/src/lambda/lambda-integration.test.ts+++ b/packages/it-tests/src/lambda/lambda-integration.test.ts@@ -3,7 +3,7 @@ import execa from 'execa';import path from 'path';test('Should be able to call pnpm exec remotion lambda', async () => {- const task = await execa('pnpm', ['exec', 'remotion', 'lambda'], {+ const task = await execa('bun', ['x', 'remotion', 'lambda'], {cwd: path.join(process.cwd(), '..', 'example'),});expect(task.stdout).toContain('Available commands');@@ -11,8 +11,8 @@ test('Should be able to call pnpm exec remotion lambda', async () => {test('Should be able to get user policy without authentication', async () => {const task = await execa(- 'pnpm',- ['exec', 'remotion', 'lambda', 'policies', 'user'],+ 'bun',+ ['x', 'remotion', 'lambda', 'policies', 'user'],{cwd: path.join(process.cwd(), '..', 'example'),},@@ -22,8 +22,8 @@ test('Should be able to get user policy without authentication', async () => {test('Should be able to get role policy without authentication', async () => {const task = await execa(- 'pnpm',- ['exec', 'remotion', 'lambda', 'policies', 'role'],+ 'bun',+ ['x', 'remotion', 'lambda', 'policies', 'role'],{cwd: path.join(process.cwd(), '..', 'example'),},diff --git a/packages/it-tests/src/rendering/base64-audio.test.ts b/packages/it-tests/src/rendering/base64-audio.test.tsindex e5359102b7..9325c4d6f5 100644--- a/packages/it-tests/src/rendering/base64-audio.test.ts+++ b/packages/it-tests/src/rendering/base64-audio.test.ts@@ -21,8 +21,8 @@ test('Should be able to render a MP3 audio file',async () => {const task = execa(- 'pnpm',- ['exec', 'remotion', 'render', 'audio-testing-base64', outputPath],+ 'bun',+ ['x', 'remotion', 'render', 'audio-testing-base64', outputPath],{cwd: path.join(process.cwd(), '..', 'example'),},diff --git a/packages/it-tests/src/rendering/cancel-render.test.ts b/packages/it-tests/src/rendering/cancel-render.test.tsindex 9fbbc4c58c..4c6b6ebd4e 100644--- a/packages/it-tests/src/rendering/cancel-render.test.ts+++ b/packages/it-tests/src/rendering/cancel-render.test.ts@@ -12,7 +12,7 @@ beforeAll(async () => {if (process.env.CI) {return;}- await execa('pnpm', ['exec', 'remotion', 'bundle'], {+ await execa('bun', ['x', 'remotion', 'bundle'], {cwd: path.join(process.cwd(), '..', 'example'),});});@@ -32,9 +32,9 @@ test('Should fail to render if cancelRender() was being used',async () => {const task = await execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','render','build',diff --git a/packages/it-tests/src/rendering/frame-accuracy-gif.test.ts b/packages/it-tests/src/rendering/frame-accuracy-gif.test.tsindex 6f3dbb61a4..95a1184fc0 100644--- a/packages/it-tests/src/rendering/frame-accuracy-gif.test.ts+++ b/packages/it-tests/src/rendering/frame-accuracy-gif.test.ts@@ -20,9 +20,9 @@ const getMissedFramesforCodec = async () => {// render the VideoTesting example (which contains the Framer composition embedded with <Html5Video>) to an image// sequence which can be checked for accuracyawait execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','render',`video-testing-mp4-offthread`,diff --git a/packages/it-tests/src/rendering/render-scale.test.ts b/packages/it-tests/src/rendering/render-scale.test.tsindex 72933d976f..dbabed589c 100644--- a/packages/it-tests/src/rendering/render-scale.test.ts+++ b/packages/it-tests/src/rendering/render-scale.test.ts@@ -22,9 +22,9 @@ test('Should be able to render video with scale 2',async () => {const task = execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','render','src/index.ts',@@ -73,9 +73,9 @@ test('Should be able to render video with scale 0.1',async () => {const task = execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','render','build',diff --git a/packages/it-tests/src/rendering/rendering.test.ts b/packages/it-tests/src/rendering/rendering.test.tsindex 709334df57..fcd88c8dd7 100644--- a/packages/it-tests/src/rendering/rendering.test.ts+++ b/packages/it-tests/src/rendering/rendering.test.ts@@ -14,7 +14,7 @@ beforeAll(async () => {if (process.env.CI) {return;}- await execa('pnpm', ['exec', 'remotion', 'bundle'], {+ await execa('bun', ['x', 'remotion', 'bundle'], {cwd: path.join(process.cwd(), '..', 'example'),});});@@ -35,9 +35,9 @@ test('Should be able to render video with custom port',async () => {const task = execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','render','build',@@ -82,9 +82,9 @@ test('Should fail to render out of range CRF',async () => {const task = await execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','render','build',@@ -116,9 +116,9 @@ test(const out = outputPath.replace('.mp4', '');const task = await execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','render','build',@@ -144,9 +144,9 @@ test('Should fail to render out of range frame when range is a string',async () => {const task = await execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','render','build',@@ -171,9 +171,9 @@ test(async () => {const out = outputPath.replace('.mp4', '.mov');const task = await execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','render','build',@@ -216,9 +216,9 @@ test(const outDir = outputPath.replace('.mp4', '');const outImg = path.join(outDir, 'element-2.png');const task = await execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','render','build',@@ -256,8 +256,8 @@ test(async () => {const out = outputPath.replace('mp4', 'wav');const task = execa(- 'pnpm',- ['exec', 'remotion', 'render', 'build', 'audio-testing', out],+ 'bun',+ ['x', 'remotion', 'render', 'build', 'audio-testing', out],{cwd: path.join(process.cwd(), '..', 'example'),},@@ -294,8 +294,8 @@ test(async () => {const out = outputPath.replace('mp4', 'mp3');const task = execa(- 'pnpm',- ['exec', 'remotion', 'render', 'build', 'audio-testing', out],+ 'bun',+ ['x', 'remotion', 'render', 'build', 'audio-testing', out],{cwd: path.join(process.cwd(), '..', 'example'),},@@ -330,8 +330,8 @@ test(async () => {const out = outputPath.replace('mp4', 'aac');const task = execa(- 'pnpm',- ['exec', 'remotion', 'render', 'build', 'audio-testing', out],+ 'bun',+ ['x', 'remotion', 'render', 'build', 'audio-testing', out],{cwd: path.join(process.cwd(), '..', 'example'),},@@ -367,16 +367,8 @@ test('Should render a video with GIFs',async () => {const task = await execa(- 'pnpm',- [- 'exec',- 'remotion',- 'render',- 'build',- 'gif',- '--frames=0-47',- outputPath,- ],+ 'bun',+ ['x', 'remotion', 'render', 'build', 'gif', '--frames=0-47', outputPath],{cwd: path.join(process.cwd(), '..', 'example'),},@@ -414,8 +406,8 @@ test(const out = outputPath.replace('.mp4', '.mp3');const task = await execa(- 'pnpm',- ['exec', 'remotion', 'render', 'build', 'offline-audio-buffer', out],+ 'bun',+ ['x', 'remotion', 'render', 'build', 'offline-audio-buffer', out],{cwd: path.join(process.cwd(), '..', 'example'),},@@ -446,8 +438,8 @@ test(async () => {const out = outputPath.replace('.mp4', '.mp3');const task = await execa(- 'pnpm',- ['exec', 'remotion', 'render', 'build', 'ten-frame-tester', out],+ 'bun',+ ['x', 'remotion', 'render', 'build', 'ten-frame-tester', out],{cwd: path.join(process.cwd(), '..', 'example'),},@@ -475,9 +467,9 @@ test(const out = outputPath.replace('.mp4', '.png');await Bun.write('props.json', JSON.stringify({flag: true}));const task = await execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','still','build',@@ -507,9 +499,9 @@ test(const randomDuration = Math.round(Math.random() * 18 + 2);const task = await execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','render','build',@@ -573,9 +565,9 @@ test('Should be able to render a huge payload that gets serialized',async () => {const task = await execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','still','build',@@ -597,9 +589,9 @@ test('If timeout, the error should be shown',async () => {const task = await execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','render','build',@@ -622,11 +614,11 @@ test();test(- 'Should be able to call pnpm exec compositions',+ 'Should be able to call bunx compositions',async () => {const task = await execa(- 'pnpm',- ['exec', 'remotion', 'compositions', 'build'],+ 'bun',+ ['x', 'remotion', 'compositions', 'build'],{cwd: path.join(process.cwd(), '..', 'example'),reject: false,@@ -644,8 +636,8 @@ test('Should be able to render video that was wrapped in context',async () => {await execa(- 'pnpm',- ['exec', 'remotion', 'still', 'build', 'wrapped-in-context', outputPath],+ 'bun',+ ['x', 'remotion', 'still', 'build', 'wrapped-in-context', outputPath],{cwd: path.join(process.cwd(), '..', 'example'),},diff --git a/packages/it-tests/src/rendering/test-utils.ts b/packages/it-tests/src/rendering/test-utils.tsindex dfe2803209..da4b04a12f 100644--- a/packages/it-tests/src/rendering/test-utils.ts+++ b/packages/it-tests/src/rendering/test-utils.ts@@ -141,9 +141,9 @@ async function saveSequenceInTempDir(id: string) {);await execa(- 'pnpm',+ 'bun',[- 'exec',+ 'x','remotion','render','./build',