Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@remotion/renderer

Package Overview
Dependencies
Maintainers
0
Versions
998
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remotion/renderer - npm Package Compare versions

Comparing version 4.0.175 to 4.0.176

build-browser-downloader.ts

4

dist/assets/calculate-asset-positions.d.ts

@@ -1,3 +0,3 @@

import type { TRenderAsset } from 'remotion/no-react';
import type { AudioOrVideoAsset } from 'remotion/no-react';
import type { Assets } from './types';
export declare const calculateAssetPositions: (frames: TRenderAsset[][]) => Assets;
export declare const calculateAssetPositions: (frames: AudioOrVideoAsset[][]) => Assets;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateAssetPositions = void 0;
const filter_asset_types_1 = require("../filter-asset-types");
const resolve_asset_src_1 = require("../resolve-asset-src");

@@ -19,4 +20,5 @@ const flatten_volume_array_1 = require("./flatten-volume-array");

const copyAndDeduplicateAssets = (renderAssets) => {
const onlyAudioAndVideo = (0, filter_asset_types_1.onlyAudioAndVideoAssets)(renderAssets);
const deduplicated = [];
for (const renderAsset of renderAssets) {
for (const renderAsset of onlyAudioAndVideo) {
if (!deduplicated.find((d) => d.id === renderAsset.id)) {

@@ -23,0 +25,0 @@ deduplicated.push(renderAsset);

@@ -1,2 +0,2 @@

import type { TRenderAsset } from 'remotion/no-react';
import type { AudioOrVideoAsset } from 'remotion/no-react';
import type { LogLevel } from '../log-level';

@@ -12,2 +12,2 @@ import type { FrameAndAssets } from '../render-frames';

logLevel: LogLevel;
}) => Promise<TRenderAsset[][]>;
}) => Promise<AudioOrVideoAsset[][]>;

@@ -17,3 +17,3 @@ "use strict";

const assetPromises = ch.map((frame) => {
const frameAssetPromises = frame.assets.map((a) => {
const frameAssetPromises = frame.audioAndVideoAssets.map((a) => {
return (0, download_and_map_assets_to_file_1.downloadAndMapAssetsToFileUrl)({

@@ -20,0 +20,0 @@ renderAsset: a,

@@ -1,2 +0,2 @@

import type { TRenderAsset } from 'remotion/no-react';
import type { AudioOrVideoAsset } from 'remotion/no-react';
import type { LogLevel } from '../log-level';

@@ -23,3 +23,3 @@ import type { DownloadMap } from './download-map';

export declare const downloadAndMapAssetsToFileUrl: ({ renderAsset, onDownload, downloadMap, logLevel, indent, }: {
renderAsset: TRenderAsset;
renderAsset: AudioOrVideoAsset;
onDownload: RenderMediaOnDownload | null;

@@ -29,3 +29,3 @@ downloadMap: DownloadMap;

indent: boolean;
}) => Promise<TRenderAsset>;
}) => Promise<AudioOrVideoAsset>;
export declare const attachDownloadListenerToEmitter: (downloadMap: DownloadMap, onDownload: RenderMediaOnDownload | null) => () => void;

@@ -1,3 +0,3 @@

import type { TRenderAsset } from 'remotion/no-react';
export type UnsafeAsset = Omit<TRenderAsset, 'frame' | 'id' | 'volume' | 'mediaFrame' | 'audioStartFrom'> & {
import type { AudioOrVideoAsset } from 'remotion/no-react';
export type UnsafeAsset = Omit<AudioOrVideoAsset, 'frame' | 'id' | 'volume' | 'mediaFrame' | 'audioStartFrom'> & {
startInVideo: number;

@@ -17,3 +17,3 @@ duration: number | null;

};
export declare const uncompressMediaAsset: (allRenderAssets: TRenderAsset[], assetToUncompress: TRenderAsset) => TRenderAsset;
export declare const uncompressMediaAsset: (allRenderAssets: AudioOrVideoAsset[], assetToUncompress: AudioOrVideoAsset) => AudioOrVideoAsset;
export type Assets = MediaAsset[];

@@ -55,3 +55,8 @@ "use strict";

const TESTED_VERSION = '123.0.6312.86';
// https://github.com/microsoft/playwright/tree/v1.42.0
const PLAYWRIGHT_VERSION = '1105'; // 123.0.6312.4
function getChromeDownloadUrl({ platform, version, }) {
if (platform === 'linux-arm64') {
return `https://playwright.azureedge.net/builds/chromium/${version !== null && version !== void 0 ? version : PLAYWRIGHT_VERSION}/chromium-linux-arm64.zip`;
}
return `https://storage.googleapis.com/chrome-for-testing-public/${version !== null && version !== void 0 ? version : TESTED_VERSION}/${platform}/chrome-headless-shell-${platform}.zip`;

@@ -74,3 +79,3 @@ }

case 'linux':
return 'linux64';
return os.arch() === 'arm64' ? 'linux-arm64' : 'linux64';
case 'win32':

@@ -104,9 +109,7 @@ return 'win64';

}
// Use system Chromium builds on Linux ARM devices
if (os.platform() !== 'darwin' && os.arch() === 'arm64') {
if (os.platform() !== 'darwin' &&
os.platform() !== 'linux' &&
os.arch() === 'arm64') {
throw new Error([
'Chrome Headless Shell is not available for Linux for arm64 architecture.',
'If you are on Ubuntu, you can install with:',
'sudo apt install chromium',
'sudo apt install chromium-browser',
'Chrome Headless Shell is not available for Windows for arm64 architecture.',
].join('\n'));

@@ -133,2 +136,11 @@ }

await (0, extract_zip_1.default)(archivePath, { dir: outputPath });
const chromePath = path.join(outputPath, 'chrome-linux', 'chrome');
const chromeHeadlessShellPath = path.join(outputPath, 'chrome-linux', 'chrome-headless-shell');
if (fs.existsSync(chromePath)) {
fs.renameSync(chromePath, chromeHeadlessShellPath);
}
const chromeLinuxFolder = path.join(outputPath, 'chrome-linux');
if (fs.existsSync(chromeLinuxFolder)) {
fs.renameSync(chromeLinuxFolder, path.join(outputPath, 'chrome-headless-shell-linux-arm64'));
}
}

@@ -135,0 +147,0 @@ finally {

@@ -240,3 +240,3 @@ "use strict";

browserStderr.addListener('data', onData);
browserProcess.addListener('close', onClose);
browserStderr.addListener('close', onClose);
const listeners = [

@@ -243,0 +243,0 @@ () => browserStderr.removeListener('data', onData),

@@ -5,4 +5,4 @@ /**

*/
import type { TRenderAsset } from 'remotion/no-react';
export declare const compressAsset: (previousRenderAssets: TRenderAsset[], newRenderAsset: TRenderAsset) => TRenderAsset;
import type { AudioOrVideoAsset } from 'remotion/no-react';
export declare const compressAsset: (previousRenderAssets: AudioOrVideoAsset[], newRenderAsset: AudioOrVideoAsset) => AudioOrVideoAsset;
export declare const isAssetCompressed: (src: string) => boolean;

@@ -40,6 +40,7 @@ /// <reference types="node" />

export { ProResProfile } from './prores-profile';
export { RenderFramesOptions, renderFrames } from './render-frames';
export { OnArtifact, RenderFramesOptions, renderFrames } from './render-frames';
export { InternalRenderMediaOptions, RenderMediaOnProgress, RenderMediaOptions, SlowFrame, StitchingState, renderMedia, } from './render-media';
export { RenderStillOptions, renderStill } from './render-still';
export { SelectCompositionOptions, selectComposition, } from './select-composition';
export { EmittedArtifact } from './serialize-artifact';
export { StitchFramesToVideoOptions, stitchFramesToVideo, } from './stitch-frames-to-video';

@@ -341,3 +342,3 @@ export { SymbolicatedStackFrame } from './symbolicate-stacktrace';

getExecutablePath: ({ indent, logLevel, type, binariesDirectory, }: {
type: "compositor" | "ffmpeg" | "ffprobe";
type: "ffmpeg" | "ffprobe" | "compositor";
indent: boolean;

@@ -474,2 +475,3 @@ logLevel: "verbose" | "info" | "warn" | "error";

offthreadVideoCacheSizeInBytes: number | null;
onArtifact: import("./render-frames").OnArtifact | null;
} & import("./options/option").ToOptions<{

@@ -754,3 +756,139 @@ readonly offthreadVideoCacheSizeInBytes: {

}>) => Promise<import("remotion").VideoConfig[]>;
internalRenderFrames: (args_0: import("./render-frames").InternalRenderFramesOptions) => Promise<import("./types").RenderFramesOutput>;
internalRenderFrames: (args_0: {
onStart: ((data: import("./types").OnStartData) => void) | null;
onFrameUpdate: ((framesRendered: number, frameIndex: number, timeToRenderInMilliseconds: number) => void) | null;
outputDir: string | null;
envVariables: Record<string, string>;
imageFormat: "jpeg" | "png" | "none";
jpegQuality: number;
frameRange: import("./frame-range").FrameRange | null;
everyNthFrame: number;
puppeteerInstance: HeadlessBrowser | undefined;
browserExecutable: import("./browser-executable").BrowserExecutable;
onBrowserLog: ((log: import("./browser-log").BrowserLog) => void) | null;
onFrameBuffer: ((buffer: Buffer, frame: number) => void) | null;
onDownload: import("./assets/download-and-map-assets-to-file").RenderMediaOnDownload | null;
chromiumOptions: import("./open-browser").ChromiumOptions;
scale: number;
port: number | null;
cancelSignal: import("./make-cancel-signal").CancelSignal | undefined;
composition: Omit<import("remotion").VideoConfig, "defaultProps" | "props">;
indent: boolean;
server: import("./prepare-server").RemotionServer | undefined;
muted: boolean;
concurrency: string | number | null;
webpackBundleOrServeUrl: string;
serializedInputPropsWithCustomSchema: string;
serializedResolvedPropsWithCustomSchema: string;
parallelEncodingEnabled: boolean;
compositionStart: number;
onArtifact: import("./render-frames").OnArtifact | null;
} & import("./options/option").ToOptions<{
readonly forSeamlessAacConcatenation: {
name: string;
cliFlag: "for-seamless-aac-concatenation";
description: () => import("react/jsx-runtime").JSX.Element;
docLink: string;
getValue: ({ commandLine }: {
commandLine: Record<string, unknown>;
}) => {
source: string;
value: true;
} | {
source: string;
value: false;
};
setConfig: (value: boolean) => void;
ssrName: string;
type: boolean;
};
readonly offthreadVideoCacheSizeInBytes: {
name: string;
cliFlag: "offthreadvideo-cache-size-in-bytes";
description: () => import("react/jsx-runtime").JSX.Element;
ssrName: "offthreadVideoCacheSizeInBytes";
docLink: string;
type: number | null;
getValue: ({ commandLine }: {
commandLine: Record<string, unknown>;
}) => {
source: string;
value: number;
} | {
source: string;
value: null;
};
setConfig: (size: number | null) => void;
};
readonly jpegQuality: {
name: string;
cliFlag: "jpeg-quality";
description: () => import("react/jsx-runtime").JSX.Element;
ssrName: string;
docLink: string;
type: number;
setConfig: (q: number | undefined) => void;
getValue: ({ commandLine }: {
commandLine: Record<string, unknown>;
}) => {
source: string;
value: number;
};
};
readonly logLevel: {
cliFlag: "log";
name: string;
ssrName: string;
description: () => import("react/jsx-runtime").JSX.Element;
docLink: string;
getValue: ({ commandLine }: {
commandLine: Record<string, unknown>;
}) => {
value: "verbose" | "info" | "warn" | "error";
source: string;
};
setConfig: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
type: "verbose" | "info" | "warn" | "error";
};
readonly timeoutInMilliseconds: {
name: string;
cliFlag: "timeout";
description: () => import("react/jsx-runtime").JSX.Element;
ssrName: "timeoutInMilliseconds";
docLink: string;
type: number;
getValue: ({ commandLine }: {
commandLine: Record<string, unknown>;
}) => {
source: string;
value: number;
};
setConfig: (value: number) => void;
};
readonly binariesDirectory: {
name: string;
cliFlag: "binaries-directory";
description: () => import("react/jsx-runtime").JSX.Element;
ssrName: "binariesDirectory";
docLink: string;
type: string | null;
getValue: ({ commandLine }: {
commandLine: Record<string, unknown>;
}) => {
source: string;
value: string | null;
};
setConfig: (value: string | null) => void;
};
readonly onBrowserDownload: {
name: string;
cliFlag: "on-browser-download";
description: () => import("react/jsx-runtime").JSX.Element;
ssrName: "onBrowserDownload";
docLink: string;
type: import("./options/on-browser-download").OnBrowserDownload;
getValue: () => never;
setConfig: () => never;
};
}>) => Promise<import("./types").RenderFramesOutput>;
internalRenderMedia: (args_0: import("./render-media").InternalRenderMediaOptions) => Promise<{

@@ -792,3 +930,3 @@ buffer: Buffer | null;

muted: boolean;
}) => "no" | "yes" | "maybe";
}) => "yes" | "maybe" | "no";
codecSupportsMedia: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => {

@@ -795,0 +933,0 @@ video: boolean;

@@ -385,7 +385,7 @@ import type { AnyRemotionOption } from './option';

docLink: string;
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
getValue: ({ commandLine }: {
commandLine: Record<string, unknown>;
}) => {
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
source: string;

@@ -396,3 +396,3 @@ } | {

};
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
};

@@ -399,0 +399,0 @@ logLevelOption: {

@@ -75,7 +75,7 @@ export declare const optionsMap: {

docLink: string;
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
getValue: ({ commandLine }: {
commandLine: Record<string, unknown>;
}) => {
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
source: string;

@@ -86,3 +86,3 @@ } | {

};
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
};

@@ -799,7 +799,7 @@ readonly audioBitrate: {

docLink: string;
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
getValue: ({ commandLine }: {
commandLine: Record<string, unknown>;
}) => {
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
source: string;

@@ -810,3 +810,3 @@ } | {

};
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
};

@@ -1167,7 +1167,7 @@ readonly encodingMaxRate: {

docLink: string;
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
getValue: ({ commandLine }: {
commandLine: Record<string, unknown>;
}) => {
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
source: string;

@@ -1178,3 +1178,3 @@ } | {

};
setConfig: (profile: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
setConfig: (profile: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null) => void;
};

@@ -1181,0 +1181,0 @@ readonly encodingMaxRate: {

@@ -14,7 +14,7 @@ import type { Codec } from '../codec';

docLink: string;
type: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | null;
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | null;
getValue: ({ commandLine }: {
commandLine: Record<string, unknown>;
}) => {
value: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
source: string;

@@ -21,0 +21,0 @@ } | {

/// <reference types="node" />
import type { TAsset } from 'remotion';
import type { VideoConfig } from 'remotion/no-react';
import type { AudioOrVideoAsset, VideoConfig } from 'remotion/no-react';
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';

@@ -15,4 +14,6 @@ import type { BrowserExecutable } from './browser-executable';

import type { RemotionServer } from './prepare-server';
import type { EmittedArtifact } from './serialize-artifact';
import type { OnStartData, RenderFramesOutput } from './types';
export type InternalRenderFramesOptions = {
export type OnArtifact = (asset: EmittedArtifact) => void;
type InternalRenderFramesOptions = {
onStart: null | ((data: OnStartData) => void);

@@ -45,6 +46,12 @@ onFrameUpdate: null | ((framesRendered: number, frameIndex: number, timeToRenderInMilliseconds: number) => void);

compositionStart: number;
onArtifact: OnArtifact | null;
} & ToOptions<typeof optionsMap.renderFrames>;
type ArtifactWithoutContent = {
frame: number;
filename: string;
};
export type FrameAndAssets = {
frame: number;
assets: TAsset[];
audioAndVideoAssets: AudioOrVideoAsset[];
artifactAssets: ArtifactWithoutContent[];
};

@@ -85,2 +92,3 @@ export type RenderFramesOptions = {

concurrency?: number | string | null;
onArtifact?: OnArtifact | null;
serveUrl: string;

@@ -96,1 +104,2 @@ } & Partial<ToOptions<typeof optionsMap.renderFrames>>;

export declare const renderFrames: (options: RenderFramesOptions) => Promise<RenderFramesOutput>;
export {};

@@ -19,2 +19,3 @@ "use strict";

const handle_javascript_exception_1 = require("./error-handling/handle-javascript-exception");
const filter_asset_types_1 = require("./filter-asset-types");
const find_closest_package_json_1 = require("./find-closest-package-json");

@@ -44,3 +45,3 @@ const get_concurrency_1 = require("./get-concurrency");

const MAX_RETRIES_PER_FRAME = 1;
const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, jpegQuality, imageFormat, frameRange, onError, envVariables, onBrowserLog, onFrameBuffer, onDownload, pagesArray, serveUrl, composition, timeoutInMilliseconds, scale, actualConcurrency: concurrency, everyNthFrame, proxyPort, cancelSignal, downloadMap, muted, makeBrowser, browserReplacer, compositor, sourceMapGetter, logLevel, indent, parallelEncodingEnabled, compositionStart, forSeamlessAacConcatenation, }) => {
const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, jpegQuality, imageFormat, frameRange, onError, envVariables, onBrowserLog, onFrameBuffer, onDownload, pagesArray, serveUrl, composition, timeoutInMilliseconds, scale, actualConcurrency: concurrency, everyNthFrame, proxyPort, cancelSignal, downloadMap, muted, makeBrowser, browserReplacer, compositor, sourceMapGetter, logLevel, indent, parallelEncodingEnabled, compositionStart, forSeamlessAacConcatenation, onArtifact, }) => {
if (outputDir) {

@@ -224,11 +225,35 @@ if (!node_fs_1.default.existsSync(outputDir)) {

(0, perf_1.stopPerfMeasure)(id);
const compressedAssets = collectedAssets.map((asset) => (0, compress_assets_1.compressAsset)(assets
const previousAudioRenderAssets = assets
.filter(truthy_1.truthy)
.map((a) => a.assets)
.flat(2), asset));
.map((a) => a.audioAndVideoAssets)
.flat(2);
const previousArtifactAssets = assets
.filter(truthy_1.truthy)
.map((a) => a.artifactAssets)
.flat(2);
const audioAndVideoAssets = (0, filter_asset_types_1.onlyAudioAndVideoAssets)(collectedAssets);
const artifactAssets = (0, filter_asset_types_1.onlyArtifact)(collectedAssets);
for (const artifact of artifactAssets) {
for (const previousArtifact of previousArtifactAssets) {
if (artifact.filename === previousArtifact.filename) {
reject(new Error(`An artifact with output "${artifact.filename}" was already registered at frame ${previousArtifact.frame}, but now registered again at frame ${artifact.frame}. Artifacts must have unique names. https://remotion.dev/docs/artifacts`));
return;
}
}
onArtifact === null || onArtifact === void 0 ? void 0 : onArtifact(artifact);
}
const compressedAssets = audioAndVideoAssets.map((asset) => {
return (0, compress_assets_1.compressAsset)(previousAudioRenderAssets, asset);
});
assets.push({
assets: compressedAssets,
audioAndVideoAssets: compressedAssets,
frame,
artifactAssets: artifactAssets.map((a) => {
return {
frame: a.frame,
filename: a.filename,
};
}),
});
compressedAssets.forEach((renderAsset) => {
for (const renderAsset of compressedAssets) {
(0, download_and_map_assets_to_file_1.downloadAndMapAssetsToFileUrl)({

@@ -245,3 +270,3 @@ renderAsset,

});
});
}
if (!assetsOnly) {

@@ -392,3 +417,3 @@ framesRendered++;

};
const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, parallelEncodingEnabled, binariesDirectory, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, }) => {
const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, parallelEncodingEnabled, binariesDirectory, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, }) => {
(0, validate_1.validateDimension)(composition.height, 'height', 'in the `config` object passed to `renderFrames()`');

@@ -488,2 +513,3 @@ (0, validate_1.validateDimension)(composition.width, 'width', 'in the `config` object passed to `renderFrames()`');

onBrowserDownload,
onArtifact,
});

@@ -539,3 +565,3 @@ }),

const renderFrames = (options) => {
const { composition, inputProps, onFrameUpdate, onStart, outputDir, serveUrl, browserExecutable, cancelSignal, chromiumOptions, concurrency, dumpBrowserLogs, envVariables, everyNthFrame, frameRange, imageFormat, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, } = options;
const { composition, inputProps, onFrameUpdate, onStart, outputDir, serveUrl, browserExecutable, cancelSignal, chromiumOptions, concurrency, dumpBrowserLogs, envVariables, everyNthFrame, frameRange, imageFormat, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, binariesDirectory, onBrowserDownload, onArtifact, } = options;
if (!composition) {

@@ -594,4 +620,5 @@ throw new Error('No `composition` option has been specified for renderFrames()');

onBrowserDownload: onBrowserDownload !== null && onBrowserDownload !== void 0 ? onBrowserDownload : (0, browser_download_progress_bar_1.defaultBrowserDownloadProgress)({ indent, logLevel, api: 'renderFrames()' }),
onArtifact: onArtifact !== null && onArtifact !== void 0 ? onArtifact : null,
});
};
exports.renderFrames = renderFrames;

@@ -19,2 +19,3 @@ /// <reference types="node" />

import type { ProResProfile } from './prores-profile';
import type { OnArtifact } from './render-frames';
import type { OnStartData } from './types';

@@ -70,2 +71,3 @@ export type StitchingState = 'encoding' | 'muxing';

compositionStart: number;
onArtifact: OnArtifact | null;
} & MoreRenderMediaOptions;

@@ -123,2 +125,3 @@ type Prettify<T> = {

binariesDirectory?: string | null;
onArtifact?: OnArtifact;
}> & Partial<MoreRenderMediaOptions>;

@@ -137,3 +140,3 @@ type RenderMediaResult = {

*/
export declare const renderMedia: ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, }: RenderMediaOptions) => Promise<RenderMediaResult>;
export declare const renderMedia: ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, }: RenderMediaOptions) => Promise<RenderMediaResult>;
export {};

@@ -53,3 +53,3 @@ "use strict";

const SLOWEST_FRAME_COUNT = 10;
const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, serializedInputPropsWithCustomSchema, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, }) => {
const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, serializedInputPropsWithCustomSchema, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, concurrency, disallowParallelEncoding, everyNthFrame, imageFormat: provisionalImageFormat, indent, jpegQuality, numberOfGifLoops, onCtrlCExit, preferLossless, serveUrl, server: reusedServer, logLevel, serializedResolvedPropsWithCustomSchema, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, compositionStart, onBrowserDownload, onArtifact, }) => {
if (repro) {

@@ -358,2 +358,3 @@ (0, repro_1.enableRepro)({

onBrowserDownload,
onArtifact,
});

@@ -497,3 +498,3 @@ return renderFramesProc;

*/
const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, }) => {
const renderMedia = ({ proResProfile, x264Preset, crf, composition, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, audioCodec, jpegQuality, concurrency, serveUrl, disallowParallelEncoding, everyNthFrame, imageFormat, numberOfGifLoops, dumpBrowserLogs, preferLossless, verbose, quality, logLevel: passedLogLevel, offthreadVideoCacheSizeInBytes, colorSpace, repro, binariesDirectory, separateAudioTo, forSeamlessAacConcatenation, onBrowserDownload, onArtifact, }) => {
var _a, _b;

@@ -564,2 +565,3 @@ if (quality !== undefined) {

onBrowserDownload: onBrowserDownload !== null && onBrowserDownload !== void 0 ? onBrowserDownload : (0, browser_download_progress_bar_1.defaultBrowserDownloadProgress)({ indent, logLevel, api: 'renderMedia()' }),
onArtifact: onArtifact !== null && onArtifact !== void 0 ? onArtifact : null,
// TODO: In the future, introduce this as a public API when launching the distributed rendering API

@@ -566,0 +568,0 @@ compositionStart: 0,

@@ -13,2 +13,3 @@ /// <reference types="node" />

import type { RemotionServer } from './prepare-server';
import type { OnArtifact } from './render-frames';
type InternalRenderStillOptions = {

@@ -36,2 +37,3 @@ composition: VideoConfig;

offthreadVideoCacheSizeInBytes: number | null;
onArtifact: OnArtifact | null;
} & ToOptions<typeof optionsMap.renderStill>;

@@ -67,2 +69,3 @@ export type RenderStillOptions = {

quality?: never;
onArtifact?: OnArtifact;
} & Partial<ToOptions<typeof optionsMap.renderStill>>;

@@ -69,0 +72,0 @@ type RenderStillReturnValue = {

@@ -39,2 +39,3 @@ "use strict";

const handle_javascript_exception_1 = require("./error-handling/handle-javascript-exception");
const filter_asset_types_1 = require("./filter-asset-types");
const find_closest_package_json_1 = require("./find-closest-package-json");

@@ -55,3 +56,3 @@ const image_format_1 = require("./image-format");

const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFAULT_STILL_IMAGE_FORMAT, serveUrl, puppeteerInstance, onError, serializedInputPropsWithCustomSchema, envVariables, output, frame = 0, overwrite, browserExecutable, timeoutInMilliseconds, chromiumOptions, scale, proxyPort, cancelSignal, jpegQuality, onBrowserLog, compositor, sourceMapGetter, downloadMap, logLevel, indent, serializedResolvedPropsWithCustomSchema, onBrowserDownload, }) => {
const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFAULT_STILL_IMAGE_FORMAT, serveUrl, puppeteerInstance, onError, serializedInputPropsWithCustomSchema, envVariables, output, frame = 0, overwrite, browserExecutable, timeoutInMilliseconds, chromiumOptions, scale, proxyPort, cancelSignal, jpegQuality, onBrowserLog, compositor, sourceMapGetter, downloadMap, logLevel, indent, serializedResolvedPropsWithCustomSchema, onBrowserDownload, onArtifact, }) => {
(0, validate_1.validateDimension)(composition.height, 'height', 'in the `config` object passed to `renderStill()`');

@@ -192,3 +193,3 @@ (0, validate_1.validateDimension)(composition.width, 'width', 'in the `config` object passed to `renderStill()`');

});
const { buffer } = await (0, take_frame_and_compose_1.takeFrameAndCompose)({
const { buffer, collectedAssets } = await (0, take_frame_and_compose_1.takeFrameAndCompose)({
frame: stillFrame,

@@ -207,2 +208,13 @@ freePage: page,

});
const artifactAssets = (0, filter_asset_types_1.onlyArtifact)(collectedAssets);
const previousArtifactAssets = [];
for (const artifact of artifactAssets) {
for (const previousArtifact of previousArtifactAssets) {
if (artifact.filename === previousArtifact.filename) {
throw new Error(`An artifact with output "${artifact.filename}" was already registered at frame ${previousArtifact.frame}, but now registered again at frame ${artifact.frame}. Artifacts must have unique names. https://remotion.dev/docs/artifacts`);
}
}
previousArtifactAssets.push(artifact);
onArtifact === null || onArtifact === void 0 ? void 0 : onArtifact(artifact);
}
await cleanup();

@@ -271,3 +283,3 @@ return { buffer: output ? null : buffer };

var _a, _b;
const { composition, serveUrl, browserExecutable, cancelSignal, chromiumOptions, dumpBrowserLogs, envVariables, frame, imageFormat, inputProps, jpegQuality, onBrowserLog, onDownload, output, overwrite, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, offthreadVideoCacheSizeInBytes, logLevel: passedLogLevel, binariesDirectory, onBrowserDownload, } = options;
const { composition, serveUrl, browserExecutable, cancelSignal, chromiumOptions, dumpBrowserLogs, envVariables, frame, imageFormat, inputProps, jpegQuality, onBrowserLog, onDownload, output, overwrite, port, puppeteerInstance, scale, timeoutInMilliseconds, verbose, quality, offthreadVideoCacheSizeInBytes, logLevel: passedLogLevel, binariesDirectory, onBrowserDownload, onArtifact, } = options;
if (typeof jpegQuality !== 'undefined' && imageFormat !== 'jpeg') {

@@ -315,4 +327,5 @@ throw new Error("You can only pass the `quality` option if `imageFormat` is 'jpeg'.");

onBrowserDownload: onBrowserDownload !== null && onBrowserDownload !== void 0 ? onBrowserDownload : (0, browser_download_progress_bar_1.defaultBrowserDownloadProgress)({ indent, logLevel, api: 'renderStill()' }),
onArtifact: onArtifact !== null && onArtifact !== void 0 ? onArtifact : null,
});
};
exports.renderStill = renderStill;

@@ -82,3 +82,3 @@ "use strict";

page,
timeoutInMilliseconds,
timeoutInMilliseconds: 5000,
})

@@ -85,0 +85,0 @@ .then((res) => {

@@ -9,2 +9,3 @@ "use strict";

const node_path_1 = __importDefault(require("node:path"));
const collect_assets_1 = require("./collect-assets");
const compose_1 = require("./compositor/compose");

@@ -16,3 +17,3 @@ const provide_screenshot_1 = require("./provide-screenshot");

var _a;
const [{ value: clipRegion }, { value: collectedAssets }] = await Promise.all([
const [{ value: clipRegion }, collectedAssets] = await Promise.all([
(0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({

@@ -30,11 +31,3 @@ pageFunction: () => {

}),
(0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
pageFunction: () => {
return window.remotion_collectAssets();
},
args: [],
frame,
page: freePage,
timeoutInMilliseconds,
}),
(0, collect_assets_1.collectAssets)({ frame, freePage, timeoutInMilliseconds }),
]);

@@ -41,0 +34,0 @@ if (imageFormat === 'none') {

{
"name": "@remotion/renderer",
"version": "4.0.175",
"version": "4.0.176",
"description": "Renderer for Remotion",

@@ -20,4 +20,4 @@ "main": "dist/index.js",

"source-map": "^0.8.0-beta.0",
"ws": "8.7.0",
"remotion": "4.0.175"
"ws": "8.17.1",
"remotion": "4.0.176"
},

@@ -45,12 +45,12 @@ "peerDependencies": {

"@types/ws": "8.5.10",
"@remotion/streaming": "4.0.175"
"@remotion/streaming": "4.0.176"
},
"optionalDependencies": {
"@remotion/compositor-linux-arm64-gnu": "4.0.175",
"@remotion/compositor-darwin-arm64": "4.0.175",
"@remotion/compositor-linux-x64-gnu": "4.0.175",
"@remotion/compositor-darwin-x64": "4.0.175",
"@remotion/compositor-linux-x64-musl": "4.0.175",
"@remotion/compositor-win32-x64-msvc": "4.0.175",
"@remotion/compositor-linux-arm64-musl": "4.0.175"
"@remotion/compositor-darwin-arm64": "4.0.176",
"@remotion/compositor-linux-arm64-musl": "4.0.176",
"@remotion/compositor-darwin-x64": "4.0.176",
"@remotion/compositor-linux-arm64-gnu": "4.0.176",
"@remotion/compositor-linux-x64-gnu": "4.0.176",
"@remotion/compositor-linux-x64-musl": "4.0.176",
"@remotion/compositor-win32-x64-msvc": "4.0.176"
},

@@ -57,0 +57,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc