🎥 Make videos programmatically with React
getExecutableFfprobe --> getExecutableFfmpeg
Patric Salvisberg23aa500afc78
diff --git a/packages/it-tests/src/rendering/base64-audio.test.ts b/packages/it-tests/src/rendering/base64-audio.test.tsindex 8e82d8a518..f59a094e72 100644--- a/packages/it-tests/src/rendering/base64-audio.test.ts+++ b/packages/it-tests/src/rendering/base64-audio.test.ts@@ -2,7 +2,7 @@ import { beforeEach, expect, test } from "vitest";import path from "path";import fs from "fs";import execa from "execa";-import { getExecutableFfprobe } from "@remotion/renderer/dist/ffmpeg-flags";+import { getExecutableFfmpeg } from "@remotion/renderer/dist/ffmpeg-flags";const outputPath = path.join(process.cwd(), "packages/example/out.mp3");@@ -32,9 +32,10 @@ test("Should be able to render a MP3 audio file", async () => {const exists = fs.existsSync(outputPath);expect(exists).toBe(true);- const info = await execa(await getExecutableFfprobe(null, process.cwd()), [- outputPath,- ]);+ const info = await execa(+ await getExecutableFfmpeg(null, process.cwd(), "ffprobe"),+ [outputPath]+ );const data = info.stderr;expect(data).toContain("mp3");expect(data).toContain("stereo");diff --git a/packages/it-tests/src/rendering/render-scale.test.ts b/packages/it-tests/src/rendering/render-scale.test.tsindex ef688b94e7..3125e54ffa 100644--- a/packages/it-tests/src/rendering/render-scale.test.ts+++ b/packages/it-tests/src/rendering/render-scale.test.ts@@ -39,7 +39,7 @@ test("Should be able to render video with scale 2", async () => {expect(exists).toBe(true);const info = await execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), "ffprobe"),[outputPath]);const data = info.stderr;@@ -76,7 +76,7 @@ test("Should be able to render video with scale 0.1", async () => {expect(exists).toBe(true);const info = await execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), "ffprobe"),[outputPath]);const data = info.stderr;diff --git a/packages/it-tests/src/rendering/rendering.test.ts b/packages/it-tests/src/rendering/rendering.test.tsindex 0a9eaecb30..5df4148a19 100644--- a/packages/it-tests/src/rendering/rendering.test.ts+++ b/packages/it-tests/src/rendering/rendering.test.ts@@ -35,7 +35,7 @@ test("Should be able to render video", async () => {expect(exists).toBe(true);const info = await execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), "ffprobe"),[outputPath]);const data = info.stderr;@@ -142,7 +142,7 @@ test("Should render a ProRes video", async () => {expect(exists).toBe(true);const info = await execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), "ffprobe"),[out]);const data = info.stderr;@@ -175,7 +175,7 @@ test("Should render a still image if single frame specified", async () => {expect(fs.existsSync(outImg)).toBe(true);const info = await execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), "ffprobe"),[outImg]);const data = info.stderr;@@ -201,7 +201,7 @@ test("Should be able to render a WAV audio file", async () => {expect(exists).toBe(true);const info = await execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), "ffprobe"),[out]);const data = info.stderr;@@ -229,7 +229,7 @@ test("Should be able to render a MP3 audio file", async () => {expect(exists).toBe(true);const info = await execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), "ffprobe"),[out]);const data = info.stderr;@@ -258,7 +258,7 @@ test("Should be able to render a AAC audio file", async () => {expect(exists).toBe(true);const info = await execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), "ffprobe"),[out]);const data = info.stderr;@@ -293,7 +293,7 @@ test("Should render a video with GIFs", async () => {expect(fs.existsSync(outputPath)).toBe(true);const info = await execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), "ffprobe"),[outputPath]);const data = info.stderr;@@ -326,7 +326,7 @@ test("Should render a video with Offline Audio-context", async () => {expect(fs.existsSync(out)).toBe(true);const info = await execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), "ffprobe"),[out]);const data = info.stderr;@@ -347,7 +347,7 @@ test("Should succeed to render an audio file that doesn't have any audio inputs");expect(task.exitCode).toBe(0);const info = await execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), "ffprobe"),[out]);const data = info.stderr;@@ -407,7 +407,7 @@ test("Dynamic duration should work, and render from inside src/", async () => {expect(fs.existsSync(outputPath)).toBe(true);const info = await execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), "ffprobe"),[outputPath]);const data = info.stderr;diff --git a/packages/it-tests/src/ssr/render-frames.test.ts b/packages/it-tests/src/ssr/render-frames.test.tsindex 571803e96a..623d5f4594 100644--- a/packages/it-tests/src/ssr/render-frames.test.ts+++ b/packages/it-tests/src/ssr/render-frames.test.ts@@ -9,7 +9,7 @@ import {} from "@remotion/renderer";import execa from "execa";import { expect, test } from "vitest";-import { getExecutableFfprobe } from "@remotion/renderer/dist/ffmpeg-flags";+import { getExecutableFfmpeg } from "@remotion/renderer/dist/ffmpeg-flags";test("Legacy SSR way of rendering videos should still work", async () => {const puppeteerInstance = await openBrowser("chrome");@@ -58,9 +58,10 @@ test("Legacy SSR way of rendering videos should still work", async () => {codec: "h264",});expect(fs.existsSync(outPath)).toBe(true);- const probe = await execa(await getExecutableFfprobe(null, process.cwd()), [- outPath,- ]);+ const probe = await execa(+ await getExecutableFfmpeg(null, process.cwd(), "ffprobe"),+ [outPath]+ );expect(probe.stderr).toMatch(/Video: h264/);await puppeteerInstance.close();});diff --git a/packages/lambda/src/test/integration/renders/gif.test.ts b/packages/lambda/src/test/integration/renders/gif.test.tsindex 0a0b8f8f2d..f0426cff27 100644--- a/packages/lambda/src/test/integration/renders/gif.test.ts+++ b/packages/lambda/src/test/integration/renders/gif.test.ts@@ -1,5 +1,5 @@import {RenderInternals} from '@remotion/renderer';-import {getExecutableFfprobe} from '@remotion/renderer/src/ffmpeg-flags';+import {getExecutableFfmpeg} from '@remotion/renderer/src/ffmpeg-flags';import {createWriteStream} from 'fs';import {VERSION} from 'remotion/version';import {afterAll, beforeAll, expect, test} from 'vitest';@@ -87,7 +87,7 @@ test('Should make a distributed GIF', async () => {file.pipe(createWriteStream('gif.gif')).on('close', () => resolve());});const probe = await RenderInternals.execa(- await getExecutableFfprobe(null, process.cwd()),+ await getExecutableFfmpeg(null, process.cwd(), 'ffprobe'),['gif.gif']);expect(probe.stderr).toMatch(/Video: gif, bgra, 1080x1080/);diff --git a/packages/lambda/src/test/integration/renders/other-bucket.test.ts b/packages/lambda/src/test/integration/renders/other-bucket.test.tsindex 8f01a8e093..624e7a7ac4 100644--- a/packages/lambda/src/test/integration/renders/other-bucket.test.ts+++ b/packages/lambda/src/test/integration/renders/other-bucket.test.ts@@ -1,5 +1,5 @@import {RenderInternals} from '@remotion/renderer';-import {getExecutableFfprobe} from '@remotion/renderer/src/ffmpeg-flags';+import {getExecutableFfmpeg} from '@remotion/renderer/src/ffmpeg-flags';import {VERSION} from 'remotion/version';import {afterAll, beforeAll, expect, test} from 'vitest';import {LambdaRoutines} from '../../../defaults';@@ -87,7 +87,7 @@ test('Should be able to render to another bucket', async () => {region: 'eu-central-1',});const probe = await RenderInternals.execa(- await getExecutableFfprobe(null, process.cwd()),+ await getExecutableFfmpeg(null, process.cwd(), 'ffprobe'),['-'],{stdin: file,diff --git a/packages/lambda/src/test/integration/renders/silent-audio.test.ts b/packages/lambda/src/test/integration/renders/silent-audio.test.tsindex f52e20452c..8039bb01bd 100644--- a/packages/lambda/src/test/integration/renders/silent-audio.test.ts+++ b/packages/lambda/src/test/integration/renders/silent-audio.test.ts@@ -83,7 +83,7 @@ test('Should add silent audio if there is no audio', async () => {region: 'eu-central-1',});const probe = await RenderInternals.execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), 'ffprobe'),['-'],{stdin: file,diff --git a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts b/packages/lambda/src/test/integration/renders/transparent-webm.test.tsindex 32558cf112..8203b5baac 100644--- a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts+++ b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts@@ -97,7 +97,7 @@ test('Should make a transparent video', async () => {file.on('close', () => resolve());});const probe = await RenderInternals.execa(- await RenderInternals.getExecutableFfprobe(null, process.cwd()),+ await RenderInternals.getExecutableFfmpeg(null, process.cwd(), 'ffprobe'),[out]);expect(probe.stderr).toMatch(/ALPHA_MODE(\s+): 1/);diff --git a/packages/renderer/src/assets/get-audio-channels.ts b/packages/renderer/src/assets/get-audio-channels.tsindex 8f3ce216f3..263028bac0 100644--- a/packages/renderer/src/assets/get-audio-channels.ts+++ b/packages/renderer/src/assets/get-audio-channels.ts@@ -1,6 +1,6 @@import execa from 'execa';import type {FfmpegExecutable} from '../ffmpeg-executable';-import {getExecutableFfprobe} from '../ffmpeg-flags';+import {getExecutableFfmpeg} from '../ffmpeg-flags';import {pLimit} from '../p-limit';import type {AudioChannelsAndDurationResultCache,@@ -29,7 +29,7 @@ async function getAudioChannelsAndDurationUnlimited(.filter(Boolean) as string[];const task = await execa(- await getExecutableFfprobe(ffprobeExecutable, remotionRoot),+ await getExecutableFfmpeg(ffprobeExecutable, remotionRoot, 'ffprobe'),args);diff --git a/packages/renderer/src/assets/get-video-stream-duration.ts b/packages/renderer/src/assets/get-video-stream-duration.tsindex 181933e821..9543849fef 100644--- a/packages/renderer/src/assets/get-video-stream-duration.ts+++ b/packages/renderer/src/assets/get-video-stream-duration.ts@@ -1,6 +1,6 @@import execa from 'execa';import type {FfmpegExecutable} from '../ffmpeg-executable';-import {getExecutableFfprobe} from '../ffmpeg-flags';+import {getExecutableFfmpeg} from '../ffmpeg-flags';import {pLimit} from '../p-limit';import type {DownloadMap, VideoDurationResult} from './download-map';@@ -69,7 +69,7 @@ async function getVideoStreamDurationUnlimited(.filter(Boolean) as string[];const task = await execa(- await getExecutableFfprobe(ffprobeExecutable, remotionRoot),+ await getExecutableFfmpeg(ffprobeExecutable, remotionRoot, 'ffprobe'),args);diff --git a/packages/renderer/src/ffmpeg-flags.ts b/packages/renderer/src/ffmpeg-flags.tsindex d7b658c425..ba26d71a97 100644--- a/packages/renderer/src/ffmpeg-flags.ts+++ b/packages/renderer/src/ffmpeg-flags.ts@@ -192,35 +192,6 @@ export const downloadBinary = async (return destinationPath;};-export const getExecutableFfprobe = async (- ffprobeExecutable: FfmpegExecutable,- remotionRoot: string-) => {- const exists = binaryExists('ffprobe', ffprobeExecutable);-- if (exists) {- if (ffprobeExecutable !== null) {- return ffprobeExecutable;- }-- return 'ffprobe';- }-- const {url} = getBinaryDownloadUrl('ffprobe');-- if (isDownloading[url]) {- return waitForFfmpegToBeDownloaded(url);- }-- const inNodeMod = ffmpegInNodeModules(remotionRoot, 'ffprobe');-- if (inNodeMod) {- return inNodeMod;- }-- return downloadBinary(remotionRoot, url, 'ffprobe');-};-export const getExecutableFfmpeg = async (ffmpegExecutable: FfmpegExecutable | null,remotionRoot: string,diff --git a/packages/renderer/src/get-video-info.ts b/packages/renderer/src/get-video-info.tsindex c66963893e..acb1926fc8 100644--- a/packages/renderer/src/get-video-info.ts+++ b/packages/renderer/src/get-video-info.ts@@ -2,7 +2,7 @@ import execa from 'execa';import type {DownloadMap, Vp9Result} from './assets/download-map';import {calculateDisplayVideoSize} from './calculate-sar-dar-pixels';import type {FfmpegExecutable} from './ffmpeg-executable';-import {getExecutableFfprobe} from './ffmpeg-flags';+import {getExecutableFfmpeg} from './ffmpeg-flags';import {pLimit} from './p-limit';const limit = pLimit(1);@@ -18,7 +18,7 @@ async function getVideoInfoUnlimited(}const task = await execa(- await getExecutableFfprobe(ffprobeExecutable, remotionRoot),+ await getExecutableFfmpeg(ffprobeExecutable, remotionRoot, 'ffprobe'),[src]);diff --git a/packages/renderer/src/guess-extension-for-media.ts b/packages/renderer/src/guess-extension-for-media.tsindex c39c5b33ff..e04ff31629 100644--- a/packages/renderer/src/guess-extension-for-media.ts+++ b/packages/renderer/src/guess-extension-for-media.ts@@ -1,13 +1,14 @@import execa from 'execa';-import {getExecutableFfprobe} from './ffmpeg-flags';+import {getExecutableFfmpeg} from './ffmpeg-flags';export const guessExtensionForVideo = async (src: string,remotionRoot: string) => {- const {stderr} = await execa(await getExecutableFfprobe(null, remotionRoot), [- src,- ]);+ const {stderr} = await execa(+ await getExecutableFfmpeg(null, remotionRoot, 'ffprobe'),+ [src]+ );if (stderr.includes('mp3,')) {return 'mp3';diff --git a/packages/renderer/src/index.ts b/packages/renderer/src/index.tsindex 5d2f2fed21..b93784cbac 100644--- a/packages/renderer/src/index.ts+++ b/packages/renderer/src/index.ts@@ -15,7 +15,6 @@ import {SymbolicateableError} from './error-handling/symbolicateable-error';import {ffmpegHasFeature,getExecutableFfmpeg,- getExecutableFfprobe,getFfmpegVersion,} from './ffmpeg-flags';import {findRemotionRoot} from './find-closest-package-json';@@ -169,7 +168,6 @@ export const RenderInternals = {convertToPositiveFrameIndex,findRemotionRoot,getExecutableFfmpeg,- getExecutableFfprobe,validateBitrate,getFfmpegVersion,};