Add .gitignore to exclude all node packages and lock files
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
# @remotion/cli
|
||||
|
||||
Control Remotion features using the `npx remotion` command
|
||||
|
||||
[](https://npmcharts.com/compare/@remotion/cli?minimal=true)
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install @remotion/cli --save-exact
|
||||
```
|
||||
|
||||
When installing a Remotion package, make sure to align the version of all `remotion` and `@remotion/*` packages to the same version.
|
||||
Remove the `^` character from the version number to use the exact version.
|
||||
|
||||
## Usage
|
||||
|
||||
See the [documentation](https://www.remotion.dev/docs/cli) for more information.
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import { type LogLevel } from '@remotion/renderer';
|
||||
export declare const addCommand: ({ remotionRoot, packageManager, packageNames, logLevel, args, }: {
|
||||
remotionRoot: string;
|
||||
packageManager: string | undefined;
|
||||
packageNames: string[];
|
||||
logLevel: LogLevel;
|
||||
args: string[];
|
||||
}) => Promise<void>;
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.addCommand = void 0;
|
||||
const renderer_1 = require("@remotion/renderer");
|
||||
const studio_server_1 = require("@remotion/studio-server");
|
||||
const node_child_process_1 = require("node:child_process");
|
||||
const node_fs_1 = __importDefault(require("node:fs"));
|
||||
const chalk_1 = require("./chalk");
|
||||
const extra_packages_1 = require("./extra-packages");
|
||||
const list_of_remotion_packages_1 = require("./list-of-remotion-packages");
|
||||
const log_1 = require("./log");
|
||||
const resolve_from_1 = require("./resolve-from");
|
||||
const getInstalledVersion = (remotionRoot, pkg) => {
|
||||
try {
|
||||
const pkgJsonPath = (0, resolve_from_1.resolveFrom)(remotionRoot, `${pkg}/package.json`);
|
||||
const file = node_fs_1.default.readFileSync(pkgJsonPath, 'utf-8');
|
||||
const packageJson = JSON.parse(file);
|
||||
return packageJson.version;
|
||||
}
|
||||
catch (_a) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
const addCommand = async ({ remotionRoot, packageManager, packageNames, logLevel, args, }) => {
|
||||
// Validate that all package names are Remotion packages
|
||||
const invalidPackages = packageNames.filter((pkg) => !list_of_remotion_packages_1.listOfRemotionPackages.includes(pkg) && !extra_packages_1.EXTRA_PACKAGES[pkg]);
|
||||
if (invalidPackages.length > 0) {
|
||||
throw new Error(`The following packages are not Remotion packages: ${invalidPackages.join(', ')}. Must be one of the Remotion packages or one of the supported extra packages: ${Object.keys(extra_packages_1.EXTRA_PACKAGES).join(', ')}.`);
|
||||
}
|
||||
const { dependencies, devDependencies, optionalDependencies, peerDependencies, } = studio_server_1.StudioServerInternals.getInstalledDependencies(remotionRoot);
|
||||
// Check if packages are already installed
|
||||
const allDeps = [
|
||||
...dependencies,
|
||||
...devDependencies,
|
||||
...optionalDependencies,
|
||||
...peerDependencies,
|
||||
];
|
||||
const alreadyInstalled = [];
|
||||
const toInstall = [];
|
||||
const toUpgrade = [];
|
||||
for (const pkg of packageNames) {
|
||||
const isInstalled = allDeps.includes(pkg);
|
||||
const requiredVersion = extra_packages_1.EXTRA_PACKAGES[pkg];
|
||||
if (!isInstalled) {
|
||||
toInstall.push(pkg);
|
||||
}
|
||||
else if (requiredVersion) {
|
||||
// For extra packages, check if the version is correct
|
||||
const installedVersion = getInstalledVersion(remotionRoot, pkg);
|
||||
if (installedVersion !== requiredVersion) {
|
||||
toUpgrade.push({
|
||||
pkg,
|
||||
from: installedVersion !== null && installedVersion !== void 0 ? installedVersion : 'unknown',
|
||||
to: requiredVersion,
|
||||
});
|
||||
toInstall.push(pkg);
|
||||
}
|
||||
else {
|
||||
alreadyInstalled.push(pkg);
|
||||
}
|
||||
}
|
||||
else {
|
||||
alreadyInstalled.push(pkg);
|
||||
}
|
||||
}
|
||||
// Log already installed packages
|
||||
for (const pkg of alreadyInstalled) {
|
||||
log_1.Log.info({ indent: false, logLevel }, `○ ${pkg} ${chalk_1.chalk.gray('(already installed)')}`);
|
||||
}
|
||||
// Log packages that will be upgraded
|
||||
for (const { pkg, from, to } of toUpgrade) {
|
||||
log_1.Log.info({ indent: false, logLevel }, `↑ ${pkg} ${chalk_1.chalk.yellow(`${from} → ${to}`)}`);
|
||||
}
|
||||
// If nothing to install, return early
|
||||
if (toInstall.length === 0) {
|
||||
return;
|
||||
}
|
||||
const installedRemotionPackages = list_of_remotion_packages_1.listOfRemotionPackages.filter((pkg) => allDeps.includes(pkg));
|
||||
// Get the version from the first installed Remotion package
|
||||
const packageJsonPath = `${remotionRoot}/node_modules/${installedRemotionPackages[0]}/package.json`;
|
||||
let targetVersion = null;
|
||||
if (installedRemotionPackages.length > 0) {
|
||||
try {
|
||||
const packageJson = require(packageJsonPath);
|
||||
targetVersion = packageJson.version;
|
||||
const packageList = toInstall.length === 1
|
||||
? toInstall[0]
|
||||
: `${toInstall.length} packages (${toInstall.join(', ')})`;
|
||||
log_1.Log.info({ indent: false, logLevel }, `Installing ${packageList}`);
|
||||
}
|
||||
catch (err) {
|
||||
throw new Error(`Could not determine version of installed Remotion packages: ${err.message}`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If no Remotion packages are installed, we can only install extra packages
|
||||
const notExtraPackages = toInstall.filter((pkg) => !extra_packages_1.EXTRA_PACKAGES[pkg]);
|
||||
if (notExtraPackages.length > 0) {
|
||||
throw new Error('No Remotion packages found in your project. Install Remotion first.');
|
||||
}
|
||||
}
|
||||
const manager = studio_server_1.StudioServerInternals.getPackageManager({
|
||||
remotionRoot,
|
||||
packageManager,
|
||||
dirUp: 0,
|
||||
logLevel,
|
||||
});
|
||||
if (manager === 'unknown') {
|
||||
throw new Error(`No lockfile was found in your project (one of ${studio_server_1.StudioServerInternals.lockFilePaths
|
||||
.map((p) => p.path)
|
||||
.join(', ')}). Install dependencies using your favorite manager!`);
|
||||
}
|
||||
const packagesWithVersions = toInstall.map((pkg) => {
|
||||
if (extra_packages_1.EXTRA_PACKAGES[pkg]) {
|
||||
return `${pkg}@${extra_packages_1.EXTRA_PACKAGES[pkg]}`;
|
||||
}
|
||||
return `${pkg}@${targetVersion}`;
|
||||
});
|
||||
const command = studio_server_1.StudioServerInternals.getInstallCommand({
|
||||
manager: manager.manager,
|
||||
packages: packagesWithVersions,
|
||||
version: '',
|
||||
additionalArgs: args,
|
||||
});
|
||||
log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray(`$ ${manager.manager} ${command.join(' ')}`));
|
||||
const task = (0, node_child_process_1.spawn)(manager.manager, command, {
|
||||
env: {
|
||||
...process.env,
|
||||
ADBLOCK: '1',
|
||||
DISABLE_OPENCOLLECTIVE: '1',
|
||||
npm_config_loglevel: 'error',
|
||||
},
|
||||
stdio: renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'info')
|
||||
? 'inherit'
|
||||
: 'ignore',
|
||||
});
|
||||
await new Promise((resolve) => {
|
||||
task.on('close', (code) => {
|
||||
if (code === 0) {
|
||||
resolve();
|
||||
}
|
||||
else if (renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'info')) {
|
||||
throw new Error(`Failed to install packages, see logs above`);
|
||||
}
|
||||
else {
|
||||
throw new Error(`Failed to install packages, run with --log=info to see logs`);
|
||||
}
|
||||
});
|
||||
});
|
||||
const upgradedPkgs = new Set(toUpgrade.map((u) => u.pkg));
|
||||
for (const pkg of toInstall) {
|
||||
if (upgradedPkgs.has(pkg)) {
|
||||
// Already logged as upgrade
|
||||
continue;
|
||||
}
|
||||
if (extra_packages_1.EXTRA_PACKAGES[pkg]) {
|
||||
log_1.Log.info({ indent: false, logLevel }, `+ ${pkg}@${extra_packages_1.EXTRA_PACKAGES[pkg]}`);
|
||||
}
|
||||
else {
|
||||
log_1.Log.info({ indent: false, logLevel }, `+ ${pkg}@${targetVersion}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.addCommand = addCommand;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import type { LogLevel } from '@remotion/renderer';
|
||||
export declare const benchmarkCommand: (remotionRoot: string, args: string[], logLevel: LogLevel) => Promise<void>;
|
||||
+402
@@ -0,0 +1,402 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.benchmarkCommand = void 0;
|
||||
const renderer_1 = require("@remotion/renderer");
|
||||
const client_1 = require("@remotion/renderer/client");
|
||||
const no_react_1 = require("remotion/no-react");
|
||||
const browser_download_bar_1 = require("./browser-download-bar");
|
||||
const chalk_1 = require("./chalk");
|
||||
const cleanup_before_quit_1 = require("./cleanup-before-quit");
|
||||
const config_1 = require("./config");
|
||||
const preview_server_1 = require("./config/preview-server");
|
||||
const convert_entry_point_to_serve_url_1 = require("./convert-entry-point-to-serve-url");
|
||||
const entry_point_1 = require("./entry-point");
|
||||
const get_cli_options_1 = require("./get-cli-options");
|
||||
const image_formats_1 = require("./image-formats");
|
||||
const log_1 = require("./log");
|
||||
const make_progress_bar_1 = require("./make-progress-bar");
|
||||
const parsed_cli_1 = require("./parsed-cli");
|
||||
const progress_bar_1 = require("./progress-bar");
|
||||
const setup_cache_1 = require("./setup-cache");
|
||||
const should_use_non_overlaying_logger_1 = require("./should-use-non-overlaying-logger");
|
||||
const show_compositions_picker_1 = require("./show-compositions-picker");
|
||||
const truthy_1 = require("./truthy");
|
||||
const DEFAULT_RUNS = 3;
|
||||
const { audioBitrateOption, x264Option, offthreadVideoCacheSizeInBytesOption, scaleOption, crfOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, videoCodecOption, colorSpaceOption, disallowParallelEncodingOption, enableMultiprocessOnLinuxOption, glOption, numberOfGifLoopsOption, encodingMaxRateOption, encodingBufferSizeOption, delayRenderTimeoutInMillisecondsOption, headlessOption, overwriteOption, binariesDirectoryOption, forSeamlessAacConcatenationOption, publicPathOption, publicDirOption, metadataOption, hardwareAccelerationOption, chromeModeOption, offthreadVideoThreadsOption, mediaCacheSizeInBytesOption, darkModeOption, askAIOption, experimentalClientSideRenderingOption, keyboardShortcutsOption, } = client_1.BrowserSafeApis.options;
|
||||
const getValidConcurrency = (cliConcurrency) => {
|
||||
const { concurrencies } = parsed_cli_1.parsedCli;
|
||||
if (!concurrencies) {
|
||||
return [renderer_1.RenderInternals.resolveConcurrency(cliConcurrency)];
|
||||
}
|
||||
return String(concurrencies)
|
||||
.split(',')
|
||||
.map((c) => parseInt(c.trim(), 10));
|
||||
};
|
||||
const runBenchmark = async (runs, options, onProgress) => {
|
||||
const timeTaken = [];
|
||||
for (let run = 0; run < runs; ++run) {
|
||||
const startTime = performance.now();
|
||||
await renderer_1.RenderInternals.internalRenderMedia({
|
||||
onProgress: ({ progress }) => onProgress === null || onProgress === void 0 ? void 0 : onProgress(run, progress),
|
||||
...options,
|
||||
});
|
||||
const endTime = performance.now();
|
||||
timeTaken.push(endTime - startTime);
|
||||
}
|
||||
return timeTaken;
|
||||
};
|
||||
const formatTime = (time) => {
|
||||
let ret = '';
|
||||
const hours = Math.floor(time / (60 * 60 * 1000));
|
||||
if (hours) {
|
||||
ret = `${hours}h`;
|
||||
}
|
||||
time %= 60 * 60 * 1000;
|
||||
const minutes = Math.floor(time / (60 * 1000));
|
||||
if (minutes) {
|
||||
ret = `${ret}${minutes}m`;
|
||||
}
|
||||
time %= 60 * 1000;
|
||||
const seconds = (time / 1000).toFixed(5);
|
||||
if (seconds) {
|
||||
ret = `${ret}${seconds}s`;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
const avg = (time) => time.reduce((prev, curr) => prev + curr) / time.length;
|
||||
const stdDev = (time) => {
|
||||
const mean = avg(time);
|
||||
return Math.sqrt(time.map((x) => (x - mean) ** 2).reduce((a, b) => a + b) / time.length);
|
||||
};
|
||||
const getResults = (results, runs) => {
|
||||
const mean = avg(results);
|
||||
const dev = stdDev(results);
|
||||
const max = Math.max(...results);
|
||||
const min = Math.min(...results);
|
||||
return ` Time (${chalk_1.chalk.green('mean')} ± ${chalk_1.chalk.green('σ')}): ${chalk_1.chalk.green(formatTime(mean))} ± ${chalk_1.chalk.green(formatTime(dev))}\n Range (${chalk_1.chalk.blue('min')} ... ${chalk_1.chalk.red('max')}): ${chalk_1.chalk.blue(formatTime(min))} ... ${chalk_1.chalk.red(formatTime(max))} \t ${chalk_1.chalk.gray(`${runs} runs`)}
|
||||
`;
|
||||
};
|
||||
const makeBenchmarkProgressBar = ({ totalRuns, run, progress, doneIn, }) => {
|
||||
const totalProgress = (run + progress) / totalRuns;
|
||||
return [
|
||||
`Rendering (${run + 1} out of ${totalRuns} runs)`,
|
||||
(0, make_progress_bar_1.makeProgressBar)(totalProgress, false),
|
||||
doneIn === null
|
||||
? `${(totalProgress * 100).toFixed(2)}% `
|
||||
: chalk_1.chalk.gray(doneIn),
|
||||
].join(' ');
|
||||
};
|
||||
const benchmarkCommand = async (remotionRoot, args, logLevel) => {
|
||||
var _a, _b, _c;
|
||||
const runs = (_a = parsed_cli_1.parsedCli.runs) !== null && _a !== void 0 ? _a : DEFAULT_RUNS;
|
||||
const { file, reason, remainingArgs } = (0, entry_point_1.findEntryPoint)({
|
||||
args,
|
||||
remotionRoot,
|
||||
logLevel,
|
||||
allowDirectory: true,
|
||||
});
|
||||
if (!file) {
|
||||
log_1.Log.error({ indent: false, logLevel }, 'No entry file passed.');
|
||||
log_1.Log.info({ indent: false, logLevel }, 'Pass an additional argument specifying the entry file');
|
||||
log_1.Log.info({ indent: false, logLevel });
|
||||
log_1.Log.info({ indent: false, logLevel }, `$ remotion benchmark <entry file>`);
|
||||
process.exit(1);
|
||||
}
|
||||
const fullEntryPoint = (0, convert_entry_point_to_serve_url_1.convertEntryPointToServeUrl)(file);
|
||||
const { inputProps, envVariables, browserExecutable, proResProfile, frameRange: defaultFrameRange, pixelFormat, everyNthFrame, ffmpegOverride, height, width, concurrency: unparsedConcurrency, disableWebSecurity, userAgent, ignoreCertificateErrors, } = (0, get_cli_options_1.getCliOptions)({
|
||||
isStill: false,
|
||||
logLevel,
|
||||
indent: false,
|
||||
});
|
||||
log_1.Log.verbose({ indent: false, logLevel }, 'Entry point:', fullEntryPoint, 'reason:', reason);
|
||||
const scale = scaleOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const enableMultiProcessOnLinux = enableMultiprocessOnLinuxOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const gl = glOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const headless = headlessOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const publicPath = publicPathOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const publicDir = publicDirOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const chromeMode = chromeModeOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const darkMode = darkModeOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const experimentalClientSideRenderingEnabled = experimentalClientSideRenderingOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const askAIEnabled = askAIOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
if (experimentalClientSideRenderingEnabled) {
|
||||
log_1.Log.warn({ indent: false, logLevel }, 'Enabling WIP client-side rendering. Please see caveats on https://www.remotion.dev/docs/client-side-rendering/.');
|
||||
}
|
||||
const chromiumOptions = {
|
||||
disableWebSecurity,
|
||||
enableMultiProcessOnLinux,
|
||||
gl,
|
||||
headless,
|
||||
ignoreCertificateErrors,
|
||||
userAgent,
|
||||
darkMode,
|
||||
};
|
||||
const onBrowserDownload = (0, browser_download_bar_1.defaultBrowserDownloadProgress)({
|
||||
indent: false,
|
||||
logLevel,
|
||||
quiet: (0, parsed_cli_1.quietFlagProvided)(),
|
||||
onProgress: () => undefined,
|
||||
});
|
||||
const indent = false;
|
||||
await renderer_1.RenderInternals.internalEnsureBrowser({
|
||||
browserExecutable,
|
||||
indent,
|
||||
logLevel,
|
||||
onBrowserDownload,
|
||||
chromeMode,
|
||||
});
|
||||
const browserInstance = renderer_1.RenderInternals.internalOpenBrowser({
|
||||
browser: 'chrome',
|
||||
browserExecutable,
|
||||
chromiumOptions,
|
||||
forceDeviceScaleFactor: scale,
|
||||
indent,
|
||||
viewport: null,
|
||||
logLevel,
|
||||
onBrowserDownload,
|
||||
chromeMode,
|
||||
});
|
||||
const { urlOrBundle: bundleLocation, cleanup: cleanupBundle } = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({
|
||||
fullPath: fullEntryPoint,
|
||||
publicDir,
|
||||
remotionRoot,
|
||||
onProgress: () => undefined,
|
||||
indentOutput: false,
|
||||
logLevel,
|
||||
onDirectoryCreated: (dir) => {
|
||||
(0, cleanup_before_quit_1.registerCleanupJob)(`Delete ${dir}`, () => renderer_1.RenderInternals.deleteDirectory(dir));
|
||||
},
|
||||
quietProgress: false,
|
||||
quietFlag: (0, parsed_cli_1.quietFlagProvided)(),
|
||||
outDir: null,
|
||||
// Not needed for benchmark
|
||||
gitSource: null,
|
||||
bufferStateDelayInMilliseconds: null,
|
||||
maxTimelineTracks: null,
|
||||
publicPath,
|
||||
audioLatencyHint: null,
|
||||
experimentalClientSideRenderingEnabled,
|
||||
askAIEnabled,
|
||||
keyboardShortcutsEnabled,
|
||||
});
|
||||
(0, cleanup_before_quit_1.registerCleanupJob)(`Deleting bundle`, () => cleanupBundle());
|
||||
const puppeteerInstance = await browserInstance;
|
||||
const serializedInputPropsWithCustomSchema = no_react_1.NoReactInternals.serializeJSONWithSpecialTypes({
|
||||
data: inputProps !== null && inputProps !== void 0 ? inputProps : {},
|
||||
indent: undefined,
|
||||
staticBase: null,
|
||||
}).serializedString;
|
||||
const comps = await renderer_1.RenderInternals.internalGetCompositions({
|
||||
serveUrlOrWebpackUrl: bundleLocation,
|
||||
serializedInputPropsWithCustomSchema,
|
||||
envVariables,
|
||||
chromiumOptions,
|
||||
timeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value,
|
||||
port: (0, preview_server_1.getRendererPortFromConfigFileAndCliFlag)(),
|
||||
puppeteerInstance,
|
||||
browserExecutable,
|
||||
indent: false,
|
||||
onBrowserLog: null,
|
||||
// Intentionally disabling server to not cache results
|
||||
server: undefined,
|
||||
logLevel,
|
||||
offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value,
|
||||
offthreadVideoThreads: offthreadVideoThreadsOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value,
|
||||
binariesDirectory: binariesDirectoryOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value,
|
||||
onBrowserDownload,
|
||||
chromeMode,
|
||||
mediaCacheSizeInBytes: mediaCacheSizeInBytesOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value,
|
||||
onLog: renderer_1.RenderInternals.defaultOnLog,
|
||||
});
|
||||
const ids = (remainingArgs[0]
|
||||
? String(remainingArgs[0])
|
||||
.split(',')
|
||||
.map((c) => c.trim())
|
||||
.filter(truthy_1.truthy)
|
||||
: await (0, show_compositions_picker_1.showMultiCompositionsPicker)(comps, logLevel));
|
||||
const compositions = ids.map((compId) => {
|
||||
const composition = comps.find((c) => c.id === compId);
|
||||
if (!composition) {
|
||||
throw new Error(`No composition with the ID "${compId}" found.`);
|
||||
}
|
||||
return composition;
|
||||
});
|
||||
if (compositions.length === 0) {
|
||||
log_1.Log.error({ indent: false, logLevel }, 'No composition IDs passed. Add another argument to the command specifying at least 1 composition ID.');
|
||||
}
|
||||
const benchmark = {};
|
||||
let count = 1;
|
||||
const x264Preset = x264Option.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const audioBitrate = audioBitrateOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const configFileCrf = crfOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const jpegQuality = jpegQualityOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const videoBitrate = videoBitrateOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const enforceAudioTrack = enforceAudioOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const muted = mutedOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const disallowParallelEncoding = disallowParallelEncodingOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const numberOfGifLoops = numberOfGifLoopsOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const encodingMaxRate = encodingMaxRateOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const encodingBufferSize = encodingBufferSizeOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const delayRenderInMilliseconds = delayRenderTimeoutInMillisecondsOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const overwrite = overwriteOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}, true).value;
|
||||
const metadata = metadataOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
for (const composition of compositions) {
|
||||
const { value: videoCodec, source: codecReason } = videoCodecOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}, {
|
||||
downloadName: null,
|
||||
outName: null,
|
||||
configFile: (_b = config_1.ConfigInternals.getOutputCodecOrUndefined()) !== null && _b !== void 0 ? _b : null,
|
||||
uiCodec: null,
|
||||
compositionCodec: (_c = composition.defaultCodec) !== null && _c !== void 0 ? _c : null,
|
||||
});
|
||||
const concurrency = getValidConcurrency(unparsedConcurrency);
|
||||
benchmark[composition.id] = {};
|
||||
for (const con of concurrency) {
|
||||
const benchmarkProgress = (0, progress_bar_1.createOverwriteableCliOutput)({
|
||||
quiet: (0, parsed_cli_1.quietFlagProvided)(),
|
||||
cancelSignal: null,
|
||||
updatesDontOverwrite: (0, should_use_non_overlaying_logger_1.shouldUseNonOverlayingLogger)({ logLevel }),
|
||||
indent: false,
|
||||
});
|
||||
log_1.Log.info({ indent: false, logLevel });
|
||||
log_1.Log.info({ indent: false, logLevel }, `${chalk_1.chalk.bold(`Benchmark #${count++}:`)} ${chalk_1.chalk.gray(`composition=${composition.id} concurrency=${con} codec=${videoCodec} (${codecReason})`)}`);
|
||||
const timeTaken = await runBenchmark(runs, {
|
||||
outputLocation: null,
|
||||
composition: {
|
||||
...composition,
|
||||
width: width !== null && width !== void 0 ? width : composition.width,
|
||||
height: height !== null && height !== void 0 ? height : composition.height,
|
||||
},
|
||||
crf: configFileCrf !== null && configFileCrf !== void 0 ? configFileCrf : null,
|
||||
envVariables,
|
||||
frameRange: defaultFrameRange,
|
||||
imageFormat: (0, image_formats_1.getVideoImageFormat)({
|
||||
codec: videoCodec,
|
||||
uiImageFormat: null,
|
||||
}),
|
||||
serializedInputPropsWithCustomSchema,
|
||||
overwrite,
|
||||
pixelFormat,
|
||||
proResProfile,
|
||||
x264Preset,
|
||||
jpegQuality,
|
||||
chromiumOptions,
|
||||
timeoutInMilliseconds: delayRenderInMilliseconds,
|
||||
scale,
|
||||
port: (0, preview_server_1.getRendererPortFromConfigFileAndCliFlag)(),
|
||||
numberOfGifLoops,
|
||||
everyNthFrame,
|
||||
logLevel,
|
||||
muted,
|
||||
enforceAudioTrack,
|
||||
browserExecutable,
|
||||
ffmpegOverride,
|
||||
serveUrl: bundleLocation,
|
||||
codec: videoCodec,
|
||||
audioBitrate,
|
||||
videoBitrate,
|
||||
encodingMaxRate,
|
||||
encodingBufferSize,
|
||||
puppeteerInstance,
|
||||
concurrency: con,
|
||||
audioCodec: null,
|
||||
cancelSignal: undefined,
|
||||
disallowParallelEncoding,
|
||||
indent: false,
|
||||
onBrowserLog: null,
|
||||
onCtrlCExit: () => undefined,
|
||||
onDownload: () => undefined,
|
||||
onStart: () => undefined,
|
||||
preferLossless: false,
|
||||
server: undefined,
|
||||
serializedResolvedPropsWithCustomSchema: no_react_1.NoReactInternals.serializeJSONWithSpecialTypes({
|
||||
data: composition.props,
|
||||
indent: undefined,
|
||||
staticBase: null,
|
||||
}).serializedString,
|
||||
offthreadVideoThreads: offthreadVideoThreadsOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value,
|
||||
offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytesOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value,
|
||||
colorSpace: colorSpaceOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value,
|
||||
repro: false,
|
||||
binariesDirectory: binariesDirectoryOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value,
|
||||
separateAudioTo: null,
|
||||
forSeamlessAacConcatenation: forSeamlessAacConcatenationOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value,
|
||||
compositionStart: 0,
|
||||
onBrowserDownload,
|
||||
onArtifact: () => undefined,
|
||||
metadata,
|
||||
hardwareAcceleration: hardwareAccelerationOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value,
|
||||
chromeMode,
|
||||
mediaCacheSizeInBytes: mediaCacheSizeInBytesOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value,
|
||||
onLog: renderer_1.RenderInternals.defaultOnLog,
|
||||
licenseKey: null,
|
||||
isProduction: null,
|
||||
}, (run, progress) => {
|
||||
benchmarkProgress.update(makeBenchmarkProgressBar({
|
||||
totalRuns: runs,
|
||||
run,
|
||||
doneIn: null,
|
||||
progress,
|
||||
}), false);
|
||||
});
|
||||
benchmarkProgress.update('', false);
|
||||
benchmarkProgress.update(getResults(timeTaken, runs), false);
|
||||
benchmark[composition.id][`${con}`] =
|
||||
timeTaken;
|
||||
}
|
||||
}
|
||||
log_1.Log.info({ indent: false, logLevel });
|
||||
};
|
||||
exports.benchmarkCommand = benchmarkCommand;
|
||||
Generated
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
import type { LogLevel, OnBrowserDownload } from '@remotion/renderer';
|
||||
import type { BrowserDownloadState } from '@remotion/studio-shared';
|
||||
export declare const defaultBrowserDownloadProgress: ({ indent, logLevel, quiet, onProgress, }: {
|
||||
indent: boolean;
|
||||
logLevel: LogLevel;
|
||||
quiet: boolean;
|
||||
onProgress: (progress: BrowserDownloadState) => void;
|
||||
}) => OnBrowserDownload;
|
||||
Generated
Vendored
+81
@@ -0,0 +1,81 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.defaultBrowserDownloadProgress = void 0;
|
||||
const renderer_1 = require("@remotion/renderer");
|
||||
const chalk_1 = require("./chalk");
|
||||
const log_1 = require("./log");
|
||||
const make_progress_bar_1 = require("./make-progress-bar");
|
||||
const progress_bar_1 = require("./progress-bar");
|
||||
const should_use_non_overlaying_logger_1 = require("./should-use-non-overlaying-logger");
|
||||
const truthy_1 = require("./truthy");
|
||||
const makeDownloadProgress = ({ bytesDownloaded, totalBytes, doneIn, chromeMode, }) => {
|
||||
const progress = bytesDownloaded / totalBytes;
|
||||
return [
|
||||
`${doneIn ? 'Got' : 'Getting'} ${chromeMode === 'chrome-for-testing'
|
||||
? 'Chrome for Testing'
|
||||
: 'Headless Shell'}`.padEnd(progress_bar_1.LABEL_WIDTH, ' '),
|
||||
(0, make_progress_bar_1.makeProgressBar)(progress, false),
|
||||
doneIn === null
|
||||
? (progress * 100).toFixed(0) + '%'
|
||||
: chalk_1.chalk.gray(`${doneIn}ms`),
|
||||
]
|
||||
.filter(truthy_1.truthy)
|
||||
.join(' ');
|
||||
};
|
||||
const defaultBrowserDownloadProgress = ({ indent, logLevel, quiet, onProgress, }) => {
|
||||
return ({ chromeMode }) => {
|
||||
if (chromeMode === 'chrome-for-testing') {
|
||||
log_1.Log.info({ indent, logLevel }, 'Downloading Chrome for Testing https://www.remotion.dev/chrome-for-testing');
|
||||
}
|
||||
else {
|
||||
log_1.Log.info({ indent, logLevel }, chalk_1.chalk.gray('Downloading Chrome Headless Shell https://www.remotion.dev/chrome-headless-shell'));
|
||||
}
|
||||
const updatesDontOverwrite = (0, should_use_non_overlaying_logger_1.shouldUseNonOverlayingLogger)({ logLevel });
|
||||
const productName = chromeMode === 'chrome-for-testing'
|
||||
? 'Chrome for Testing'
|
||||
: 'Headless Shell';
|
||||
if (updatesDontOverwrite) {
|
||||
let lastProgress = 0;
|
||||
return {
|
||||
version: null,
|
||||
onProgress: (progress) => {
|
||||
if (progress.downloadedBytes > lastProgress + 10000000) {
|
||||
lastProgress = progress.downloadedBytes;
|
||||
log_1.Log.info({ indent, logLevel }, `Getting ${productName} - ${renderer_1.RenderInternals.toMegabytes(progress.downloadedBytes)}/${renderer_1.RenderInternals.toMegabytes(progress.totalSizeInBytes)}`);
|
||||
}
|
||||
if (progress.percent === 1) {
|
||||
log_1.Log.info({ indent, logLevel }, `Got ${productName}`);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
const cliOutput = (0, progress_bar_1.createOverwriteableCliOutput)({
|
||||
quiet,
|
||||
indent,
|
||||
cancelSignal: null,
|
||||
updatesDontOverwrite,
|
||||
});
|
||||
const startedAt = Date.now();
|
||||
let doneIn = null;
|
||||
return {
|
||||
version: null,
|
||||
onProgress: (progress) => {
|
||||
if (progress.percent === 1) {
|
||||
doneIn = Date.now() - startedAt;
|
||||
}
|
||||
onProgress({
|
||||
alreadyAvailable: progress.alreadyAvailable,
|
||||
progress: progress.percent,
|
||||
doneIn,
|
||||
});
|
||||
cliOutput.update(makeDownloadProgress({
|
||||
doneIn,
|
||||
bytesDownloaded: progress.downloadedBytes,
|
||||
totalBytes: progress.totalSizeInBytes,
|
||||
chromeMode,
|
||||
}), progress.percent === 1);
|
||||
},
|
||||
};
|
||||
};
|
||||
};
|
||||
exports.defaultBrowserDownloadProgress = defaultBrowserDownloadProgress;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import type { LogLevel } from '@remotion/renderer';
|
||||
export declare const ENSURE_COMMAND = "ensure";
|
||||
export declare const ensureCommand: (logLevel: LogLevel) => Promise<void>;
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ensureCommand = exports.ENSURE_COMMAND = void 0;
|
||||
const renderer_1 = require("@remotion/renderer");
|
||||
const browser_download_bar_1 = require("../browser-download-bar");
|
||||
const get_cli_options_1 = require("../get-cli-options");
|
||||
const log_1 = require("../log");
|
||||
const parsed_cli_1 = require("../parsed-cli");
|
||||
exports.ENSURE_COMMAND = 'ensure';
|
||||
const ensureCommand = async (logLevel) => {
|
||||
const indent = false;
|
||||
const { browserExecutable } = (0, get_cli_options_1.getCliOptions)({
|
||||
isStill: false,
|
||||
logLevel,
|
||||
indent,
|
||||
});
|
||||
const status = await (0, renderer_1.ensureBrowser)({
|
||||
browserExecutable,
|
||||
logLevel,
|
||||
onBrowserDownload: (0, browser_download_bar_1.defaultBrowserDownloadProgress)({
|
||||
indent,
|
||||
logLevel,
|
||||
quiet: (0, parsed_cli_1.quietFlagProvided)(),
|
||||
onProgress: () => undefined,
|
||||
}),
|
||||
});
|
||||
if (status.type === 'no-browser') {
|
||||
throw new Error('should have downloaded browser');
|
||||
}
|
||||
if (status.type === 'user-defined-path') {
|
||||
log_1.Log.info({ indent, logLevel }, `Has browser at ${status.path}`);
|
||||
return;
|
||||
}
|
||||
if (status.type === 'local-puppeteer-browser') {
|
||||
log_1.Log.info({ indent, logLevel }, `Has browser at ${status.path}`);
|
||||
}
|
||||
};
|
||||
exports.ensureCommand = ensureCommand;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import type { LogLevel } from '@remotion/renderer';
|
||||
export declare const BROWSER_COMMAND = "browser";
|
||||
export declare const browserCommand: (args: string[], logLevel: LogLevel) => Promise<void> | undefined;
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.browserCommand = exports.BROWSER_COMMAND = void 0;
|
||||
const chalk_1 = require("../chalk");
|
||||
const log_1 = require("../log");
|
||||
const ensure_1 = require("./ensure");
|
||||
exports.BROWSER_COMMAND = 'browser';
|
||||
const printHelp = (logLevel) => {
|
||||
log_1.Log.info({ indent: false, logLevel });
|
||||
log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blue(`remotion ${exports.BROWSER_COMMAND}`));
|
||||
log_1.Log.info({ indent: false, logLevel });
|
||||
log_1.Log.info({ indent: false, logLevel }, 'Available commands:');
|
||||
log_1.Log.info({ indent: false, logLevel }, '');
|
||||
log_1.Log.info({ indent: false, logLevel }, `remotion ${exports.BROWSER_COMMAND} ${ensure_1.ENSURE_COMMAND}`);
|
||||
log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray('Ensure Remotion has a browser to render.'));
|
||||
};
|
||||
const browserCommand = (args, logLevel) => {
|
||||
if (args[0] === ensure_1.ENSURE_COMMAND) {
|
||||
return (0, ensure_1.ensureCommand)(logLevel);
|
||||
}
|
||||
printHelp(logLevel);
|
||||
};
|
||||
exports.browserCommand = browserCommand;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import type { LogLevel } from '@remotion/renderer';
|
||||
export declare const bundleCommand: (remotionRoot: string, args: string[], logLevel: LogLevel) => Promise<void>;
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.bundleCommand = void 0;
|
||||
const bundler_1 = require("@remotion/bundler");
|
||||
const client_1 = require("@remotion/renderer/client");
|
||||
const studio_server_1 = require("@remotion/studio-server");
|
||||
const fs_1 = require("fs");
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const chalk_1 = require("./chalk");
|
||||
const entry_point_1 = require("./entry-point");
|
||||
const get_github_repository_1 = require("./get-github-repository");
|
||||
const log_1 = require("./log");
|
||||
const parsed_cli_1 = require("./parsed-cli");
|
||||
const setup_cache_1 = require("./setup-cache");
|
||||
const should_use_non_overlaying_logger_1 = require("./should-use-non-overlaying-logger");
|
||||
const yes_or_no_1 = require("./yes-or-no");
|
||||
const { publicPathOption, publicDirOption, disableGitSourceOption, audioLatencyHintOption, askAIOption, experimentalClientSideRenderingOption, keyboardShortcutsOption, } = client_1.BrowserSafeApis.options;
|
||||
const bundleCommand = async (remotionRoot, args, logLevel) => {
|
||||
const { file, reason } = (0, entry_point_1.findEntryPoint)({
|
||||
args,
|
||||
remotionRoot,
|
||||
logLevel,
|
||||
allowDirectory: false,
|
||||
});
|
||||
const explicitlyPassed = args[0];
|
||||
if (explicitlyPassed &&
|
||||
reason !== 'argument passed' &&
|
||||
reason !== 'argument passed - found in cwd' &&
|
||||
reason !== 'argument passed - found in root') {
|
||||
log_1.Log.error({ indent: false, logLevel }, `Entry point was specified as ${chalk_1.chalk.bold(explicitlyPassed)}, but it was not found.`);
|
||||
process.exit(1);
|
||||
}
|
||||
const updatesDontOverwrite = (0, should_use_non_overlaying_logger_1.shouldUseNonOverlayingLogger)({ logLevel });
|
||||
if (!file) {
|
||||
log_1.Log.error({ indent: false, logLevel }, 'No entry point found.');
|
||||
log_1.Log.error({ indent: false, logLevel }, 'Pass another argument to the command specifying the entry point.');
|
||||
log_1.Log.error({ indent: false, logLevel }, 'See: https://www.remotion.dev/docs/terminology/entry-point');
|
||||
process.exit(1);
|
||||
}
|
||||
const experimentalClientSideRenderingEnabled = experimentalClientSideRenderingOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const askAIEnabled = askAIOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
if (experimentalClientSideRenderingEnabled) {
|
||||
log_1.Log.warn({ indent: false, logLevel }, 'Enabling WIP client-side rendering. Please see caveats on https://www.remotion.dev/docs/client-side-rendering/.');
|
||||
}
|
||||
const publicPath = publicPathOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const publicDir = publicDirOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const disableGitSource = disableGitSourceOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const audioLatencyHint = audioLatencyHintOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const outputPath = parsed_cli_1.parsedCli['out-dir']
|
||||
? path_1.default.resolve(process.cwd(), parsed_cli_1.parsedCli['out-dir'])
|
||||
: path_1.default.join(remotionRoot, 'build');
|
||||
const gitignoreFolder = bundler_1.BundlerInternals.findClosestFolderWithItem(outputPath, '.gitignore');
|
||||
const existed = (0, fs_1.existsSync)(outputPath);
|
||||
if (existed) {
|
||||
const existsIndexHtml = (0, fs_1.existsSync)(path_1.default.join(outputPath, 'index.html'));
|
||||
const isEmpty = (0, fs_1.readdirSync)(outputPath).length === 0;
|
||||
if (!existsIndexHtml && !isEmpty) {
|
||||
log_1.Log.error({ indent: false, logLevel }, `The folder at ${outputPath} already exists, and needs to be deleted before a new bundle can be created.`);
|
||||
log_1.Log.error({ indent: false, logLevel }, 'However, it does not look like the folder was created by `npx remotion bundle` (no index.html).');
|
||||
log_1.Log.error({ indent: false, logLevel }, 'Aborting to prevent accidental data loss.');
|
||||
process.exit(1);
|
||||
}
|
||||
(0, fs_1.rmSync)(outputPath, { recursive: true });
|
||||
}
|
||||
const gitSource = (0, get_github_repository_1.getGitSource)({ remotionRoot, disableGitSource, logLevel });
|
||||
const output = await (0, setup_cache_1.bundleOnCli)({
|
||||
fullPath: file,
|
||||
logLevel,
|
||||
onDirectoryCreated: () => { },
|
||||
indent: false,
|
||||
quietProgress: updatesDontOverwrite,
|
||||
publicDir,
|
||||
remotionRoot,
|
||||
onProgressCallback: ({ bundling, copying }) => {
|
||||
// Handle floating point inaccuracies
|
||||
if (bundling.progress < 0.99999) {
|
||||
if (updatesDontOverwrite) {
|
||||
log_1.Log.info({ indent: false, logLevel }, `Bundling ${Math.round(bundling.progress * 100)}%`);
|
||||
}
|
||||
}
|
||||
if (copying.doneIn === null) {
|
||||
if (updatesDontOverwrite) {
|
||||
return `Copying public dir ${studio_server_1.StudioServerInternals.formatBytes(copying.bytes)}`;
|
||||
}
|
||||
}
|
||||
},
|
||||
quietFlag: (0, parsed_cli_1.quietFlagProvided)(),
|
||||
outDir: outputPath,
|
||||
gitSource,
|
||||
bufferStateDelayInMilliseconds: null,
|
||||
maxTimelineTracks: null,
|
||||
publicPath,
|
||||
audioLatencyHint,
|
||||
experimentalClientSideRenderingEnabled,
|
||||
askAIEnabled,
|
||||
keyboardShortcutsEnabled,
|
||||
});
|
||||
log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blue(`${existed ? '○' : '+'} ${output}`));
|
||||
if (!gitignoreFolder) {
|
||||
return;
|
||||
}
|
||||
// Non-interactive terminal
|
||||
if (!process.stdout.isTTY) {
|
||||
return;
|
||||
}
|
||||
const gitignorePath = path_1.default.join(gitignoreFolder, '.gitignore');
|
||||
const gitIgnoreContents = (0, fs_1.readFileSync)(gitignorePath, 'utf-8');
|
||||
const relativePathToGitIgnore = path_1.default.relative(gitignoreFolder, outputPath);
|
||||
const isInGitIgnore = gitIgnoreContents
|
||||
.split('\n')
|
||||
.includes(relativePathToGitIgnore);
|
||||
if (isInGitIgnore) {
|
||||
return;
|
||||
}
|
||||
const answer = await (0, yes_or_no_1.yesOrNo)({
|
||||
defaultValue: true,
|
||||
question: `Recommended: Add ${chalk_1.chalk.bold(relativePathToGitIgnore)} to your ${chalk_1.chalk.bold('.gitignore')} file? (Y/n)`,
|
||||
});
|
||||
if (!answer) {
|
||||
return;
|
||||
}
|
||||
const newGitIgnoreContents = gitIgnoreContents + '\n' + relativePathToGitIgnore;
|
||||
(0, fs_1.writeFileSync)(gitignorePath, newGitIgnoreContents);
|
||||
log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.blue(`Added to .gitignore!`));
|
||||
};
|
||||
exports.bundleCommand = bundleCommand;
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
export declare const chalk: {
|
||||
enabled: () => boolean;
|
||||
visible: boolean;
|
||||
styles: Record<string, {
|
||||
codes: [number, number];
|
||||
name: string;
|
||||
wrap?: ((input: string, newline: boolean) => string) | undefined;
|
||||
}>;
|
||||
keys: Record<string, string[]>;
|
||||
alias?: ((name: string, col: string) => void) | undefined;
|
||||
} & {
|
||||
reset: (str: string) => string;
|
||||
bold: (str: string) => string;
|
||||
dim: (str: string) => string;
|
||||
italic: (str: string) => string;
|
||||
underline: (str: string) => string;
|
||||
inverse: (str: string) => string;
|
||||
hidden: (str: string) => string;
|
||||
strikethrough: (str: string) => string;
|
||||
black: (str: string) => string;
|
||||
red: (str: string) => string;
|
||||
green: (str: string) => string;
|
||||
yellow: (str: string) => string;
|
||||
blue: (str: string) => string;
|
||||
magenta: (str: string) => string;
|
||||
cyan: (str: string) => string;
|
||||
white: (str: string) => string;
|
||||
gray: (str: string) => string;
|
||||
bgBlack: (str: string) => string;
|
||||
bgRed: (str: string) => string;
|
||||
bgGreen: (str: string) => string;
|
||||
bgYellow: (str: string) => string;
|
||||
bgBlue: (str: string) => string;
|
||||
bgMagenta: (str: string) => string;
|
||||
bgWhite: (str: string) => string;
|
||||
blackBright: (str: string) => string;
|
||||
redBright: (str: string) => string;
|
||||
greenBright: (str: string) => string;
|
||||
yellowBright: (str: string) => string;
|
||||
blueBright: (str: string) => string;
|
||||
magentaBright: (str: string) => string;
|
||||
whiteBright: (str: string) => string;
|
||||
bgBlackBright: (str: string) => string;
|
||||
bgRedBright: (str: string) => string;
|
||||
bgGreenBright: (str: string) => string;
|
||||
bgYellowBright: (str: string) => string;
|
||||
bgBlueBright: (str: string) => string;
|
||||
bgMagentaBright: (str: string) => string;
|
||||
bgWhiteBright: (str: string) => string;
|
||||
};
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.chalk = void 0;
|
||||
const renderer_1 = require("@remotion/renderer");
|
||||
exports.chalk = renderer_1.RenderInternals.chalk;
|
||||
Generated
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
import type { LogLevel } from '@remotion/renderer';
|
||||
export declare const checkForNpmRunFlagPass: ({ indent, logLevel, }: {
|
||||
indent: boolean;
|
||||
logLevel: LogLevel;
|
||||
}) => void;
|
||||
Generated
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
// If someone passes --log=verbose to npm run render
|
||||
// We don't receive it.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.checkForNpmRunFlagPass = void 0;
|
||||
const log_1 = require("./log");
|
||||
const checkForNpmRunFlagPass = ({ indent, logLevel, }) => {
|
||||
if (!process.env.npm_config_log) {
|
||||
return;
|
||||
}
|
||||
log_1.Log.error({ indent, logLevel }, `The environment variable "npm_config_log" is set to "${process.env.npm_config_log}".`);
|
||||
log_1.Log.error({ indent, logLevel }, `This indicates a likely mistake:`);
|
||||
log_1.Log.error({
|
||||
indent,
|
||||
logLevel,
|
||||
}, `--log gets passed to the npm command, however npm has no "log" configuration option.`);
|
||||
log_1.Log.error({
|
||||
indent,
|
||||
logLevel,
|
||||
}, `You most likely wanted to pass --log to the Remotion CLI.`);
|
||||
log_1.Log.error({
|
||||
indent,
|
||||
logLevel,
|
||||
}, `However, arguments passed to "npm run" don't get received by the script, in this case Remotion.`);
|
||||
log_1.Log.error({
|
||||
indent,
|
||||
logLevel,
|
||||
}, `Edit the npm script and pass Remotion flags to "remotion" command instead. Example:`);
|
||||
log_1.Log.error({
|
||||
indent,
|
||||
logLevel,
|
||||
});
|
||||
log_1.Log.error({
|
||||
indent,
|
||||
logLevel,
|
||||
}, ` "render": "remotion render --log=verbose"`);
|
||||
log_1.Log.error({
|
||||
indent,
|
||||
logLevel,
|
||||
});
|
||||
process.exit(1);
|
||||
};
|
||||
exports.checkForNpmRunFlagPass = checkForNpmRunFlagPass;
|
||||
Generated
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
import type { LogLevel } from '@remotion/renderer';
|
||||
export declare const cleanupBeforeQuit: ({ indent, logLevel, }: {
|
||||
indent: boolean;
|
||||
logLevel: LogLevel;
|
||||
}) => void;
|
||||
export declare const registerCleanupJob: (label: string, job: () => void) => void;
|
||||
export declare const handleCtrlC: ({ indent, logLevel, }: {
|
||||
indent: boolean;
|
||||
logLevel: LogLevel;
|
||||
}) => void;
|
||||
Generated
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.handleCtrlC = exports.registerCleanupJob = exports.cleanupBeforeQuit = void 0;
|
||||
const log_1 = require("./log");
|
||||
const cleanupJobs = [];
|
||||
const cleanupBeforeQuit = ({ indent, logLevel, }) => {
|
||||
log_1.Log.verbose({ indent, logLevel }, 'Cleaning up...');
|
||||
const time = Date.now();
|
||||
for (const job of cleanupJobs) {
|
||||
job.job();
|
||||
log_1.Log.verbose({ indent, logLevel }, `Cleanup job "${job.label}" done`);
|
||||
}
|
||||
log_1.Log.verbose({ indent, logLevel }, `Cleanup done in ${Date.now() - time}ms`);
|
||||
};
|
||||
exports.cleanupBeforeQuit = cleanupBeforeQuit;
|
||||
const registerCleanupJob = (label, job) => {
|
||||
cleanupJobs.push({ job, label });
|
||||
};
|
||||
exports.registerCleanupJob = registerCleanupJob;
|
||||
const handleCtrlC = ({ indent, logLevel, }) => {
|
||||
process.on('SIGINT', () => {
|
||||
log_1.Log.info({ indent: false, logLevel });
|
||||
(0, exports.cleanupBeforeQuit)({ indent, logLevel });
|
||||
process.exit(0);
|
||||
});
|
||||
};
|
||||
exports.handleCtrlC = handleCtrlC;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
import type { LogLevel } from '@remotion/renderer';
|
||||
export declare const cloudrunCommand: (remotionRoot: string, args: string[], logLevel: LogLevel) => Promise<never>;
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.cloudrunCommand = void 0;
|
||||
const studio_server_1 = require("@remotion/studio-server");
|
||||
const log_1 = require("./log");
|
||||
const cloudrunCommand = async (remotionRoot, args, logLevel) => {
|
||||
try {
|
||||
const path = require.resolve('@remotion/cloudrun', {
|
||||
paths: [remotionRoot],
|
||||
});
|
||||
const { CloudrunInternals } = require(path);
|
||||
await CloudrunInternals.executeCommand(args, remotionRoot, logLevel);
|
||||
process.exit(0);
|
||||
}
|
||||
catch (err) {
|
||||
const manager = studio_server_1.StudioServerInternals.getPackageManager({
|
||||
remotionRoot,
|
||||
packageManager: undefined,
|
||||
dirUp: 0,
|
||||
logLevel,
|
||||
});
|
||||
const installCommand = manager === 'unknown' ? 'npm i' : manager.installCommand;
|
||||
log_1.Log.error({ indent: false, logLevel }, err);
|
||||
log_1.Log.error({ indent: false, logLevel }, 'Remotion Cloud Run is not installed.');
|
||||
log_1.Log.info({ indent: false, logLevel }, '');
|
||||
log_1.Log.info({ indent: false, logLevel }, 'You can install it using:');
|
||||
log_1.Log.info({ indent: false, logLevel }, `${installCommand} @remotion/cloudrun@${studio_server_1.StudioServerInternals.getRemotionVersion()}`);
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
||||
exports.cloudrunCommand = cloudrunCommand;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import type { ErrorWithStackFrame, LogLevel } from '@remotion/renderer';
|
||||
export declare const printCodeFrameAndStack: ({ symbolicated, logLevel, }: {
|
||||
symbolicated: ErrorWithStackFrame;
|
||||
logLevel: LogLevel;
|
||||
}) => void;
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.printCodeFrameAndStack = void 0;
|
||||
const chalk_1 = require("./chalk");
|
||||
const log_1 = require("./log");
|
||||
const truthy_1 = require("./truthy");
|
||||
const makeFileName = (firstFrame) => {
|
||||
return [
|
||||
firstFrame.originalFileName,
|
||||
firstFrame.originalLineNumber,
|
||||
firstFrame.originalColumnNumber === 0
|
||||
? null
|
||||
: firstFrame.originalColumnNumber,
|
||||
]
|
||||
.filter(truthy_1.truthy)
|
||||
.join(':');
|
||||
};
|
||||
const printCodeFrame = (frame, logLevel) => {
|
||||
if (!frame.originalScriptCode) {
|
||||
return;
|
||||
}
|
||||
log_1.Log.info({ indent: false, logLevel });
|
||||
const longestLineNumber = Math.max(...frame.originalScriptCode.map((script) => script.lineNumber)).toString().length;
|
||||
log_1.Log.info({ indent: false, logLevel }, 'at', chalk_1.chalk.underline(makeFileName(frame)));
|
||||
const alignLeftAmount = Math.min(...frame.originalScriptCode.map((c) => c.content.length - c.content.trimStart().length));
|
||||
log_1.Log.info({ indent: false, logLevel }, `${frame.originalScriptCode
|
||||
.map((c) => {
|
||||
const left = String(c.lineNumber).padStart(longestLineNumber, ' ');
|
||||
const right = c.content.substring(alignLeftAmount);
|
||||
if (c.highlight) {
|
||||
return `${left} │ ${right}`;
|
||||
}
|
||||
return `${chalk_1.chalk.gray(left)} │ ${chalk_1.chalk.gray(right)}`;
|
||||
})
|
||||
.join('\n')}`);
|
||||
};
|
||||
const logLine = (frame, logLevel) => {
|
||||
const fileName = makeFileName(frame);
|
||||
if (!fileName) {
|
||||
return;
|
||||
}
|
||||
log_1.Log.info({ indent: false, logLevel }, chalk_1.chalk.gray(['at', frame.originalFunctionName, `${chalk_1.chalk.blueBright(`(${fileName})`)}`]
|
||||
.filter(truthy_1.truthy)
|
||||
.join(' ')));
|
||||
};
|
||||
const printCodeFrameAndStack = ({ symbolicated, logLevel, }) => {
|
||||
var _a, _b, _c, _d, _e;
|
||||
if (!symbolicated.symbolicatedStackFrames ||
|
||||
symbolicated.symbolicatedStackFrames.length === 0) {
|
||||
log_1.Log.error({ indent: false, logLevel }, symbolicated.stack);
|
||||
return;
|
||||
}
|
||||
const firstFrame = symbolicated.symbolicatedStackFrames[0];
|
||||
log_1.Log.error({ indent: false, logLevel }, chalk_1.chalk.bgRed(chalk_1.chalk.white(` ${symbolicated.name} `)), symbolicated.message);
|
||||
printCodeFrame(firstFrame, logLevel);
|
||||
log_1.Log.info({ indent: false, logLevel });
|
||||
for (const frame of symbolicated.symbolicatedStackFrames) {
|
||||
if (frame === firstFrame) {
|
||||
continue;
|
||||
}
|
||||
const isUserCode = !((_a = frame.originalFileName) === null || _a === void 0 ? void 0 : _a.includes('node_modules')) &&
|
||||
!((_b = frame.originalFileName) === null || _b === void 0 ? void 0 : _b.startsWith('webpack/'));
|
||||
if (isUserCode) {
|
||||
printCodeFrame(frame, logLevel);
|
||||
}
|
||||
else {
|
||||
logLine(frame, logLevel);
|
||||
}
|
||||
}
|
||||
if (symbolicated.delayRenderCall) {
|
||||
log_1.Log.error({ indent: false, logLevel });
|
||||
log_1.Log.error({ indent: false, logLevel }, '🕧 The delayRender() call is located at:');
|
||||
for (const frame of symbolicated.delayRenderCall) {
|
||||
const showCodeFrame = (!((_c = frame.originalFileName) === null || _c === void 0 ? void 0 : _c.includes('node_modules')) &&
|
||||
!((_d = frame.originalFileName) === null || _d === void 0 ? void 0 : _d.startsWith('webpack/'))) ||
|
||||
frame === symbolicated.delayRenderCall[0] ||
|
||||
((_e = frame.originalScriptCode) === null || _e === void 0 ? void 0 : _e.map((c) => c.content).join('').includes('delayRender'));
|
||||
if (showCodeFrame) {
|
||||
printCodeFrame(frame, logLevel);
|
||||
}
|
||||
else {
|
||||
logLine(frame, logLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.printCodeFrameAndStack = printCodeFrameAndStack;
|
||||
Generated
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
import type { LogLevel } from '@remotion/renderer';
|
||||
import type { PromptObject } from 'prompts';
|
||||
type Question<V extends string = string> = PromptObject<V> & {
|
||||
optionsPerPage?: number;
|
||||
};
|
||||
type NamelessQuestion = Omit<Question<'value'>, 'name'>;
|
||||
export declare function selectAsync(question: NamelessQuestion, logLevel: LogLevel): Promise<string | string[]>;
|
||||
export {};
|
||||
Generated
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.selectAsync = selectAsync;
|
||||
const prompts_1 = __importDefault(require("prompts"));
|
||||
const log_1 = require("./log");
|
||||
function prompt(questions, logLevel) {
|
||||
return (0, prompts_1.default)([questions], {
|
||||
onCancel() {
|
||||
log_1.Log.error({ indent: false, logLevel }, 'No composition selected.');
|
||||
process.exit(1);
|
||||
},
|
||||
});
|
||||
}
|
||||
async function selectAsync(question, logLevel) {
|
||||
const { value } = await prompt({
|
||||
...question,
|
||||
name: 'value',
|
||||
type: question.type,
|
||||
}, logLevel);
|
||||
return value !== null && value !== void 0 ? value : null;
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import type { LogLevel } from '@remotion/renderer';
|
||||
export declare const listCompositionsCommand: (remotionRoot: string, args: string[], logLevel: LogLevel) => Promise<void>;
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.listCompositionsCommand = void 0;
|
||||
const renderer_1 = require("@remotion/renderer");
|
||||
const client_1 = require("@remotion/renderer/client");
|
||||
const no_react_1 = require("remotion/no-react");
|
||||
const browser_download_bar_1 = require("./browser-download-bar");
|
||||
const cleanup_before_quit_1 = require("./cleanup-before-quit");
|
||||
const preview_server_1 = require("./config/preview-server");
|
||||
const entry_point_1 = require("./entry-point");
|
||||
const get_cli_options_1 = require("./get-cli-options");
|
||||
const log_1 = require("./log");
|
||||
const parsed_cli_1 = require("./parsed-cli");
|
||||
const print_compositions_1 = require("./print-compositions");
|
||||
const setup_cache_1 = require("./setup-cache");
|
||||
const { enableMultiprocessOnLinuxOption, offthreadVideoCacheSizeInBytesOption, offthreadVideoThreadsOption, glOption, headlessOption, delayRenderTimeoutInMillisecondsOption, binariesDirectoryOption, publicPathOption, publicDirOption, chromeModeOption, audioLatencyHintOption, mediaCacheSizeInBytesOption, darkModeOption, askAIOption, experimentalClientSideRenderingOption, keyboardShortcutsOption, } = client_1.BrowserSafeApis.options;
|
||||
const listCompositionsCommand = async (remotionRoot, args, logLevel) => {
|
||||
const { file, reason } = (0, entry_point_1.findEntryPoint)({
|
||||
args,
|
||||
remotionRoot,
|
||||
logLevel,
|
||||
allowDirectory: true,
|
||||
});
|
||||
if (!file) {
|
||||
log_1.Log.error({ indent: false, logLevel }, 'The `compositions` command requires you to specify a entry point. For example');
|
||||
log_1.Log.error({ indent: false, logLevel }, ' npx remotion compositions src/index.ts');
|
||||
log_1.Log.error({ indent: false, logLevel }, 'See https://www.remotion.dev/docs/register-root for more information.');
|
||||
process.exit(1);
|
||||
}
|
||||
log_1.Log.verbose({ indent: false, logLevel }, 'Entry point:', file, 'reason:', reason);
|
||||
const { browserExecutable, envVariables, inputProps, ignoreCertificateErrors, userAgent, disableWebSecurity, } = (0, get_cli_options_1.getCliOptions)({
|
||||
isStill: false,
|
||||
logLevel,
|
||||
indent: false,
|
||||
});
|
||||
const publicPath = publicPathOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const timeoutInMilliseconds = delayRenderTimeoutInMillisecondsOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const binariesDirectory = binariesDirectoryOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const darkMode = darkModeOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const offthreadVideoCacheSizeInBytes = offthreadVideoCacheSizeInBytesOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const offthreadVideoThreads = offthreadVideoThreadsOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const publicDir = publicDirOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const chromeMode = chromeModeOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const audioLatencyHint = audioLatencyHintOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const mediaCacheSizeInBytes = mediaCacheSizeInBytesOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const askAIEnabled = askAIOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value;
|
||||
const chromiumOptions = {
|
||||
disableWebSecurity,
|
||||
enableMultiProcessOnLinux: enableMultiprocessOnLinuxOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value,
|
||||
gl: glOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value,
|
||||
headless: headlessOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value,
|
||||
ignoreCertificateErrors,
|
||||
userAgent,
|
||||
darkMode,
|
||||
};
|
||||
const experimentalClientSideRenderingEnabled = experimentalClientSideRenderingOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
}).value;
|
||||
if (experimentalClientSideRenderingEnabled) {
|
||||
log_1.Log.warn({ indent: false, logLevel }, 'Enabling WIP client-side rendering. Please see caveats on https://www.remotion.dev/docs/client-side-rendering/.');
|
||||
}
|
||||
const { urlOrBundle: bundled, cleanup: cleanupBundle } = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({
|
||||
remotionRoot,
|
||||
fullPath: file,
|
||||
publicDir,
|
||||
onProgress: () => undefined,
|
||||
indentOutput: false,
|
||||
logLevel,
|
||||
onDirectoryCreated: (dir) => {
|
||||
(0, cleanup_before_quit_1.registerCleanupJob)(`Delete ${dir}`, () => renderer_1.RenderInternals.deleteDirectory(dir));
|
||||
},
|
||||
quietProgress: false,
|
||||
quietFlag: (0, parsed_cli_1.quietFlagProvided)(),
|
||||
outDir: null,
|
||||
// Not needed for compositions
|
||||
gitSource: null,
|
||||
bufferStateDelayInMilliseconds: null,
|
||||
maxTimelineTracks: null,
|
||||
publicPath,
|
||||
audioLatencyHint,
|
||||
experimentalClientSideRenderingEnabled,
|
||||
askAIEnabled,
|
||||
keyboardShortcutsEnabled,
|
||||
});
|
||||
(0, cleanup_before_quit_1.registerCleanupJob)(`Cleanup bundle`, () => cleanupBundle());
|
||||
const compositions = await renderer_1.RenderInternals.internalGetCompositions({
|
||||
serveUrlOrWebpackUrl: bundled,
|
||||
browserExecutable,
|
||||
chromiumOptions,
|
||||
envVariables,
|
||||
serializedInputPropsWithCustomSchema: no_react_1.NoReactInternals.serializeJSONWithSpecialTypes({
|
||||
data: inputProps,
|
||||
staticBase: null,
|
||||
indent: undefined,
|
||||
}).serializedString,
|
||||
timeoutInMilliseconds,
|
||||
port: (0, preview_server_1.getRendererPortFromConfigFileAndCliFlag)(),
|
||||
indent: false,
|
||||
onBrowserLog: null,
|
||||
puppeteerInstance: undefined,
|
||||
logLevel,
|
||||
server: undefined,
|
||||
offthreadVideoCacheSizeInBytes,
|
||||
offthreadVideoThreads,
|
||||
binariesDirectory,
|
||||
onBrowserDownload: (0, browser_download_bar_1.defaultBrowserDownloadProgress)({
|
||||
indent: false,
|
||||
logLevel,
|
||||
quiet: (0, parsed_cli_1.quietFlagProvided)(),
|
||||
onProgress: () => undefined,
|
||||
}),
|
||||
chromeMode,
|
||||
mediaCacheSizeInBytes,
|
||||
onLog: renderer_1.RenderInternals.defaultOnLog,
|
||||
});
|
||||
(0, print_compositions_1.printCompositions)(compositions, logLevel);
|
||||
};
|
||||
exports.listCompositionsCommand = listCompositionsCommand;
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
import type { BrowserExecutable } from '@remotion/renderer';
|
||||
export declare const setBrowserExecutable: (newBrowserExecutablePath: BrowserExecutable) => void;
|
||||
export declare const getBrowserExecutable: () => BrowserExecutable;
|
||||
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getBrowserExecutable = exports.setBrowserExecutable = void 0;
|
||||
let currentBrowserExecutablePath = null;
|
||||
const setBrowserExecutable = (newBrowserExecutablePath) => {
|
||||
currentBrowserExecutablePath = newBrowserExecutablePath;
|
||||
};
|
||||
exports.setBrowserExecutable = setBrowserExecutable;
|
||||
const getBrowserExecutable = () => {
|
||||
return currentBrowserExecutablePath;
|
||||
};
|
||||
exports.getBrowserExecutable = getBrowserExecutable;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare const getBrowser: () => null;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getBrowser = void 0;
|
||||
const currentBrowser = null;
|
||||
const getBrowser = () => {
|
||||
return currentBrowser;
|
||||
};
|
||||
exports.getBrowser = getBrowser;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare const getBufferStateDelayInMilliseconds: () => number | null;
|
||||
export declare const setBufferStateDelayInMilliseconds: (val: number | null) => void;
|
||||
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.setBufferStateDelayInMilliseconds = exports.getBufferStateDelayInMilliseconds = void 0;
|
||||
let value = null;
|
||||
const getBufferStateDelayInMilliseconds = () => {
|
||||
return value;
|
||||
};
|
||||
exports.getBufferStateDelayInMilliseconds = getBufferStateDelayInMilliseconds;
|
||||
const setBufferStateDelayInMilliseconds = (val) => {
|
||||
value = val;
|
||||
};
|
||||
exports.setBufferStateDelayInMilliseconds = setBufferStateDelayInMilliseconds;
|
||||
Generated
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
export declare const getChromiumDisableWebSecurity: () => boolean;
|
||||
export declare const setChromiumDisableWebSecurity: (should: boolean) => void;
|
||||
export declare const getIgnoreCertificateErrors: () => boolean;
|
||||
export declare const setChromiumIgnoreCertificateErrors: (should: boolean) => void;
|
||||
Generated
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.setChromiumIgnoreCertificateErrors = exports.getIgnoreCertificateErrors = exports.setChromiumDisableWebSecurity = exports.getChromiumDisableWebSecurity = void 0;
|
||||
let chromiumDisableWebSecurity = false;
|
||||
let ignoreCertificateErrors = false;
|
||||
const getChromiumDisableWebSecurity = () => chromiumDisableWebSecurity;
|
||||
exports.getChromiumDisableWebSecurity = getChromiumDisableWebSecurity;
|
||||
const setChromiumDisableWebSecurity = (should) => {
|
||||
chromiumDisableWebSecurity = should;
|
||||
};
|
||||
exports.setChromiumDisableWebSecurity = setChromiumDisableWebSecurity;
|
||||
const getIgnoreCertificateErrors = () => ignoreCertificateErrors;
|
||||
exports.getIgnoreCertificateErrors = getIgnoreCertificateErrors;
|
||||
const setChromiumIgnoreCertificateErrors = (should) => {
|
||||
ignoreCertificateErrors = should;
|
||||
};
|
||||
exports.setChromiumIgnoreCertificateErrors = setChromiumIgnoreCertificateErrors;
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
export type Concurrency = number | string | null;
|
||||
export declare const setConcurrency: (newConcurrency: Concurrency) => void;
|
||||
export declare const getConcurrency: () => string | number | null;
|
||||
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getConcurrency = exports.setConcurrency = void 0;
|
||||
let currentConcurrency = null;
|
||||
const setConcurrency = (newConcurrency) => {
|
||||
currentConcurrency = newConcurrency;
|
||||
};
|
||||
exports.setConcurrency = setConcurrency;
|
||||
const getConcurrency = () => {
|
||||
return currentConcurrency;
|
||||
};
|
||||
exports.getConcurrency = getConcurrency;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare const setEntryPoint: (ep: string) => void;
|
||||
export declare const getEntryPoint: () => string | null;
|
||||
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getEntryPoint = exports.setEntryPoint = void 0;
|
||||
let entryPoint = null;
|
||||
const setEntryPoint = (ep) => {
|
||||
entryPoint = ep;
|
||||
};
|
||||
exports.setEntryPoint = setEntryPoint;
|
||||
const getEntryPoint = () => {
|
||||
return entryPoint;
|
||||
};
|
||||
exports.getEntryPoint = getEntryPoint;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare const setDotEnvLocation: (file: string) => void;
|
||||
export declare const getDotEnvLocation: () => string | null;
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getDotEnvLocation = exports.setDotEnvLocation = void 0;
|
||||
let envFile = null;
|
||||
const setDotEnvLocation = (file) => {
|
||||
envFile = file;
|
||||
};
|
||||
exports.setDotEnvLocation = setDotEnvLocation;
|
||||
const getDotEnvLocation = () => envFile;
|
||||
exports.getDotEnvLocation = getDotEnvLocation;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare const setEveryNthFrame: (frame: number) => void;
|
||||
export declare const getEveryNthFrame: () => number;
|
||||
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getEveryNthFrame = exports.setEveryNthFrame = void 0;
|
||||
let everyNthFrame = 1;
|
||||
const setEveryNthFrame = (frame) => {
|
||||
everyNthFrame = frame;
|
||||
};
|
||||
exports.setEveryNthFrame = setEveryNthFrame;
|
||||
const getEveryNthFrame = () => {
|
||||
return everyNthFrame;
|
||||
};
|
||||
exports.getEveryNthFrame = getEveryNthFrame;
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
import type { FfmpegOverrideFn } from '@remotion/renderer';
|
||||
export declare const setFfmpegOverrideFunction: (fn: FfmpegOverrideFn) => void;
|
||||
export declare const getFfmpegOverrideFunction: () => FfmpegOverrideFn;
|
||||
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getFfmpegOverrideFunction = exports.setFfmpegOverrideFunction = void 0;
|
||||
let ffmpegOverrideFn = ({ args }) => args;
|
||||
const setFfmpegOverrideFunction = (fn) => {
|
||||
ffmpegOverrideFn = fn;
|
||||
};
|
||||
exports.setFfmpegOverrideFunction = setFfmpegOverrideFunction;
|
||||
const getFfmpegOverrideFunction = () => {
|
||||
return ffmpegOverrideFn;
|
||||
};
|
||||
exports.getFfmpegOverrideFunction = getFfmpegOverrideFunction;
|
||||
Generated
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
import type { FrameRange } from '@remotion/renderer';
|
||||
export declare const setFrameRange: (newFrameRange: FrameRange | null) => void;
|
||||
export declare const setFrameRangeFromCli: (newFrameRange: string | number) => void;
|
||||
export declare const getRange: () => FrameRange | null;
|
||||
Generated
Vendored
+61
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRange = exports.setFrameRangeFromCli = exports.setFrameRange = void 0;
|
||||
const renderer_1 = require("@remotion/renderer");
|
||||
let range = null;
|
||||
const setFrameRange = (newFrameRange) => {
|
||||
renderer_1.RenderInternals.validateFrameRange(newFrameRange);
|
||||
range = newFrameRange;
|
||||
};
|
||||
exports.setFrameRange = setFrameRange;
|
||||
const setFrameRangeFromCli = (newFrameRange) => {
|
||||
if (typeof newFrameRange === 'number') {
|
||||
if (newFrameRange < 0) {
|
||||
(0, exports.setFrameRange)([0, Math.abs(newFrameRange)]);
|
||||
return;
|
||||
}
|
||||
(0, exports.setFrameRange)(newFrameRange);
|
||||
range = newFrameRange;
|
||||
return;
|
||||
}
|
||||
if (typeof newFrameRange === 'string') {
|
||||
if (newFrameRange.trim() === '') {
|
||||
throw new Error('--frames flag must be a single number, or 2 numbers separated by `-`');
|
||||
}
|
||||
const parts = newFrameRange.split('-');
|
||||
if (parts.length > 2 || parts.length <= 0) {
|
||||
throw new Error(`--frames flag must be a number or 2 numbers separated by '-', instead got ${parts.length} numbers`);
|
||||
}
|
||||
if (parts.length === 1) {
|
||||
const value = Number(parts[0]);
|
||||
if (isNaN(value)) {
|
||||
throw new Error('--frames flag must be a single number, or 2 numbers separated by `-`');
|
||||
}
|
||||
(0, exports.setFrameRange)(value);
|
||||
return;
|
||||
}
|
||||
const [firstPart, secondPart] = parts;
|
||||
if (secondPart === '' && firstPart !== '') {
|
||||
const start = Number(firstPart);
|
||||
if (isNaN(start)) {
|
||||
throw new Error('--frames flag must be a single number, or 2 numbers separated by `-`');
|
||||
}
|
||||
(0, exports.setFrameRange)([start, null]);
|
||||
return;
|
||||
}
|
||||
const parsed = parts.map((f) => Number(f));
|
||||
const [first, second] = parsed;
|
||||
for (const value of parsed) {
|
||||
if (isNaN(value)) {
|
||||
throw new Error('--frames flag must be a single number, or 2 numbers separated by `-`');
|
||||
}
|
||||
}
|
||||
if (second < first) {
|
||||
throw new Error('The second number of the --frames flag number should be greater or equal than first number');
|
||||
}
|
||||
(0, exports.setFrameRange)([first, second]);
|
||||
}
|
||||
};
|
||||
exports.setFrameRangeFromCli = setFrameRangeFromCli;
|
||||
const getRange = () => range;
|
||||
exports.getRange = getRange;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export declare const overrideHeight: (newHeight: number) => void;
|
||||
export declare const getHeight: () => number | null;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getHeight = exports.overrideHeight = void 0;
|
||||
const validate_1 = require("../validate");
|
||||
let specifiedHeight;
|
||||
const overrideHeight = (newHeight) => {
|
||||
(0, validate_1.validateDimension)(newHeight, 'height', 'passed to `overrideHeight()`');
|
||||
specifiedHeight = newHeight;
|
||||
};
|
||||
exports.overrideHeight = overrideHeight;
|
||||
const getHeight = () => {
|
||||
return specifiedHeight;
|
||||
};
|
||||
exports.getHeight = getHeight;
|
||||
Generated
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
import type { StillImageFormat, VideoImageFormat } from '@remotion/renderer';
|
||||
export declare const setStillImageFormat: (format: StillImageFormat) => void;
|
||||
export declare const setVideoImageFormat: (format: VideoImageFormat) => void;
|
||||
export declare const getUserPreferredStillImageFormat: () => "png" | "jpeg" | "pdf" | "webp" | undefined;
|
||||
export declare const getUserPreferredVideoImageFormat: () => "png" | "jpeg" | "none" | undefined;
|
||||
Generated
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getUserPreferredVideoImageFormat = exports.getUserPreferredStillImageFormat = exports.setVideoImageFormat = exports.setStillImageFormat = void 0;
|
||||
const renderer_1 = require("@remotion/renderer");
|
||||
const truthy_1 = require("../truthy");
|
||||
let currentStillImageFormat;
|
||||
let currentVideoImageFormat;
|
||||
const setStillImageFormat = (format) => {
|
||||
if (typeof format === 'undefined') {
|
||||
currentStillImageFormat = undefined;
|
||||
return;
|
||||
}
|
||||
if (!renderer_1.RenderInternals.validStillImageFormats.includes(format)) {
|
||||
throw new TypeError([
|
||||
`Value ${format} is not valid as an image format.`,
|
||||
// @ts-expect-error
|
||||
format === 'jpg' ? 'Did you mean "jpeg"?' : null,
|
||||
]
|
||||
.filter(truthy_1.truthy)
|
||||
.join(' '));
|
||||
}
|
||||
currentStillImageFormat = format;
|
||||
};
|
||||
exports.setStillImageFormat = setStillImageFormat;
|
||||
const setVideoImageFormat = (format) => {
|
||||
if (typeof format === 'undefined') {
|
||||
currentVideoImageFormat = undefined;
|
||||
return;
|
||||
}
|
||||
if (!renderer_1.RenderInternals.validVideoImageFormats.includes(format)) {
|
||||
throw new TypeError([
|
||||
`Value ${format} is not valid as a video image format.`,
|
||||
// @ts-expect-error
|
||||
format === 'jpg' ? 'Did you mean "jpeg"?' : null,
|
||||
]
|
||||
.filter(truthy_1.truthy)
|
||||
.join(' '));
|
||||
}
|
||||
currentVideoImageFormat = format;
|
||||
};
|
||||
exports.setVideoImageFormat = setVideoImageFormat;
|
||||
const getUserPreferredStillImageFormat = () => {
|
||||
return currentStillImageFormat;
|
||||
};
|
||||
exports.getUserPreferredStillImageFormat = getUserPreferredStillImageFormat;
|
||||
const getUserPreferredVideoImageFormat = () => {
|
||||
return currentVideoImageFormat;
|
||||
};
|
||||
exports.getUserPreferredVideoImageFormat = getUserPreferredVideoImageFormat;
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
import type { FrameRange } from '@remotion/renderer';
|
||||
export declare const setImageSequence: (newImageSequence: boolean) => void;
|
||||
export declare const getShouldOutputImageSequence: (frameRange: FrameRange | null) => boolean;
|
||||
Generated
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getShouldOutputImageSequence = exports.setImageSequence = void 0;
|
||||
let imageSequence = false;
|
||||
const setImageSequence = (newImageSequence) => {
|
||||
if (typeof newImageSequence !== 'boolean') {
|
||||
throw new TypeError('setImageSequence accepts a Boolean Value');
|
||||
}
|
||||
imageSequence = newImageSequence;
|
||||
};
|
||||
exports.setImageSequence = setImageSequence;
|
||||
const getShouldOutputImageSequence = (frameRange) => {
|
||||
return imageSequence || typeof frameRange === 'number';
|
||||
};
|
||||
exports.getShouldOutputImageSequence = getShouldOutputImageSequence;
|
||||
+445
@@ -0,0 +1,445 @@
|
||||
import type { WebpackConfiguration } from '@remotion/bundler';
|
||||
import type { BrowserExecutable, ChromeMode, CodecOrUndefined, ColorSpace, Crf, DeleteAfter, FrameRange, NumberOfGifLoops, StillImageFormat, VideoImageFormat } from '@remotion/renderer';
|
||||
import type { HardwareAccelerationOption } from '@remotion/renderer/client';
|
||||
import type { Concurrency } from './concurrency';
|
||||
import type { WebpackOverrideFn } from './override-webpack';
|
||||
export type { Concurrency, WebpackConfiguration, WebpackOverrideFn };
|
||||
declare global {
|
||||
interface RemotionBundlingOptions {
|
||||
/**
|
||||
* Specify the entry point so you don't have to specify it in the
|
||||
* CLI command
|
||||
*/
|
||||
readonly setEntryPoint: (src: string) => void;
|
||||
/**
|
||||
* Whether Webpack bundles should be cached to make
|
||||
* subsequent renders faster. Default: true
|
||||
*/
|
||||
readonly setCachingEnabled: (flag: boolean) => void;
|
||||
/**
|
||||
* @deprecated
|
||||
* Use `setStudioPort()` and `setRendererPort()` instead.
|
||||
*/
|
||||
readonly setPort: (port: number | undefined) => void;
|
||||
/**
|
||||
* Set the HTTP port used by the Studio.
|
||||
* By default, Remotion will try to find a free port.
|
||||
* If you specify a port, but it's not available, Remotion will throw an error.
|
||||
*/
|
||||
readonly setStudioPort: (port: number | undefined) => void;
|
||||
/**
|
||||
* Set the HTTP port used to host the Webpack bundle.
|
||||
* By default, Remotion will try to find a free port.
|
||||
* If you specify a port, but it's not available, Remotion will throw an error.
|
||||
*/
|
||||
readonly setRendererPort: (port: number | undefined) => void;
|
||||
/**
|
||||
* Define the location of the public/ directory.
|
||||
* By default it is a folder named "public" inside the current working directory.
|
||||
* You can set an absolute path or a relative path that will be resolved from the closest package.json location.
|
||||
*/
|
||||
readonly setPublicDir: (publicDir: string | null) => void;
|
||||
readonly overrideWebpackConfig: (f: WebpackOverrideFn) => void;
|
||||
}
|
||||
interface RemotionConfigObject {
|
||||
/**
|
||||
* Change the maximum amount of tracks that are shown in the timeline.
|
||||
* @param maxTracks The maximum amount of timeline tracks that you would like to show.
|
||||
* @default 15
|
||||
*/
|
||||
readonly setMaxTimelineTracks: (maxTracks: number) => void;
|
||||
/**
|
||||
* Enable Keyboard shortcuts in the Remotion Studio.
|
||||
* @param enabled Boolean whether to enable the keyboard shortcuts
|
||||
* @default true
|
||||
*/
|
||||
readonly setKeyboardShortcutsEnabled: (enableShortcuts: boolean) => void;
|
||||
/**
|
||||
* Enable WIP client-side rendering in the Remotion Studio.
|
||||
* See https://www.remotion.dev/docs/client-side-rendering/ for notes.
|
||||
* @param enabled Boolean whether to enable client-side rendering
|
||||
* @default false
|
||||
*/
|
||||
readonly setExperimentalClientSideRenderingEnabled: (enabled: boolean) => void;
|
||||
/**
|
||||
* Set number of shared audio tags. https://www.remotion.dev/docs/player/autoplay#using-the-numberofsharedaudiotags-prop
|
||||
* @param numberOfAudioTags
|
||||
* @default 0
|
||||
*/
|
||||
readonly setNumberOfSharedAudioTags: (numberOfAudioTags: number) => void;
|
||||
/**
|
||||
* Enable Webpack polling instead of file system listeners for hot reloading in the Studio.
|
||||
* This is useful if you are using a remote directory or a virtual machine.
|
||||
* @param interval
|
||||
* @default null
|
||||
*/
|
||||
readonly setWebpackPollingInMilliseconds: (interval: number | null) => void;
|
||||
/**
|
||||
* Whether Remotion should open a browser when starting the Studio.
|
||||
* @param should
|
||||
* @default true
|
||||
*/
|
||||
readonly setShouldOpenBrowser: (should: boolean) => void;
|
||||
/**
|
||||
* Set the log level.
|
||||
* Acceptable values: 'error' | 'warning' | 'info' | 'verbose' | 'trace'
|
||||
* Default value: 'info'
|
||||
*
|
||||
* Set this to 'verbose' to get browser logs and other IO.
|
||||
*/
|
||||
readonly setLevel: (newLogLevel: 'trace' | 'verbose' | 'info' | 'warn' | 'error') => void;
|
||||
/**
|
||||
* Specify executable path for the browser to use.
|
||||
* Default: null, which will make Remotion find or download a version of said browser.
|
||||
*/
|
||||
readonly setBrowserExecutable: (newBrowserExecutablePath: BrowserExecutable) => void;
|
||||
/**
|
||||
* Set how many milliseconds a frame may take to render before it times out.
|
||||
* Default: `30000`
|
||||
*/
|
||||
readonly setDelayRenderTimeoutInMilliseconds: (newPuppeteerTimeout: number) => void;
|
||||
/**
|
||||
* @deprecated Renamed to `setDelayRenderTimeoutInMilliseconds`.
|
||||
* Set how many milliseconds a frame may take to render before it times out.
|
||||
* Default: `30000`
|
||||
*/
|
||||
readonly setTimeoutInMilliseconds: (newPuppeteerTimeout: number) => void;
|
||||
/**
|
||||
* Setting deciding whether to disable CORS and other Chrome security features.
|
||||
* Default: false
|
||||
*/
|
||||
readonly setChromiumDisableWebSecurity: (should: boolean) => void;
|
||||
/**
|
||||
* Setting whether to ignore any invalid SSL certificates, such as self-signed ones.
|
||||
* Default: false
|
||||
*/
|
||||
readonly setChromiumIgnoreCertificateErrors: (should: boolean) => void;
|
||||
/**
|
||||
* If false, will open an actual browser during rendering to observe progress.
|
||||
* Default: true
|
||||
*/
|
||||
readonly setChromiumHeadlessMode: (should: boolean) => void;
|
||||
/**
|
||||
* Set whether to use dark mode for Chrome.
|
||||
* Default: false
|
||||
*/
|
||||
readonly setChromiumDarkMode: (should: boolean) => void;
|
||||
/**
|
||||
* Set the OpenGL rendering backend for Chrome. Possible values: 'egl', 'angle', 'swiftshader', 'swangle', 'vulkan' and 'angle-egl'.
|
||||
* Default: 'swangle' in Lambda, null elsewhere.
|
||||
*/
|
||||
readonly setChromiumOpenGlRenderer: (renderer: 'swangle' | 'angle' | 'egl' | 'swiftshader' | 'vulkan' | 'angle-egl') => void;
|
||||
/**
|
||||
* Set the user agent for Chrome. Only works during rendering.
|
||||
* Default is the default user agent for Chrome
|
||||
*/
|
||||
readonly setChromiumUserAgent: (userAgent: string | null) => void;
|
||||
/**
|
||||
* Set a custom location for a .env file.
|
||||
* Default: `.env`
|
||||
*/
|
||||
readonly setDotEnvLocation: (file: string) => void;
|
||||
/**
|
||||
* Sets how many Puppeteer instances will work on rendering your video in parallel.
|
||||
* Default: `null`, meaning half of the threads available on your CPU.
|
||||
*/
|
||||
readonly setConcurrency: (newConcurrency: Concurrency) => void;
|
||||
/**
|
||||
* @deprecated Renamed to `setJpegQuality`.
|
||||
*/
|
||||
readonly setQuality: (q: never) => void;
|
||||
/**
|
||||
* @deprecated Separated into `setStillImageFormat()` and `setVideoImageFormat()`.
|
||||
*/
|
||||
readonly setImageFormat: (q: never) => void;
|
||||
/**
|
||||
* Set the JPEG quality for the frames.
|
||||
* Must be between 0 and 100.
|
||||
* Default: 80
|
||||
*/
|
||||
readonly setJpegQuality: (q: number | undefined) => void;
|
||||
/** Decide the image format for still renders.
|
||||
*/
|
||||
readonly setStillImageFormat: (format: StillImageFormat) => void;
|
||||
/** Decide in which image format to render. Can be either 'jpeg' or 'png'.
|
||||
* PNG is slower, but supports transparency.
|
||||
*/
|
||||
readonly setVideoImageFormat: (format: VideoImageFormat) => void;
|
||||
/**
|
||||
* Render only a subset of a video.
|
||||
* Pass in a tuple [20, 30] to only render frames 20-30 into a video.
|
||||
* Pass in a single number `20` to only render a single frame as an image.
|
||||
* The frame count starts at 0.
|
||||
*/
|
||||
readonly setFrameRange: (newFrameRange: FrameRange | null) => void;
|
||||
/**
|
||||
* Scales the output dimensions by a factor.
|
||||
* Default: 1.
|
||||
*/
|
||||
readonly setScale: (newScale: number) => void;
|
||||
/**
|
||||
* Specify which frames should be picked for rendering a GIF
|
||||
* Default: 1, which means every frame
|
||||
* https://remotion.dev/docs/render-as-gif
|
||||
*/
|
||||
readonly setEveryNthFrame: (frame: number) => void;
|
||||
/**
|
||||
* Specify the number of Loop a GIF should have.
|
||||
* Default: null (means GIF will loop infinite)
|
||||
*/
|
||||
readonly setNumberOfGifLoops: (newLoop: NumberOfGifLoops) => void;
|
||||
/**
|
||||
* Disable audio output.
|
||||
* Default: false
|
||||
*/
|
||||
readonly setMuted: (muted: boolean) => void;
|
||||
/**
|
||||
* Don't render an audio track if it would be silent.
|
||||
* Default: true
|
||||
*/
|
||||
readonly setEnforceAudioTrack: (enforceAudioTrack: boolean) => void;
|
||||
/**
|
||||
* Prepare a video for later seamless audio concatenation.
|
||||
* Default: false
|
||||
*/
|
||||
readonly setForSeamlessAacConcatenation: (forSeamlessAacConcatenation: boolean) => void;
|
||||
/**
|
||||
* Set the output file location string. Default: `out/{composition}.{codec}`
|
||||
*/
|
||||
readonly setOutputLocation: (newOutputLocation: string) => void;
|
||||
/**
|
||||
* If the video file already exists, should Remotion overwrite
|
||||
* the output? Default: true
|
||||
*/
|
||||
readonly setOverwriteOutput: (newOverwrite: boolean) => void;
|
||||
/**
|
||||
* Sets the pixel format in FFmpeg.
|
||||
* See https://trac.ffmpeg.org/wiki/Chroma%20Subsampling for an explanation.
|
||||
* You can override this using the `--pixel-format` Cli flag.
|
||||
*/
|
||||
readonly setPixelFormat: (format: 'yuv420p' | 'yuva420p' | 'yuv422p' | 'yuv444p' | 'yuv420p10le' | 'yuv422p10le' | 'yuv444p10le' | 'yuva444p10le') => void;
|
||||
/**
|
||||
* Specify the codec for stitching the frames into a video.
|
||||
* Can be `h264` (default), `h265`, `vp8` or `vp9`
|
||||
*/
|
||||
readonly setCodec: (newCodec: CodecOrUndefined) => void;
|
||||
/**
|
||||
* Set the Constant Rate Factor to pass to FFmpeg.
|
||||
* Lower values mean better quality, but be aware that the ranges of
|
||||
* possible values greatly differs between codecs.
|
||||
*/
|
||||
readonly setCrf: (newCrf: Crf) => void;
|
||||
/**
|
||||
* Set to true if don't want a video but an image sequence as the output.
|
||||
*/
|
||||
readonly setImageSequence: (newImageSequence: boolean) => void;
|
||||
/**
|
||||
* Overrides the height of a composition
|
||||
*/
|
||||
readonly overrideHeight: (newHeight: number) => void;
|
||||
/**
|
||||
* Overrides the width of a composition
|
||||
*/
|
||||
readonly overrideWidth: (newWidth: number) => void;
|
||||
/**
|
||||
* Set the ProRes profile.
|
||||
* This method is only valid if the codec has been set to 'prores'.
|
||||
* Possible values: 4444-xq, 4444, hq, standard, light, proxy. Default: 'hq'
|
||||
* See https://avpres.net/FFmpeg/im_ProRes.html for meaning of possible values.
|
||||
*/
|
||||
readonly setProResProfile: (profile: '4444-xq' | '4444' | 'hq' | 'standard' | 'light' | 'proxy' | undefined) => void;
|
||||
readonly setX264Preset: (profile: 'ultrafast' | 'superfast' | 'veryfast' | 'faster' | 'fast' | 'medium' | 'slow' | 'slower' | 'veryslow' | 'placebo' | null) => void;
|
||||
/**
|
||||
* Override the arguments that Remotion passes to FFmpeg.
|
||||
* Consult https://remotion.dev/docs/renderer/render-media#ffmpegoverride before using this feature.
|
||||
*/
|
||||
readonly overrideFfmpegCommand: (command: (info: {
|
||||
type: 'pre-stitcher' | 'stitcher';
|
||||
args: string[];
|
||||
}) => string[]) => void;
|
||||
/**
|
||||
* Set a target audio bitrate to be passed to FFmpeg.
|
||||
*/
|
||||
readonly setAudioBitrate: (bitrate: string | null) => void;
|
||||
/**
|
||||
* Set a target video bitrate to be passed to FFmpeg.
|
||||
* Mutually exclusive with setCrf().
|
||||
*/
|
||||
readonly setVideoBitrate: (bitrate: string | null) => void;
|
||||
/**
|
||||
* Set the audio latency hint that the Studio will
|
||||
* use when playing back audio
|
||||
* Default: 'interactive'
|
||||
*/
|
||||
readonly setAudioLatencyHint: (audioLatencyHint: AudioContextLatencyCategory | null) => void;
|
||||
/**
|
||||
* Set a maximum bitrate to be passed to FFmpeg.
|
||||
*/
|
||||
readonly setEncodingMaxRate: (bitrate: string | null) => void;
|
||||
/**
|
||||
* Set a buffer size to be passed to FFmpeg.
|
||||
*/
|
||||
readonly setEncodingBufferSize: (bitrate: string | null) => void;
|
||||
/**
|
||||
* Opt into bt709 rendering.
|
||||
*/
|
||||
readonly setColorSpace: (colorSpace: ColorSpace) => void;
|
||||
/**
|
||||
* Disallows the renderer from doing rendering frames and encoding at the same time.
|
||||
* This makes the rendering process more memory-efficient, but possibly slower.
|
||||
* Default: false
|
||||
*/
|
||||
readonly setDisallowParallelEncoding: (disallowParallelEncoding: boolean) => void;
|
||||
/**
|
||||
* Enables or disables the Ask AI Modal in Studio
|
||||
*/
|
||||
readonly setAskAIEnabled: (askAIEnabled: boolean) => void;
|
||||
/**
|
||||
* Removes the --single-process flag that gets passed to
|
||||
Chromium on Linux by default. This will make the render faster because
|
||||
multiple processes can be used, but may cause issues with some Linux
|
||||
distributions or if window server libraries are missing.
|
||||
*/
|
||||
readonly setChromiumMultiProcessOnLinux: (multiProcessOnLinux: boolean) => void;
|
||||
/**
|
||||
* Whether the Remotion Studio should play a beep sound when a render has finished.
|
||||
*/
|
||||
readonly setBeepOnFinish: (beepOnFinish: boolean) => void;
|
||||
/**
|
||||
* Enable Cross-Site Isolation in the Studio (Sets Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy HTTP headers)
|
||||
*/
|
||||
readonly setEnableCrossSiteIsolation: (enableCrossSiteIsolation: boolean) => void;
|
||||
/**
|
||||
* Collect information that you can submit to Remotion if asked for a reproduction.
|
||||
*/
|
||||
readonly setRepro: (enableRepro: boolean) => void;
|
||||
/**
|
||||
* The directory where the platform-specific binaries and libraries needed
|
||||
for Remotion are located.
|
||||
*/
|
||||
readonly setBinariesDirectory: (directory: string | null) => void;
|
||||
/**
|
||||
* Prefer lossless audio encoding. Default: false
|
||||
*/
|
||||
readonly setPreferLosslessAudio: (lossless: boolean) => void;
|
||||
/**
|
||||
* Prefer lossless audio encoding. Default: false
|
||||
*/
|
||||
readonly setPublicPath: (publicPath: string | null) => void;
|
||||
/**
|
||||
* Set the pattern for naming image sequence files. Supports [frame] and [ext] replacements.
|
||||
* @param pattern The pattern string, e.g. 'frame_[frame].[ext]'.
|
||||
*/
|
||||
readonly setImageSequencePattern: (pattern: string | null) => void;
|
||||
/**
|
||||
* Set the public license key for your company license.
|
||||
* Obtain it from the "Usage" tab on https://remotion.pro
|
||||
* Pass "free-license" if you are eligible for the free license.
|
||||
*/
|
||||
readonly setPublicLicenseKey: (key: string | null) => void;
|
||||
}
|
||||
}
|
||||
type FlatConfig = RemotionConfigObject & RemotionBundlingOptions & {
|
||||
/**
|
||||
* Set the audio codec to use for the output video.
|
||||
* See the Encoding guide in the docs for defaults and available options.
|
||||
*/
|
||||
setAudioCodec: (codec: 'pcm-16' | 'aac' | 'mp3' | 'opus') => void;
|
||||
setOffthreadVideoCacheSizeInBytes: (size: number | null) => void;
|
||||
/**
|
||||
* Forces starting a new Studio instance even if one is already running on the same port for the same project.
|
||||
* Default: false
|
||||
*/
|
||||
setForceNewStudioEnabled: (forceNew: boolean) => void;
|
||||
setDeleteAfter: (day: DeleteAfter | null) => void;
|
||||
/**
|
||||
* Set whether S3 buckets should be allowed to expire.
|
||||
*/
|
||||
setEnableFolderExpiry: (value: boolean | null) => void;
|
||||
/**
|
||||
* Set whether Lambda Insights should be enabled when deploying a function.
|
||||
*/
|
||||
setLambdaInsights: (value: boolean) => void;
|
||||
/**
|
||||
* Set the amount of milliseconds after which the Player in the Studio will display a buffering UI after the Player has entered a buffer state.
|
||||
*/
|
||||
setBufferStateDelayInMilliseconds: (delay: number | null) => void;
|
||||
/**
|
||||
* Metadata to be embedded into the output video file.
|
||||
*/
|
||||
setMetadata: (metadata: Record<string, string>) => void;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
setHardwareAcceleration: (hardwareAccelerationOption: HardwareAccelerationOption) => void;
|
||||
/**
|
||||
* Forces Remotion to bind to an IPv4 interface for the Studio server.
|
||||
* Default: false
|
||||
*/
|
||||
setIPv4: (ipv4: boolean) => void;
|
||||
/**
|
||||
* Choose between using Chrome Headless Shell or Chrome for Testing
|
||||
*/
|
||||
setChromeMode: (chromeMode: ChromeMode) => void;
|
||||
/**
|
||||
* @deprecated 'The config format has changed. Change `Config.Bundling.*()` calls to `Config.*()` in your config file.'
|
||||
*/
|
||||
Bundling: void;
|
||||
/**
|
||||
* @deprecated 'The config format has changed. Change `Config.Preview.*()` calls to `Config.*()` in your config file.'
|
||||
*/
|
||||
Preview: void;
|
||||
/**
|
||||
* @deprecated 'The config format has changed. Change `Config.Log.*()` calls to `Config.*()` in your config file.'
|
||||
*/
|
||||
Log: void;
|
||||
/**
|
||||
* @deprecated 'The config format has changed. Change `Config.Puppeteer.*()` calls to `Config.*()` in your config file.'
|
||||
*/
|
||||
Puppeteer: void;
|
||||
/**
|
||||
* @deprecated 'The config format has changed. Change `Config.Rendering.*()` calls to `Config.*()` in your config file.'
|
||||
*/
|
||||
Rendering: void;
|
||||
/**
|
||||
* @deprecated 'The config format has changed. Change `Config.Output.*()` calls to `Config.*()` in your config file.'
|
||||
*/
|
||||
Output: void;
|
||||
};
|
||||
export declare const Config: FlatConfig;
|
||||
export declare const ConfigInternals: {
|
||||
getRange: () => FrameRange | null;
|
||||
getBrowser: () => null;
|
||||
getPixelFormat: () => "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
||||
getProResProfile: () => import("remotion")._InternalTypes["ProResProfile"] | undefined;
|
||||
getBrowserExecutable: () => BrowserExecutable;
|
||||
getStudioPort: () => number | undefined;
|
||||
getRendererPortFromConfigFile: () => number | null;
|
||||
getRendererPortFromConfigFileAndCliFlag: () => number | null;
|
||||
getChromiumDisableWebSecurity: () => boolean;
|
||||
getIgnoreCertificateErrors: () => boolean;
|
||||
getEveryNthFrame: () => number;
|
||||
getConcurrency: () => string | number | null;
|
||||
getStillFrame: () => number;
|
||||
getShouldOutputImageSequence: (frameRange: FrameRange | null) => boolean;
|
||||
getDotEnvLocation: () => string | null;
|
||||
getUserPreferredStillImageFormat: () => "png" | "jpeg" | "pdf" | "webp" | undefined;
|
||||
getUserPreferredVideoImageFormat: () => "png" | "jpeg" | "none" | undefined;
|
||||
getWebpackOverrideFn: () => WebpackOverrideFn;
|
||||
getWebpackCaching: () => boolean;
|
||||
getOutputLocation: () => string | null;
|
||||
setFrameRangeFromCli: (newFrameRange: string | number) => void;
|
||||
setStillFrame: (frame: number) => void;
|
||||
getMaxTimelineTracks: () => number;
|
||||
defaultOverrideFunction: WebpackOverrideFn;
|
||||
getFfmpegOverrideFunction: () => import("@remotion/renderer").FfmpegOverrideFn;
|
||||
getHeight: () => number | null;
|
||||
getWidth: () => number | null;
|
||||
getMetadata: () => Record<string, string>;
|
||||
getEntryPoint: () => string | null;
|
||||
getWebpackPolling: () => number | null;
|
||||
getShouldOpenBrowser: () => boolean;
|
||||
getChromiumUserAgent: () => string | null;
|
||||
getBufferStateDelayInMilliseconds: () => number | null;
|
||||
getOutputCodecOrUndefined: () => import("@remotion/renderer/dist/codec").CodecOrUndefined;
|
||||
};
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ConfigInternals = exports.Config = void 0;
|
||||
const browser_1 = require("./browser");
|
||||
const browser_executable_1 = require("./browser-executable");
|
||||
const chromium_flags_1 = require("./chromium-flags");
|
||||
const concurrency_1 = require("./concurrency");
|
||||
const env_file_1 = require("./env-file");
|
||||
const frame_range_1 = require("./frame-range");
|
||||
const image_format_1 = require("./image-format");
|
||||
const image_sequence_1 = require("./image-sequence");
|
||||
const output_location_1 = require("./output-location");
|
||||
const override_webpack_1 = require("./override-webpack");
|
||||
const pixel_format_1 = require("./pixel-format");
|
||||
const preview_server_1 = require("./preview-server");
|
||||
const prores_profile_1 = require("./prores-profile");
|
||||
const still_frame_1 = require("./still-frame");
|
||||
const webpack_caching_1 = require("./webpack-caching");
|
||||
const client_1 = require("@remotion/renderer/client");
|
||||
const studio_server_1 = require("@remotion/studio-server");
|
||||
const browser_executable_2 = require("./browser-executable");
|
||||
const buffer_state_delay_in_milliseconds_1 = require("./buffer-state-delay-in-milliseconds");
|
||||
const chromium_flags_2 = require("./chromium-flags");
|
||||
const concurrency_2 = require("./concurrency");
|
||||
const entry_point_1 = require("./entry-point");
|
||||
const env_file_2 = require("./env-file");
|
||||
const every_nth_frame_1 = require("./every-nth-frame");
|
||||
const ffmpeg_override_1 = require("./ffmpeg-override");
|
||||
const frame_range_2 = require("./frame-range");
|
||||
const height_1 = require("./height");
|
||||
const image_sequence_2 = require("./image-sequence");
|
||||
const metadata_1 = require("./metadata");
|
||||
const open_browser_1 = require("./open-browser");
|
||||
const output_location_2 = require("./output-location");
|
||||
const override_webpack_2 = require("./override-webpack");
|
||||
const pixel_format_2 = require("./pixel-format");
|
||||
const preview_server_2 = require("./preview-server");
|
||||
const prores_profile_2 = require("./prores-profile");
|
||||
const user_agent_1 = require("./user-agent");
|
||||
const webpack_caching_2 = require("./webpack-caching");
|
||||
const webpack_poll_1 = require("./webpack-poll");
|
||||
const width_1 = require("./width");
|
||||
const { offthreadVideoCacheSizeInBytesOption, x264Option, audioBitrateOption, videoBitrateOption, scaleOption, crfOption, jpegQualityOption, enforceAudioOption, overwriteOption, chromeModeOption, mutedOption, videoCodecOption, colorSpaceOption, disallowParallelEncodingOption, deleteAfterOption, folderExpiryOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, numberOfGifLoopsOption, beepOnFinishOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, enableLambdaInsights, logLevelOption, delayRenderTimeoutInMillisecondsOption, publicDirOption, binariesDirectoryOption, preferLosslessOption, forSeamlessAacConcatenationOption, audioCodecOption, publicPathOption, hardwareAccelerationOption, audioLatencyHintOption, enableCrossSiteIsolationOption, imageSequencePatternOption, darkModeOption, askAIOption, publicLicenseKeyOption, experimentalClientSideRenderingOption, keyboardShortcutsOption, forceNewStudioOption, numberOfSharedAudioTagsOption, ipv4Option, } = client_1.BrowserSafeApis.options;
|
||||
exports.Config = {
|
||||
get Bundling() {
|
||||
throw new Error('The config format has changed. Change `Config.Bundling.*()` calls to `Config.*()` in your config file.');
|
||||
},
|
||||
get Rendering() {
|
||||
throw new Error('The config format has changed. Change `Config.Rendering.*()` calls to `Config.*()` in your config file.');
|
||||
},
|
||||
get Output() {
|
||||
throw new Error('The config format has changed. Change `Config.Output.*()` calls to `Config.*()` in your config file.');
|
||||
},
|
||||
get Log() {
|
||||
throw new Error('The config format has changed. Change `Config.Log.*()` calls to `Config.*()` in your config file.');
|
||||
},
|
||||
get Preview() {
|
||||
throw new Error('The config format has changed. Change `Config.Preview.*()` calls to `Config.*()` in your config file.');
|
||||
},
|
||||
get Puppeteer() {
|
||||
throw new Error('The config format has changed. Change `Config.Puppeteer.*()` calls to `Config.*()` in your config file.');
|
||||
},
|
||||
setMaxTimelineTracks: studio_server_1.StudioServerInternals.setMaxTimelineTracks,
|
||||
setKeyboardShortcutsEnabled: keyboardShortcutsOption.setConfig,
|
||||
setExperimentalClientSideRenderingEnabled: experimentalClientSideRenderingOption.setConfig,
|
||||
setNumberOfSharedAudioTags: numberOfSharedAudioTagsOption.setConfig,
|
||||
setWebpackPollingInMilliseconds: webpack_poll_1.setWebpackPollingInMilliseconds,
|
||||
setShouldOpenBrowser: open_browser_1.setShouldOpenBrowser,
|
||||
setBufferStateDelayInMilliseconds: buffer_state_delay_in_milliseconds_1.setBufferStateDelayInMilliseconds,
|
||||
overrideWebpackConfig: override_webpack_2.overrideWebpackConfig,
|
||||
setCachingEnabled: webpack_caching_2.setWebpackCaching,
|
||||
setPort: preview_server_2.setPort,
|
||||
setStudioPort: preview_server_2.setStudioPort,
|
||||
setRendererPort: preview_server_2.setRendererPort,
|
||||
setPublicDir: publicDirOption.setConfig,
|
||||
setEntryPoint: entry_point_1.setEntryPoint,
|
||||
setLevel: logLevelOption.setConfig,
|
||||
setBrowserExecutable: browser_executable_2.setBrowserExecutable,
|
||||
setTimeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption.setConfig,
|
||||
setDelayRenderTimeoutInMilliseconds: delayRenderTimeoutInMillisecondsOption.setConfig,
|
||||
setChromiumDisableWebSecurity: chromium_flags_2.setChromiumDisableWebSecurity,
|
||||
setChromiumIgnoreCertificateErrors: chromium_flags_2.setChromiumIgnoreCertificateErrors,
|
||||
setChromiumHeadlessMode: headlessOption.setConfig,
|
||||
setChromiumOpenGlRenderer: glOption.setConfig,
|
||||
setChromiumUserAgent: user_agent_1.setChromiumUserAgent,
|
||||
setDotEnvLocation: env_file_2.setDotEnvLocation,
|
||||
setConcurrency: concurrency_2.setConcurrency,
|
||||
setChromiumMultiProcessOnLinux: enableMultiprocessOnLinuxOption.setConfig,
|
||||
setChromiumDarkMode: darkModeOption.setConfig,
|
||||
setQuality: () => {
|
||||
throw new Error('setQuality() has been renamed - use setJpegQuality() instead.');
|
||||
},
|
||||
setImageFormat: () => {
|
||||
throw new Error('Config.setImageFormat() has been renamed - use Config.setVideoImageFormat() instead (default "jpeg"). For rendering stills, use Config.setStillImageFormat() (default "png")');
|
||||
},
|
||||
setJpegQuality: jpegQualityOption.setConfig,
|
||||
setStillImageFormat: image_format_1.setStillImageFormat,
|
||||
setVideoImageFormat: image_format_1.setVideoImageFormat,
|
||||
setMetadata: metadata_1.setMetadata,
|
||||
setEncodingMaxRate: encodingMaxRateOption.setConfig,
|
||||
setEncodingBufferSize: encodingBufferSizeOption.setConfig,
|
||||
setFrameRange: frame_range_2.setFrameRange,
|
||||
setScale: scaleOption.setConfig,
|
||||
setEveryNthFrame: every_nth_frame_1.setEveryNthFrame,
|
||||
setNumberOfGifLoops: numberOfGifLoopsOption.setConfig,
|
||||
setMuted: mutedOption.setConfig,
|
||||
setEnforceAudioTrack: enforceAudioOption.setConfig,
|
||||
setOutputLocation: output_location_2.setOutputLocation,
|
||||
setOverwriteOutput: overwriteOption.setConfig,
|
||||
setChromeMode: chromeModeOption.setConfig,
|
||||
setPixelFormat: pixel_format_2.setPixelFormat,
|
||||
setCodec: videoCodecOption.setConfig,
|
||||
setCrf: crfOption.setConfig,
|
||||
setImageSequence: image_sequence_2.setImageSequence,
|
||||
setProResProfile: prores_profile_2.setProResProfile,
|
||||
setX264Preset: x264Option.setConfig,
|
||||
setAudioBitrate: audioBitrateOption.setConfig,
|
||||
setVideoBitrate: videoBitrateOption.setConfig,
|
||||
setAudioLatencyHint: audioLatencyHintOption.setConfig,
|
||||
setForSeamlessAacConcatenation: forSeamlessAacConcatenationOption.setConfig,
|
||||
overrideHeight: height_1.overrideHeight,
|
||||
overrideWidth: width_1.overrideWidth,
|
||||
overrideFfmpegCommand: ffmpeg_override_1.setFfmpegOverrideFunction,
|
||||
setAudioCodec: audioCodecOption.setConfig,
|
||||
setOffthreadVideoCacheSizeInBytes: (size) => {
|
||||
offthreadVideoCacheSizeInBytesOption.setConfig(size);
|
||||
},
|
||||
setDeleteAfter: deleteAfterOption.setConfig,
|
||||
setColorSpace: colorSpaceOption.setConfig,
|
||||
setDisallowParallelEncoding: disallowParallelEncodingOption.setConfig,
|
||||
setBeepOnFinish: beepOnFinishOption.setConfig,
|
||||
setEnableFolderExpiry: folderExpiryOption.setConfig,
|
||||
setRepro: reproOption.setConfig,
|
||||
setLambdaInsights: enableLambdaInsights.setConfig,
|
||||
setBinariesDirectory: binariesDirectoryOption.setConfig,
|
||||
setPreferLosslessAudio: preferLosslessOption.setConfig,
|
||||
setPublicPath: publicPathOption.setConfig,
|
||||
setImageSequencePattern: imageSequencePatternOption.setConfig,
|
||||
setHardwareAcceleration: hardwareAccelerationOption.setConfig,
|
||||
setEnableCrossSiteIsolation: enableCrossSiteIsolationOption.setConfig,
|
||||
setAskAIEnabled: askAIOption.setConfig,
|
||||
setPublicLicenseKey: publicLicenseKeyOption.setConfig,
|
||||
setForceNewStudioEnabled: forceNewStudioOption.setConfig,
|
||||
setIPv4: ipv4Option.setConfig,
|
||||
};
|
||||
exports.ConfigInternals = {
|
||||
getRange: frame_range_1.getRange,
|
||||
getBrowser: browser_1.getBrowser,
|
||||
getPixelFormat: pixel_format_1.getPixelFormat,
|
||||
getProResProfile: prores_profile_1.getProResProfile,
|
||||
getBrowserExecutable: browser_executable_1.getBrowserExecutable,
|
||||
getStudioPort: preview_server_1.getStudioPort,
|
||||
getRendererPortFromConfigFile: preview_server_1.getRendererPortFromConfigFile,
|
||||
getRendererPortFromConfigFileAndCliFlag: preview_server_1.getRendererPortFromConfigFileAndCliFlag,
|
||||
getChromiumDisableWebSecurity: chromium_flags_1.getChromiumDisableWebSecurity,
|
||||
getIgnoreCertificateErrors: chromium_flags_1.getIgnoreCertificateErrors,
|
||||
getEveryNthFrame: every_nth_frame_1.getEveryNthFrame,
|
||||
getConcurrency: concurrency_1.getConcurrency,
|
||||
getStillFrame: still_frame_1.getStillFrame,
|
||||
getShouldOutputImageSequence: image_sequence_1.getShouldOutputImageSequence,
|
||||
getDotEnvLocation: env_file_1.getDotEnvLocation,
|
||||
getUserPreferredStillImageFormat: image_format_1.getUserPreferredStillImageFormat,
|
||||
getUserPreferredVideoImageFormat: image_format_1.getUserPreferredVideoImageFormat,
|
||||
getWebpackOverrideFn: override_webpack_1.getWebpackOverrideFn,
|
||||
getWebpackCaching: webpack_caching_1.getWebpackCaching,
|
||||
getOutputLocation: output_location_1.getOutputLocation,
|
||||
setFrameRangeFromCli: frame_range_1.setFrameRangeFromCli,
|
||||
setStillFrame: still_frame_1.setStillFrame,
|
||||
getMaxTimelineTracks: studio_server_1.StudioServerInternals.getMaxTimelineTracks,
|
||||
defaultOverrideFunction: override_webpack_1.defaultOverrideFunction,
|
||||
getFfmpegOverrideFunction: ffmpeg_override_1.getFfmpegOverrideFunction,
|
||||
getHeight: height_1.getHeight,
|
||||
getWidth: width_1.getWidth,
|
||||
getMetadata: metadata_1.getMetadata,
|
||||
getEntryPoint: entry_point_1.getEntryPoint,
|
||||
getWebpackPolling: webpack_poll_1.getWebpackPolling,
|
||||
getShouldOpenBrowser: open_browser_1.getShouldOpenBrowser,
|
||||
getChromiumUserAgent: user_agent_1.getChromiumUserAgent,
|
||||
getBufferStateDelayInMilliseconds: buffer_state_delay_in_milliseconds_1.getBufferStateDelayInMilliseconds,
|
||||
getOutputCodecOrUndefined: client_1.BrowserSafeApis.getOutputCodecOrUndefined,
|
||||
};
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare const setMetadata: (metadata: Record<string, string>) => void;
|
||||
export declare const getMetadata: () => Record<string, string>;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMetadata = exports.setMetadata = void 0;
|
||||
let specifiedMetadata;
|
||||
const setMetadata = (metadata) => {
|
||||
specifiedMetadata = metadata;
|
||||
};
|
||||
exports.setMetadata = setMetadata;
|
||||
const getMetadata = () => {
|
||||
return specifiedMetadata;
|
||||
};
|
||||
exports.getMetadata = getMetadata;
|
||||
skills/remotion-prompt-video/node_modules/@remotion/cli/dist/config/number-of-shared-audio-tags.d.ts
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare const getNumberOfSharedAudioTags: () => number;
|
||||
export declare const setNumberOfSharedAudioTags: (audioTags: number) => void;
|
||||
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.setNumberOfSharedAudioTags = exports.getNumberOfSharedAudioTags = void 0;
|
||||
let numberOfSharedAudioTags = 0;
|
||||
const getNumberOfSharedAudioTags = () => {
|
||||
return numberOfSharedAudioTags;
|
||||
};
|
||||
exports.getNumberOfSharedAudioTags = getNumberOfSharedAudioTags;
|
||||
const setNumberOfSharedAudioTags = (audioTags) => {
|
||||
numberOfSharedAudioTags = audioTags;
|
||||
};
|
||||
exports.setNumberOfSharedAudioTags = setNumberOfSharedAudioTags;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare const setShouldOpenBrowser: (_should: boolean) => void;
|
||||
export declare const getShouldOpenBrowser: () => boolean;
|
||||
Generated
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getShouldOpenBrowser = exports.setShouldOpenBrowser = void 0;
|
||||
let should = true;
|
||||
const setShouldOpenBrowser = (_should) => {
|
||||
if (typeof _should !== 'boolean') {
|
||||
throw new TypeError(`Expected a boolean, got ${typeof _should} (${should})`);
|
||||
}
|
||||
should = _should;
|
||||
};
|
||||
exports.setShouldOpenBrowser = setShouldOpenBrowser;
|
||||
const getShouldOpenBrowser = () => {
|
||||
return should;
|
||||
};
|
||||
exports.getShouldOpenBrowser = getShouldOpenBrowser;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare const setOutputLocation: (newOutputLocation: string) => void;
|
||||
export declare const getOutputLocation: () => string | null;
|
||||
Generated
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getOutputLocation = exports.setOutputLocation = void 0;
|
||||
let currentOutputLocation = null;
|
||||
const setOutputLocation = (newOutputLocation) => {
|
||||
if (typeof newOutputLocation !== 'string') {
|
||||
throw new Error(`outputLocation must be a string but got ${typeof newOutputLocation} (${JSON.stringify(newOutputLocation)})`);
|
||||
}
|
||||
if (newOutputLocation.trim() === '') {
|
||||
throw new Error(`outputLocation must not be an empty string`);
|
||||
}
|
||||
currentOutputLocation = newOutputLocation;
|
||||
};
|
||||
exports.setOutputLocation = setOutputLocation;
|
||||
const getOutputLocation = () => currentOutputLocation;
|
||||
exports.getOutputLocation = getOutputLocation;
|
||||
Generated
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
import type { WebpackConfiguration } from '@remotion/bundler';
|
||||
export type WebpackOverrideFn = (currentConfiguration: WebpackConfiguration) => WebpackConfiguration | Promise<WebpackConfiguration>;
|
||||
export declare const defaultOverrideFunction: WebpackOverrideFn;
|
||||
export declare const getWebpackOverrideFn: () => WebpackOverrideFn;
|
||||
export declare const overrideWebpackConfig: (fn: WebpackOverrideFn) => void;
|
||||
Generated
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.overrideWebpackConfig = exports.getWebpackOverrideFn = exports.defaultOverrideFunction = void 0;
|
||||
const defaultOverrideFunction = (config) => config;
|
||||
exports.defaultOverrideFunction = defaultOverrideFunction;
|
||||
let overrideFn = exports.defaultOverrideFunction;
|
||||
const getWebpackOverrideFn = () => {
|
||||
return overrideFn;
|
||||
};
|
||||
exports.getWebpackOverrideFn = getWebpackOverrideFn;
|
||||
const overrideWebpackConfig = (fn) => {
|
||||
const prevOverride = overrideFn;
|
||||
overrideFn = async (c) => fn(await prevOverride(c));
|
||||
};
|
||||
exports.overrideWebpackConfig = overrideWebpackConfig;
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
import type { PixelFormat } from '@remotion/renderer';
|
||||
export declare const setPixelFormat: (format: PixelFormat) => void;
|
||||
export declare const getPixelFormat: () => "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
||||
Generated
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getPixelFormat = exports.setPixelFormat = void 0;
|
||||
const renderer_1 = require("@remotion/renderer");
|
||||
let currentPixelFormat = renderer_1.RenderInternals.DEFAULT_PIXEL_FORMAT;
|
||||
const setPixelFormat = (format) => {
|
||||
if (!renderer_1.RenderInternals.validPixelFormats.includes(format)) {
|
||||
throw new TypeError(`Value ${format} is not valid as a pixel format.`);
|
||||
}
|
||||
currentPixelFormat = format;
|
||||
};
|
||||
exports.setPixelFormat = setPixelFormat;
|
||||
const getPixelFormat = () => {
|
||||
return currentPixelFormat;
|
||||
};
|
||||
exports.getPixelFormat = getPixelFormat;
|
||||
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
*
|
||||
* @param port
|
||||
* @deprecated Use the `setStudioPort` and `setRendererPort` functions instead
|
||||
* @returns
|
||||
*/
|
||||
export declare const setPort: (port: number | undefined) => void;
|
||||
export declare const setStudioPort: (port: number | undefined) => void;
|
||||
export declare const setRendererPort: (port: number | undefined) => void;
|
||||
export declare const getStudioPort: () => number | undefined;
|
||||
export declare const getRendererPortFromConfigFile: () => number | null;
|
||||
export declare const getRendererPortFromConfigFileAndCliFlag: () => number | null;
|
||||
Generated
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRendererPortFromConfigFileAndCliFlag = exports.getRendererPortFromConfigFile = exports.getStudioPort = exports.setRendererPort = exports.setStudioPort = exports.setPort = void 0;
|
||||
const parsed_cli_1 = require("../parsed-cli");
|
||||
let studioPort;
|
||||
let rendererPort;
|
||||
const validatePort = (port) => {
|
||||
if (!['number', 'undefined'].includes(typeof port)) {
|
||||
throw new Error(`Studio server port should be a number. Got ${typeof port} (${JSON.stringify(port)})`);
|
||||
}
|
||||
if (port === undefined) {
|
||||
return;
|
||||
}
|
||||
if (port < 1 || port > 65535) {
|
||||
throw new Error(`Studio server port should be a number between 1 and 65535. Got ${port}`);
|
||||
}
|
||||
};
|
||||
/**
|
||||
*
|
||||
* @param port
|
||||
* @deprecated Use the `setStudioPort` and `setRendererPort` functions instead
|
||||
* @returns
|
||||
*/
|
||||
const setPort = (port) => {
|
||||
(0, exports.setStudioPort)(port);
|
||||
(0, exports.setRendererPort)(port);
|
||||
};
|
||||
exports.setPort = setPort;
|
||||
const setStudioPort = (port) => {
|
||||
validatePort(port);
|
||||
studioPort = port;
|
||||
};
|
||||
exports.setStudioPort = setStudioPort;
|
||||
const setRendererPort = (port) => {
|
||||
validatePort(port);
|
||||
rendererPort = port;
|
||||
};
|
||||
exports.setRendererPort = setRendererPort;
|
||||
const getStudioPort = () => studioPort;
|
||||
exports.getStudioPort = getStudioPort;
|
||||
const getRendererPortFromConfigFile = () => {
|
||||
return rendererPort !== null && rendererPort !== void 0 ? rendererPort : null;
|
||||
};
|
||||
exports.getRendererPortFromConfigFile = getRendererPortFromConfigFile;
|
||||
const getRendererPortFromConfigFileAndCliFlag = () => {
|
||||
var _a, _b;
|
||||
return (_b = (_a = parsed_cli_1.parsedCli.port) !== null && _a !== void 0 ? _a : rendererPort) !== null && _b !== void 0 ? _b : null;
|
||||
};
|
||||
exports.getRendererPortFromConfigFileAndCliFlag = getRendererPortFromConfigFileAndCliFlag;
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
import type { _InternalTypes } from 'remotion';
|
||||
export declare const getProResProfile: () => _InternalTypes["ProResProfile"] | undefined;
|
||||
export declare const setProResProfile: (profile: _InternalTypes["ProResProfile"] | undefined) => void;
|
||||
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.setProResProfile = exports.getProResProfile = void 0;
|
||||
let proResProfile;
|
||||
const getProResProfile = () => {
|
||||
return proResProfile;
|
||||
};
|
||||
exports.getProResProfile = getProResProfile;
|
||||
const setProResProfile = (profile) => {
|
||||
proResProfile = profile;
|
||||
};
|
||||
exports.setProResProfile = setProResProfile;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare const setStillFrame: (frame: number) => void;
|
||||
export declare const getStillFrame: () => number;
|
||||
Generated
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStillFrame = exports.setStillFrame = void 0;
|
||||
const no_react_1 = require("remotion/no-react");
|
||||
let stillFrame = 0;
|
||||
const setStillFrame = (frame) => {
|
||||
no_react_1.NoReactInternals.validateFrame({
|
||||
frame,
|
||||
durationInFrames: Infinity,
|
||||
allowFloats: false,
|
||||
});
|
||||
stillFrame = frame;
|
||||
};
|
||||
exports.setStillFrame = setStillFrame;
|
||||
const getStillFrame = () => stillFrame;
|
||||
exports.getStillFrame = getStillFrame;
|
||||
Generated
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
type UserAgent = string | null;
|
||||
export declare const setChromiumUserAgent: (newAgent: UserAgent) => void;
|
||||
export declare const getChromiumUserAgent: () => UserAgent;
|
||||
export {};
|
||||
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getChromiumUserAgent = exports.setChromiumUserAgent = void 0;
|
||||
let userAgent = null;
|
||||
const setChromiumUserAgent = (newAgent) => {
|
||||
userAgent = newAgent;
|
||||
};
|
||||
exports.setChromiumUserAgent = setChromiumUserAgent;
|
||||
const getChromiumUserAgent = () => {
|
||||
return userAgent;
|
||||
};
|
||||
exports.getChromiumUserAgent = getChromiumUserAgent;
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
export declare const DEFAULT_WEBPACK_CACHE_ENABLED = true;
|
||||
export declare const setWebpackCaching: (flag: boolean) => void;
|
||||
export declare const getWebpackCaching: () => boolean;
|
||||
Generated
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getWebpackCaching = exports.setWebpackCaching = exports.DEFAULT_WEBPACK_CACHE_ENABLED = void 0;
|
||||
exports.DEFAULT_WEBPACK_CACHE_ENABLED = true;
|
||||
let webpackCaching = exports.DEFAULT_WEBPACK_CACHE_ENABLED;
|
||||
const setWebpackCaching = (flag) => {
|
||||
if (typeof flag !== 'boolean') {
|
||||
throw new TypeError('Caching flag must be a boolean.');
|
||||
}
|
||||
webpackCaching = flag;
|
||||
};
|
||||
exports.setWebpackCaching = setWebpackCaching;
|
||||
const getWebpackCaching = () => {
|
||||
return webpackCaching;
|
||||
};
|
||||
exports.getWebpackCaching = getWebpackCaching;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare const setWebpackPollingInMilliseconds: (interval: number | null) => void;
|
||||
export declare const getWebpackPolling: () => number | null;
|
||||
Generated
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getWebpackPolling = exports.setWebpackPollingInMilliseconds = void 0;
|
||||
const DEFAULT_WEBPACK_POLL = null;
|
||||
let webpackPolling = DEFAULT_WEBPACK_POLL;
|
||||
const setWebpackPollingInMilliseconds = (interval) => {
|
||||
if (typeof interval !== 'number' && interval !== null) {
|
||||
throw new TypeError(`Polling must be a number or null, got ${JSON.stringify(interval)} instead.`);
|
||||
}
|
||||
webpackPolling = interval;
|
||||
};
|
||||
exports.setWebpackPollingInMilliseconds = setWebpackPollingInMilliseconds;
|
||||
const getWebpackPolling = () => {
|
||||
return webpackPolling;
|
||||
};
|
||||
exports.getWebpackPolling = getWebpackPolling;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export declare const overrideWidth: (newWidth: number) => void;
|
||||
export declare const getWidth: () => number | null;
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getWidth = exports.overrideWidth = void 0;
|
||||
const validate_1 = require("../validate");
|
||||
let passedWidth = null;
|
||||
const overrideWidth = (newWidth) => {
|
||||
if (typeof newWidth !== 'number') {
|
||||
(0, validate_1.validateDimension)(newWidth, 'width', 'passed to `setWidth()`');
|
||||
}
|
||||
passedWidth = newWidth;
|
||||
};
|
||||
exports.overrideWidth = overrideWidth;
|
||||
const getWidth = () => {
|
||||
return passedWidth;
|
||||
};
|
||||
exports.getWidth = getWidth;
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
export declare const convertEntryPointToServeUrl: (entryPoint: string) => string;
|
||||
Generated
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.convertEntryPointToServeUrl = void 0;
|
||||
const renderer_1 = require("@remotion/renderer");
|
||||
const node_path_1 = __importDefault(require("node:path"));
|
||||
const convertEntryPointToServeUrl = (entryPoint) => {
|
||||
const fullPath = renderer_1.RenderInternals.isServeUrl(entryPoint)
|
||||
? entryPoint
|
||||
: node_path_1.default.resolve(process.cwd(), entryPoint);
|
||||
return fullPath;
|
||||
};
|
||||
exports.convertEntryPointToServeUrl = convertEntryPointToServeUrl;
|
||||
Generated
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
type RemotionDetectionResult = {
|
||||
type: 'match';
|
||||
} | {
|
||||
type: 'mismatch';
|
||||
} | {
|
||||
type: 'not-remotion';
|
||||
};
|
||||
export declare const detectRemotionServer: (port: number, cwd: string) => Promise<RemotionDetectionResult>;
|
||||
export {};
|
||||
Generated
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.detectRemotionServer = void 0;
|
||||
const http_1 = __importDefault(require("http"));
|
||||
const detectRemotionServer = (port, cwd) => {
|
||||
return new Promise((resolve) => {
|
||||
const req = http_1.default.get({
|
||||
hostname: 'localhost',
|
||||
port,
|
||||
path: '/__remotion_config',
|
||||
timeout: 1000,
|
||||
}, (res) => {
|
||||
let data = '';
|
||||
res.on('data', (chunk) => {
|
||||
data += chunk;
|
||||
});
|
||||
res.on('end', () => {
|
||||
try {
|
||||
const json = JSON.parse(data);
|
||||
if ((json === null || json === void 0 ? void 0 : json.isRemotion) !== true) {
|
||||
return resolve({ type: 'not-remotion' });
|
||||
}
|
||||
// Normalize paths for comparison to avoid issues with different separators or casing on Windows
|
||||
const normalize = (p) => p.replace(/\\/g, '/').toLowerCase();
|
||||
if (normalize(json.cwd) === normalize(cwd)) {
|
||||
return resolve({ type: 'match' });
|
||||
}
|
||||
return resolve({ type: 'mismatch' });
|
||||
}
|
||||
catch (_a) {
|
||||
resolve({ type: 'not-remotion' });
|
||||
}
|
||||
});
|
||||
});
|
||||
req.on('error', () => resolve({ type: 'not-remotion' }));
|
||||
req.on('timeout', () => {
|
||||
req.destroy();
|
||||
resolve({ type: 'not-remotion' });
|
||||
});
|
||||
});
|
||||
};
|
||||
exports.detectRemotionServer = detectRemotionServer;
|
||||
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
import type { StillImageFormat, VideoImageFormat } from '@remotion/renderer';
|
||||
export declare const determineFinalStillImageFormat: ({ downloadName, outName, configImageFormat, cliFlag, isLambda, fromUi, }: {
|
||||
downloadName: string | null;
|
||||
outName: string | null;
|
||||
configImageFormat: StillImageFormat | null;
|
||||
cliFlag: StillImageFormat | VideoImageFormat | null;
|
||||
isLambda: boolean;
|
||||
fromUi: StillImageFormat | null;
|
||||
}) => {
|
||||
format: StillImageFormat;
|
||||
source: string;
|
||||
};
|
||||
Generated
Vendored
+61
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.determineFinalStillImageFormat = void 0;
|
||||
const deriveExtensionFromFilename = (filename) => {
|
||||
if (filename === null || filename === void 0 ? void 0 : filename.endsWith('.png')) {
|
||||
return 'png';
|
||||
}
|
||||
if (filename === null || filename === void 0 ? void 0 : filename.endsWith('.jpg')) {
|
||||
return 'jpeg';
|
||||
}
|
||||
if (filename === null || filename === void 0 ? void 0 : filename.endsWith('.jpeg')) {
|
||||
return 'jpeg';
|
||||
}
|
||||
if (filename === null || filename === void 0 ? void 0 : filename.endsWith('.pdf')) {
|
||||
return 'pdf';
|
||||
}
|
||||
if (filename === null || filename === void 0 ? void 0 : filename.endsWith('.webp')) {
|
||||
return 'webp';
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const determineFinalStillImageFormat = ({ downloadName, outName, configImageFormat, cliFlag, isLambda, fromUi, }) => {
|
||||
if (fromUi) {
|
||||
return { format: fromUi, source: 'via UI' };
|
||||
}
|
||||
const outNameExtension = deriveExtensionFromFilename(outName);
|
||||
const downloadNameExtension = deriveExtensionFromFilename(downloadName);
|
||||
const outNameDescription = isLambda ? 'S3 output key' : 'out name';
|
||||
if (outNameExtension &&
|
||||
downloadNameExtension &&
|
||||
outNameExtension !== downloadNameExtension) {
|
||||
throw new TypeError(`Image format mismatch: ${outName} was given as the ${outNameDescription} and ${downloadName} was given as the download name, but the extensions don't match.`);
|
||||
}
|
||||
if (downloadNameExtension) {
|
||||
if (cliFlag && downloadNameExtension !== cliFlag) {
|
||||
throw new TypeError(`Image format mismatch: ${downloadName} was given as the download name, but --image-format=${cliFlag} was passed. The image formats must match.`);
|
||||
}
|
||||
return { format: downloadNameExtension, source: 'Download name extension' };
|
||||
}
|
||||
if (outNameExtension) {
|
||||
if (cliFlag && outNameExtension !== cliFlag) {
|
||||
throw new TypeError(`Image format mismatch: ${outName} was given as the ${outNameDescription}, but --image-format=${cliFlag} was passed. The image formats must match.`);
|
||||
}
|
||||
return { format: outNameExtension, source: 'Out name extension' };
|
||||
}
|
||||
if (cliFlag === 'none') {
|
||||
throw new TypeError('The --image-format flag must not be "none" for stills.');
|
||||
}
|
||||
if (cliFlag !== null) {
|
||||
return { format: cliFlag, source: '--image-format flag' };
|
||||
}
|
||||
if (configImageFormat !== null) {
|
||||
// @ts-expect-error
|
||||
if (configImageFormat === 'none') {
|
||||
throw new Error('The still simage format in the config file must not be "none"');
|
||||
}
|
||||
return { format: configImageFormat, source: 'Config file' };
|
||||
}
|
||||
return { format: 'png', source: 'Default' };
|
||||
};
|
||||
exports.determineFinalStillImageFormat = determineFinalStillImageFormat;
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
import type { DownloadProgress } from '@remotion/studio-server';
|
||||
export declare const getFileSizeDownloadBar: (downloaded: number) => string;
|
||||
export declare const makeMultiDownloadProgress: (progresses: DownloadProgress[], totalFrames: number) => string | null;
|
||||
Generated
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.makeMultiDownloadProgress = exports.getFileSizeDownloadBar = void 0;
|
||||
const studio_server_1 = require("@remotion/studio-server");
|
||||
const studio_shared_1 = require("@remotion/studio-shared");
|
||||
const chalk_1 = require("./chalk");
|
||||
const make_link_1 = require("./hyperlinks/make-link");
|
||||
const make_progress_bar_1 = require("./make-progress-bar");
|
||||
const progress_bar_1 = require("./progress-bar");
|
||||
const truthy_1 = require("./truthy");
|
||||
const getFileSizeDownloadBar = (downloaded) => {
|
||||
const desiredLength = (0, make_progress_bar_1.makeProgressBar)(0, true).length;
|
||||
return `${studio_server_1.StudioServerInternals.formatBytes(downloaded).padEnd(desiredLength, ' ')}`;
|
||||
};
|
||||
exports.getFileSizeDownloadBar = getFileSizeDownloadBar;
|
||||
const makeMultiDownloadProgress = (progresses, totalFrames) => {
|
||||
if (progresses.length === 0) {
|
||||
return null;
|
||||
}
|
||||
const everyFileHasContentLength = progresses.every((p) => p.totalBytes !== null);
|
||||
const isDone = progresses.every((p) => p.progress === 1);
|
||||
const topRow = [
|
||||
(isDone ? `Downloaded assets` : 'Downloading assets').padEnd(progress_bar_1.LABEL_WIDTH, ' '),
|
||||
everyFileHasContentLength
|
||||
? (0, make_progress_bar_1.makeProgressBar)(progresses.reduce((a, b) => a + b.progress, 0) /
|
||||
progresses.length, false)
|
||||
: (0, exports.getFileSizeDownloadBar)(progresses.reduce((a, b) => a + b.downloaded, 0)),
|
||||
`${progresses.length} file${progresses.length === 1 ? '' : 's'}`.padStart((0, progress_bar_1.getRightLabelWidth)(totalFrames), ' '),
|
||||
]
|
||||
.filter(truthy_1.truthy)
|
||||
.join(' ');
|
||||
const downloadsToShow = progresses
|
||||
.filter((p) => p.progress !== 1)
|
||||
.slice(0, 2);
|
||||
return [
|
||||
topRow,
|
||||
...downloadsToShow.map((toShow) => {
|
||||
const truncatedFileName = toShow.name.length >= 60
|
||||
? toShow.name.substring(0, 57) + '...'
|
||||
: toShow.name;
|
||||
return chalk_1.chalk.gray(`↓ ${(0, studio_shared_1.formatBytes)(toShow.downloaded).padEnd(8, ' ')} ${(0, make_link_1.makeHyperlink)({ url: toShow.name, fallback: truncatedFileName, text: truncatedFileName })}`);
|
||||
}),
|
||||
].join('\n');
|
||||
};
|
||||
exports.makeMultiDownloadProgress = makeMultiDownloadProgress;
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import type { LogLevel } from '@remotion/renderer';
|
||||
type FoundReason = 'argument passed - found in cwd' | 'argument passed - found in root' | 'argument passed' | 'config file' | 'common paths' | 'none found';
|
||||
export declare const findEntryPoint: ({ args, logLevel, remotionRoot, allowDirectory, }: {
|
||||
args: (string | number)[];
|
||||
remotionRoot: string;
|
||||
logLevel: LogLevel;
|
||||
allowDirectory: boolean;
|
||||
}) => {
|
||||
file: string | null;
|
||||
remainingArgs: (string | number)[];
|
||||
reason: FoundReason;
|
||||
};
|
||||
export {};
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.findEntryPoint = void 0;
|
||||
const renderer_1 = require("@remotion/renderer");
|
||||
const node_fs_1 = require("node:fs");
|
||||
const node_path_1 = __importDefault(require("node:path"));
|
||||
const config_1 = require("./config");
|
||||
const log_1 = require("./log");
|
||||
const candidates = [
|
||||
node_path_1.default.join('src', 'index.ts'),
|
||||
node_path_1.default.join('src', 'index.tsx'),
|
||||
node_path_1.default.join('src', 'index.js'),
|
||||
node_path_1.default.join('src', 'index.mjs'),
|
||||
node_path_1.default.join('remotion', 'index.tsx'),
|
||||
node_path_1.default.join('remotion', 'index.ts'),
|
||||
node_path_1.default.join('remotion', 'index.js'),
|
||||
node_path_1.default.join('remotion', 'index.mjs'),
|
||||
node_path_1.default.join('src', 'remotion', 'index.tsx'),
|
||||
node_path_1.default.join('src', 'remotion', 'index.ts'),
|
||||
node_path_1.default.join('src', 'remotion', 'index.js'),
|
||||
node_path_1.default.join('src', 'remotion', 'index.mjs'),
|
||||
];
|
||||
const findCommonPath = (remotionRoot) => {
|
||||
return candidates.find((candidate) => (0, node_fs_1.existsSync)(node_path_1.default.resolve(remotionRoot, candidate)));
|
||||
};
|
||||
const findEntryPoint = ({ args, logLevel, remotionRoot, allowDirectory, }) => {
|
||||
const result = findEntryPointInner(args, remotionRoot, logLevel);
|
||||
if (result.file === null) {
|
||||
return result;
|
||||
}
|
||||
if (renderer_1.RenderInternals.isServeUrl(result.file)) {
|
||||
return result;
|
||||
}
|
||||
if (!(0, node_fs_1.existsSync)(result.file)) {
|
||||
throw new Error(`${result.file} was chosen as the entry point (reason = ${result.reason}) but it does not exist.`);
|
||||
}
|
||||
if (result.isDirectory && !allowDirectory) {
|
||||
throw new Error(`${result.file} was chosen as the entry point (reason = ${result.reason}) but it is a directory - it needs to be a file.`);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
exports.findEntryPoint = findEntryPoint;
|
||||
const isBundledCode = (p) => {
|
||||
return (0, node_fs_1.existsSync)(p) && (0, node_fs_1.existsSync)(node_path_1.default.join(p, 'index.html'));
|
||||
};
|
||||
const findEntryPointInner = (args, remotionRoot, logLevel) => {
|
||||
// 1st priority: Explicitly passed entry point
|
||||
let file = args[0] ? args[0].toString() : null;
|
||||
if (file) {
|
||||
log_1.Log.verbose({ indent: false, logLevel }, 'Checking if', file, 'is the entry file');
|
||||
const cwdResolution = node_path_1.default.resolve(process.cwd(), file);
|
||||
const remotionRootResolution = node_path_1.default.resolve(remotionRoot, file);
|
||||
// Checking if file was found in CWD
|
||||
if ((0, node_fs_1.existsSync)(cwdResolution)) {
|
||||
return {
|
||||
file: cwdResolution,
|
||||
remainingArgs: args.slice(1),
|
||||
reason: 'argument passed - found in cwd',
|
||||
isDirectory: isBundledCode(cwdResolution),
|
||||
};
|
||||
}
|
||||
// Checking if file was found in remotion root
|
||||
if ((0, node_fs_1.existsSync)(remotionRootResolution)) {
|
||||
return {
|
||||
file: remotionRootResolution,
|
||||
remainingArgs: args.slice(1),
|
||||
reason: 'argument passed - found in root',
|
||||
isDirectory: isBundledCode(remotionRootResolution),
|
||||
};
|
||||
}
|
||||
if (renderer_1.RenderInternals.isServeUrl(file)) {
|
||||
return {
|
||||
file,
|
||||
remainingArgs: args.slice(1),
|
||||
reason: 'argument passed',
|
||||
isDirectory: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
// 2nd priority: Config file
|
||||
file = config_1.ConfigInternals.getEntryPoint();
|
||||
if (file) {
|
||||
log_1.Log.verbose({ indent: false, logLevel }, 'Entry point from config file is', file);
|
||||
return {
|
||||
file: node_path_1.default.resolve(remotionRoot, file),
|
||||
remainingArgs: args,
|
||||
reason: 'config file',
|
||||
isDirectory: isBundledCode(node_path_1.default.resolve(remotionRoot, file)),
|
||||
};
|
||||
}
|
||||
// 3rd priority: Common paths
|
||||
const found = findCommonPath(remotionRoot);
|
||||
if (found) {
|
||||
const absolutePath = node_path_1.default.resolve(remotionRoot, found);
|
||||
log_1.Log.verbose({ indent: false, logLevel }, 'Selected', absolutePath, 'as the entry point because file exists and is a common entry point and no entry point was explicitly selected');
|
||||
return {
|
||||
file: absolutePath,
|
||||
remainingArgs: args,
|
||||
reason: 'common paths',
|
||||
isDirectory: false,
|
||||
};
|
||||
}
|
||||
return {
|
||||
file: null,
|
||||
remainingArgs: args,
|
||||
reason: 'none found',
|
||||
isDirectory: false,
|
||||
};
|
||||
};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare const formatEtaString: (timeRemainingInMilliseconds: number) => string;
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.formatEtaString = void 0;
|
||||
const truthy_1 = require("./truthy");
|
||||
const formatEtaString = (timeRemainingInMilliseconds) => {
|
||||
// Get render estimated time value and extract hours, minutes, and seconds
|
||||
const remainingTime = timeRemainingInMilliseconds / 1000;
|
||||
const remainingTimeHours = Math.floor(remainingTime / 3600);
|
||||
const remainingTimeMinutes = Math.floor((remainingTime % 3600) / 60);
|
||||
const remainingTimeSeconds = Math.floor(remainingTime % 60);
|
||||
// Create estimated time string by concatenating them with colons
|
||||
const estimatedTimeString = [
|
||||
remainingTimeHours ? `${remainingTimeHours}h` : null,
|
||||
remainingTimeMinutes ? remainingTimeMinutes + 'm' : null,
|
||||
`${remainingTimeSeconds}s`,
|
||||
]
|
||||
.filter(truthy_1.truthy)
|
||||
.join(' ');
|
||||
return estimatedTimeString;
|
||||
};
|
||||
exports.formatEtaString = formatEtaString;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export declare const EXTRA_PACKAGES: Record<string, string>;
|
||||
export declare const EXTRA_PACKAGES_DOCS: Record<string, string>;
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.EXTRA_PACKAGES_DOCS = exports.EXTRA_PACKAGES = void 0;
|
||||
exports.EXTRA_PACKAGES = {
|
||||
zod: '3.22.3',
|
||||
mediabunny: '1.34.2',
|
||||
};
|
||||
exports.EXTRA_PACKAGES_DOCS = {
|
||||
zod: 'https://www.remotion.dev/docs/schemas#prerequisites',
|
||||
mediabunny: 'https://www.remotion.dev/docs/mediabunny/version',
|
||||
};
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import type { LogLevel } from '@remotion/renderer';
|
||||
export declare const dynamicLibEnv: (indent: boolean, logLevel: LogLevel, binariesDirectory: string | null) => {
|
||||
DYLD_LIBRARY_PATH: string;
|
||||
RUST_BACKTRACE: string;
|
||||
} | {
|
||||
PATH: string;
|
||||
RUST_BACKTRACE: string;
|
||||
} | {
|
||||
LD_LIBRARY_PATH: string;
|
||||
RUST_BACKTRACE: string;
|
||||
};
|
||||
export declare const ffmpegCommand: (args: string[], logLevel: LogLevel) => never;
|
||||
export declare const ffprobeCommand: (args: string[], logLevel: LogLevel) => never;
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ffprobeCommand = exports.ffmpegCommand = exports.dynamicLibEnv = void 0;
|
||||
const renderer_1 = require("@remotion/renderer");
|
||||
const client_1 = require("@remotion/renderer/client");
|
||||
const node_child_process_1 = require("node:child_process");
|
||||
const node_path_1 = __importDefault(require("node:path"));
|
||||
const parsed_cli_1 = require("./parsed-cli");
|
||||
const dynamicLibEnv = (indent, logLevel, binariesDirectory) => {
|
||||
const lib = node_path_1.default.dirname(renderer_1.RenderInternals.getExecutablePath({
|
||||
type: 'compositor',
|
||||
indent,
|
||||
logLevel,
|
||||
binariesDirectory,
|
||||
}));
|
||||
return {
|
||||
RUST_BACKTRACE: 'full',
|
||||
...(process.platform === 'darwin'
|
||||
? {
|
||||
DYLD_LIBRARY_PATH: lib,
|
||||
}
|
||||
: process.platform === 'win32'
|
||||
? {
|
||||
PATH: `${lib};${process.env.PATH}`,
|
||||
}
|
||||
: {
|
||||
LD_LIBRARY_PATH: lib,
|
||||
}),
|
||||
};
|
||||
};
|
||||
exports.dynamicLibEnv = dynamicLibEnv;
|
||||
const ffmpegCommand = (args, logLevel) => {
|
||||
const { value: binariesDirectory } = client_1.BrowserSafeApis.options.binariesDirectoryOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
});
|
||||
const binary = renderer_1.RenderInternals.getExecutablePath({
|
||||
type: 'ffmpeg',
|
||||
indent: false,
|
||||
logLevel,
|
||||
binariesDirectory,
|
||||
});
|
||||
renderer_1.RenderInternals.makeFileExecutableIfItIsNot(binary);
|
||||
const done = (0, node_child_process_1.spawnSync)(binary, args, {
|
||||
stdio: 'inherit',
|
||||
env: (0, exports.dynamicLibEnv)(false, logLevel, binariesDirectory),
|
||||
cwd: process.cwd(),
|
||||
});
|
||||
process.exit(done.status);
|
||||
};
|
||||
exports.ffmpegCommand = ffmpegCommand;
|
||||
const ffprobeCommand = (args, logLevel) => {
|
||||
const { value: binariesDirectory } = client_1.BrowserSafeApis.options.binariesDirectoryOption.getValue({
|
||||
commandLine: parsed_cli_1.parsedCli,
|
||||
});
|
||||
const binary = renderer_1.RenderInternals.getExecutablePath({
|
||||
type: 'ffprobe',
|
||||
indent: false,
|
||||
logLevel,
|
||||
binariesDirectory,
|
||||
});
|
||||
renderer_1.RenderInternals.makeFileExecutableIfItIsNot(binary);
|
||||
const done = (0, node_child_process_1.spawnSync)(binary, args, {
|
||||
cwd: process.cwd(),
|
||||
stdio: 'inherit',
|
||||
env: (0, exports.dynamicLibEnv)(false, logLevel, binariesDirectory),
|
||||
});
|
||||
process.exit(done.status);
|
||||
};
|
||||
exports.ffprobeCommand = ffprobeCommand;
|
||||
Generated
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
import type { LogLevel } from '@remotion/renderer';
|
||||
export declare const getAndValidateAbsoluteOutputFile: (relativeOutputLocation: string, overwrite: boolean, logLevel: LogLevel) => string;
|
||||
export declare const getCliOptions: (options: {
|
||||
isStill: boolean;
|
||||
logLevel: LogLevel;
|
||||
indent: boolean;
|
||||
}) => {
|
||||
concurrency: string | number | null;
|
||||
frameRange: import("@remotion/renderer").FrameRange | null;
|
||||
shouldOutputImageSequence: boolean;
|
||||
inputProps: Record<string, unknown>;
|
||||
envVariables: Record<string, string>;
|
||||
pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
||||
proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
||||
everyNthFrame: number;
|
||||
stillFrame: number;
|
||||
browserExecutable: import("@remotion/renderer").BrowserExecutable;
|
||||
userAgent: string | null;
|
||||
disableWebSecurity: boolean;
|
||||
ignoreCertificateErrors: boolean;
|
||||
ffmpegOverride: import("@remotion/renderer").FfmpegOverrideFn;
|
||||
height: number | null;
|
||||
width: number | null;
|
||||
configFileImageFormat: "png" | "jpeg" | "none" | undefined;
|
||||
};
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getCliOptions = exports.getAndValidateAbsoluteOutputFile = void 0;
|
||||
const renderer_1 = require("@remotion/renderer");
|
||||
const node_fs_1 = __importDefault(require("node:fs"));
|
||||
const node_path_1 = __importDefault(require("node:path"));
|
||||
const config_1 = require("./config");
|
||||
const get_env_1 = require("./get-env");
|
||||
const get_input_props_1 = require("./get-input-props");
|
||||
const log_1 = require("./log");
|
||||
const getAndValidateFrameRange = (logLevel, indent) => {
|
||||
const frameRange = config_1.ConfigInternals.getRange();
|
||||
if (typeof frameRange === 'number') {
|
||||
log_1.Log.warn({ logLevel, indent }, 'Selected a single frame. Assuming you want to output an image.');
|
||||
log_1.Log.warn({ logLevel, indent }, `If you want to render a video, pass a range: '--frames=${frameRange}-${frameRange}'.`);
|
||||
log_1.Log.warn({ indent, logLevel }, "To dismiss this message, add the '--sequence' flag explicitly.");
|
||||
}
|
||||
return frameRange;
|
||||
};
|
||||
const getAndValidateAbsoluteOutputFile = (relativeOutputLocation, overwrite, logLevel) => {
|
||||
const absoluteOutputFile = node_path_1.default.resolve(process.cwd(), relativeOutputLocation);
|
||||
if (node_fs_1.default.existsSync(absoluteOutputFile) && !overwrite) {
|
||||
log_1.Log.error({ indent: false, logLevel }, `File at ${absoluteOutputFile} already exists. Use --overwrite to overwrite.`);
|
||||
process.exit(1);
|
||||
}
|
||||
return absoluteOutputFile;
|
||||
};
|
||||
exports.getAndValidateAbsoluteOutputFile = getAndValidateAbsoluteOutputFile;
|
||||
const getProResProfile = () => {
|
||||
const proResProfile = config_1.ConfigInternals.getProResProfile();
|
||||
return proResProfile;
|
||||
};
|
||||
const getCliOptions = (options) => {
|
||||
const frameRange = getAndValidateFrameRange(options.logLevel, false);
|
||||
const shouldOutputImageSequence = options.isStill
|
||||
? true
|
||||
: config_1.ConfigInternals.getShouldOutputImageSequence(frameRange);
|
||||
const pixelFormat = config_1.ConfigInternals.getPixelFormat();
|
||||
const proResProfile = getProResProfile();
|
||||
const browserExecutable = config_1.ConfigInternals.getBrowserExecutable();
|
||||
const disableWebSecurity = config_1.ConfigInternals.getChromiumDisableWebSecurity();
|
||||
const ignoreCertificateErrors = config_1.ConfigInternals.getIgnoreCertificateErrors();
|
||||
const userAgent = config_1.ConfigInternals.getChromiumUserAgent();
|
||||
const everyNthFrame = config_1.ConfigInternals.getEveryNthFrame();
|
||||
const concurrency = config_1.ConfigInternals.getConcurrency();
|
||||
const height = config_1.ConfigInternals.getHeight();
|
||||
const width = config_1.ConfigInternals.getWidth();
|
||||
renderer_1.RenderInternals.validateConcurrency({
|
||||
value: concurrency,
|
||||
setting: 'concurrency',
|
||||
checkIfValidForCurrentMachine: false,
|
||||
});
|
||||
return {
|
||||
concurrency,
|
||||
frameRange,
|
||||
shouldOutputImageSequence,
|
||||
inputProps: (0, get_input_props_1.getInputProps)(null, options.logLevel),
|
||||
envVariables: (0, get_env_1.getEnvironmentVariables)(null, options.logLevel, options.indent),
|
||||
pixelFormat,
|
||||
proResProfile,
|
||||
everyNthFrame,
|
||||
stillFrame: config_1.ConfigInternals.getStillFrame(),
|
||||
browserExecutable,
|
||||
userAgent,
|
||||
disableWebSecurity,
|
||||
ignoreCertificateErrors,
|
||||
ffmpegOverride: config_1.ConfigInternals.getFfmpegOverrideFunction(),
|
||||
height,
|
||||
width,
|
||||
configFileImageFormat: config_1.ConfigInternals.getUserPreferredVideoImageFormat(),
|
||||
};
|
||||
};
|
||||
exports.getCliOptions = getCliOptions;
|
||||
Generated
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
import type { BrowserExecutable, ChromeMode, ChromiumOptions, HeadlessBrowser, LogLevel, OnBrowserDownload, RemotionServer } from '@remotion/renderer';
|
||||
import type { VideoConfig } from 'remotion';
|
||||
export declare const getCompositionId: ({ args, compositionIdFromUi, serializedInputPropsWithCustomSchema, puppeteerInstance, envVariables, timeoutInMilliseconds, chromiumOptions, port, browserExecutable, serveUrlOrWebpackUrl, logLevel, indent, server, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, binariesDirectory, onBrowserDownload, chromeMode, mediaCacheSizeInBytes, }: {
|
||||
args: (string | number)[];
|
||||
compositionIdFromUi: string | null;
|
||||
serializedInputPropsWithCustomSchema: string;
|
||||
puppeteerInstance: HeadlessBrowser | undefined;
|
||||
envVariables: Record<string, string>;
|
||||
timeoutInMilliseconds: number;
|
||||
chromiumOptions: ChromiumOptions;
|
||||
port: number | null;
|
||||
browserExecutable: BrowserExecutable;
|
||||
serveUrlOrWebpackUrl: string;
|
||||
logLevel: LogLevel;
|
||||
indent: boolean;
|
||||
server: RemotionServer;
|
||||
offthreadVideoCacheSizeInBytes: number | null;
|
||||
offthreadVideoThreads: number | null;
|
||||
binariesDirectory: string | null;
|
||||
onBrowserDownload: OnBrowserDownload;
|
||||
chromeMode: ChromeMode;
|
||||
mediaCacheSizeInBytes: number | null;
|
||||
}) => Promise<{
|
||||
compositionId: string;
|
||||
reason: string;
|
||||
config: VideoConfig;
|
||||
argsAfterComposition: (string | number)[];
|
||||
}>;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user