UNPKG

@remotion/cli

Version:

Control Remotion features using the `npx remotion` command

170 lines (169 loc) • 7.93 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRenderDefaults = void 0; const renderer_1 = require("@remotion/renderer"); const client_1 = require("@remotion/renderer/client"); const config_1 = require("./config"); const parsed_cli_1 = require("./parsed-cli"); const { allowHtmlInCanvasOption, x264Option, gopSizeOption, audioBitrateOption, offthreadVideoCacheSizeInBytesOption, concurrencyOption, offthreadVideoThreadsOption, scaleOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, colorSpaceOption, enableMultiprocessOnLinuxOption, glOption, numberOfGifLoopsOption, beepOnFinishOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, logLevelOption, delayRenderTimeoutInMillisecondsOption, headlessOption, forSeamlessAacConcatenationOption, audioCodecOption, hardwareAccelerationOption, chromeModeOption, mediaCacheSizeInBytesOption, darkModeOption, pixelFormatOption, everyNthFrameOption, proResProfileOption, userAgentOption, disableWebSecurityOption, ignoreCertificateErrorsOption, publicLicenseKeyOption, stillImageFormatOption, videoImageFormatOption, sampleRateOption, } = client_1.BrowserSafeApis.options; const getRenderDefaults = () => { var _a; const defaultJpegQuality = jpegQualityOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const logLevel = logLevelOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value; const defaultCodec = config_1.ConfigInternals.getOutputCodecOrUndefined(); const concurrency = renderer_1.RenderInternals.resolveConcurrency(concurrencyOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value); const pixelFormat = pixelFormatOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const proResProfile = (_a = proResProfileOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value) !== null && _a !== void 0 ? _a : null; const x264Preset = x264Option.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const gopSize = gopSizeOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const audioBitrate = audioBitrateOption.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 defaultScale = scaleOption.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 colorSpace = colorSpaceOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const multiProcessOnLinux = enableMultiprocessOnLinuxOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const gl = glOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const numberOfGifLoops = numberOfGifLoopsOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const beepOnFinish = beepOnFinishOption.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 repro = reproOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const delayRenderTimeout = delayRenderTimeoutInMillisecondsOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const headless = headlessOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const forSeamlessAacConcatenation = forSeamlessAacConcatenationOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const audioCodec = audioCodecOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const hardwareAcceleration = hardwareAccelerationOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const chromeMode = chromeModeOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const mediaCacheSizeInBytes = mediaCacheSizeInBytesOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const publicLicenseKey = publicLicenseKeyOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const everyNthFrame = everyNthFrameOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const stillImageFormat = stillImageFormatOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const videoImageFormat = videoImageFormatOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const disableWebSecurity = disableWebSecurityOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const ignoreCertificateErrors = ignoreCertificateErrorsOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const darkMode = darkModeOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const userAgent = userAgentOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value; const metadata = config_1.ConfigInternals.getMetadata(); const outputLocation = config_1.ConfigInternals.getOutputLocation(); const allowHtmlInCanvas = allowHtmlInCanvasOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const maxConcurrency = renderer_1.RenderInternals.getMaxConcurrency(); const minConcurrency = renderer_1.RenderInternals.getMinConcurrency(); return { darkMode, jpegQuality: defaultJpegQuality !== null && defaultJpegQuality !== void 0 ? defaultJpegQuality : renderer_1.RenderInternals.DEFAULT_JPEG_QUALITY, scale: defaultScale !== null && defaultScale !== void 0 ? defaultScale : 1, logLevel, codec: defaultCodec !== null && defaultCodec !== void 0 ? defaultCodec : 'h264', concurrency, maxConcurrency, minConcurrency, stillImageFormat: stillImageFormat !== null && stillImageFormat !== void 0 ? stillImageFormat : renderer_1.RenderInternals.DEFAULT_STILL_IMAGE_FORMAT, videoImageFormat: videoImageFormat !== null && videoImageFormat !== void 0 ? videoImageFormat : renderer_1.RenderInternals.DEFAULT_VIDEO_IMAGE_FORMAT, muted, enforceAudioTrack, proResProfile, x264Preset: x264Preset !== null && x264Preset !== void 0 ? x264Preset : 'medium', gopSize, pixelFormat, audioBitrate, videoBitrate, encodingBufferSize, encodingMaxRate, everyNthFrame, delayRenderTimeout, audioCodec, disableWebSecurity, headless, ignoreCertificateErrors, openGlRenderer: gl, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, colorSpace, multiProcessOnLinux, userAgent, repro, numberOfGifLoops, beepOnFinish, forSeamlessAacConcatenation, metadata, hardwareAcceleration, chromeMode, mediaCacheSizeInBytes, publicLicenseKey, outputLocation, allowHtmlInCanvas, sampleRate: sampleRateOption.getValue({ commandLine: parsed_cli_1.parsedCli }).value, }; }; exports.getRenderDefaults = getRenderDefaults;