🎥 Make videos programmatically with React
Merge branch 'v4' into remove-deprecated
Jonny Burger5cc4df35a764
diff --cc packages/docs/docs/4-0-migration.mdindex ab2a8e756e,b4e91164ba..e80f597cb3--- a/packages/docs/docs/4-0-migration.md+++ b/packages/docs/docs/4-0-migration.md@@@ -29,31 -29,33 +29,62 @@@ Upgrade `remotion` and all packages staRun `npm i `, `yarn` or `pnpm i` respectively afterwards.+ ## Config file changes++ ```diff+ - import {Config} from 'remotion';+ + import {Config} from '@remotion/cli/config';+ ```++ ## Dropped support for Lambda `architecture`++ When deploying a Lambda, you were previously able to choose between the `arm64` and `x86_64` architecture.+ From v4.0 on, only `arm64` is supported. It should be faster, cheaper and not have any different behavior than `x86_64`.++ **How to upgrade**: Remove the `architecture` option from `estimatePrice()` and `deployFunction()`.++ ## Rich timeline removed++ The option to use the "Rich timeline" has been removed due to performance problems.+ The timeline is now always in simple mode, but supports more timeline layers at once.++ ## ProRes videos now export uncompressed audio by default++ Previously, the `aac` audio codec was the default for ProRes exports. The default is now `pcm_s16le` which stands for uncompressed 16-bit low-endian PCM audio.+ This change was made since users export ProRes mainly for getting high-quality footage to be further used in video editing programs.++ ## No more FFmpeg install, `ffmpegExecutable` option removed++ ## Moved `onSlowestFrames` API++ In V3, `onSlowestFrames` has been a callback function that you could pass to `renderMedia()`.+ In V4, this API has been moved to the [return type](/docs/renderer/render-media#return-value).+++## Removal of deprecated APIs+- - `Config.setOutputFormat()` was deprecated in v1.4 and has now been removed. Use `setImageSequence()` and `setImageFormat()` and `setCodec()` instead.++- `Config.setOutputFormat()` was deprecated in v1.4 and has now been removed. Use `setImageSequence()`, `setVideoImageFormat()` and `setCodec()` in combination instead.+- - `downloadVideo()` does not work anymore, use `downloadMedia()` with the same API instead.++- `downloadVideo()` alias has been removed, use [`downloadMedia()`](/docs/lambda/downloadmedia) with the same API instead.+- - `<MotionBlur>` has been removed. Use `<Trail>` instead.++- `<MotionBlur>` has been removed. Use [`<Trail>`](/docs/motion-blur/trail) instead.+- - `getParts()` has been removed. Use `getSubpaths()` instead:++- `getParts()` has been removed. Use [`getSubpaths()`](/docs/paths/get-subpaths) instead:++```tsx twoslash title="paths.ts"+import {+ getLength,+ getPointAtLength,+ getSubpaths,+ getTangentAtLength,+} from "@remotion/paths";++const path = "M 0 0 L 100 100";+const parts = getSubpaths(path[0]);+const length = getLength(parts[0]);+const start = getPointAtLength(parts[0], 0);+const end = getPointAtLength(parts[0], length);+const tangent = getTangentAtLength(parts[0], length / 2);+```++- `webpackBundle` has been removed - rename it to `serveUrl` instead+- `parallelism` has been removed - rename it to `concurrency` insteaddiff --cc packages/renderer/src/render-frames.tsindex bd12faee36,f7c7ae137a..6e30b89b5e--- a/packages/renderer/src/render-frames.ts+++ b/packages/renderer/src/render-frames.ts@@@ -72,11 -95,8 +71,9 @@@ type RenderFramesOptions =timeoutInMilliseconds?: number;chromiumOptions?: ChromiumOptions;scale?: number;- ffmpegExecutable?: FfmpegExecutable;- ffprobeExecutable?: FfmpegExecutable;port?: number | null;cancelSignal?: CancelSignal;+ composition: SmallTCompMetadata;/*** @deprecated Only for Remotion internal usage*/@@@ -521,11 -577,9 +527,9 @@@ export const renderFrames =}),Promise.all([prepareServer({- webpackConfigOrServeUrl: selectedServeUrl,+ webpackConfigOrServeUrl: options.serveUrl,onDownload,onError,- ffmpegExecutable: options.ffmpegExecutable ?? null,- ffprobeExecutable: options.ffprobeExecutable ?? null,port: options.port ?? null,downloadMap,remotionRoot: findRemotionRoot(),diff --cc packages/renderer/src/render-media.tsindex 04e1eac1ae,b0c2fdbac1..9b55edf2af--- a/packages/renderer/src/render-media.ts+++ b/packages/renderer/src/render-media.ts@@@ -111,15 -110,41 +108,19 @@@ export type RenderMediaOptions =ffmpegOverride?: FfmpegOverrideFn;audioBitrate?: string | null;videoBitrate?: string | null;- onSlowestFrames?: OnSlowestFrames;disallowParallelEncoding?: boolean;audioCodec?: AudioCodec | null;-} & ServeUrlOrWebpackBundle &- ConcurrencyOrParallelism;--type ConcurrencyOrParallelism =- | {- concurrency?: number | string | null;- }- | {- /**- * @deprecated This field has been renamed to `concurrency`- */- parallelism?: number | null;- };+ serveUrl: string;+ concurrency?: number | string | null;+};type Await<T> = T extends PromiseLike<infer U> ? U : T;-const getConcurrency = (others: ConcurrencyOrParallelism) => {- if ('concurrency' in others) {- return others.concurrency;- }-- if ('parallelism' in others) {- return others.parallelism;- }-- return null;-};-+ type RenderMediaResult = {+ buffer: Buffer | null;+ slowestFrames: SlowFrame[];+ };+/**** @description Render a video from a composition@@@ -372,10 -395,10 +369,10 @@@ export const renderMedia = (minTime = slowestFrames[slowestFrames.length - 1]?.time ?? minTime;};- const happyPath = createPrestitcherIfNecessary()+ const happyPath = Promise.resolve(createPrestitcherIfNecessary()).then(() => {const renderFramesProc = renderFrames({- config: composition,+ composition,onFrameUpdate: (frame: number,frameIndex: number,diff --cc packages/renderer/src/render-still.tsindex 0f19def41e,a396adea8a..5aad34cfb6--- a/packages/renderer/src/render-still.ts+++ b/packages/renderer/src/render-still.ts@@@ -270,11 -271,9 +267,9 @@@ export const renderStill =let close: ((force: boolean) => Promise<unknown>) | null = null;prepareServer({- webpackConfigOrServeUrl: selectedServeUrl,+ webpackConfigOrServeUrl: options.serveUrl,onDownload,onError,- ffmpegExecutable: options.ffmpegExecutable ?? null,- ffprobeExecutable: options.ffprobeExecutable ?? null,port: options.port ?? null,downloadMap,remotionRoot: findRemotionRoot(),