"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 { x264Option, audioBitrateOption, offthreadVideoCacheSizeInBytesOption, offthreadVideoThreadsOption, scaleOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, colorSpaceOption, enableMultiprocessOnLinuxOption, glOption, numberOfGifLoopsOption, beepOnFinishOption, encodingMaxRateOption, encodingBufferSizeOption, reproOption, logLevelOption, delayRenderTimeoutInMillisecondsOption, headlessOption, forSeamlessAacConcatenationOption, audioCodecOption, hardwareAccelerationOption, chromeModeOption, mediaCacheSizeInBytesOption, darkModeOption, publicLicenseKeyOption, } = 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(config_1.ConfigInternals.getConcurrency()); const pixelFormat = config_1.ConfigInternals.getPixelFormat(); const proResProfile = (_a = config_1.ConfigInternals.getProResProfile()) !== null && _a !== void 0 ? _a : null; const x264Preset = x264Option.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 = config_1.ConfigInternals.getEveryNthFrame(); const stillImageFormat = config_1.ConfigInternals.getUserPreferredStillImageFormat(); const videoImageFormat = config_1.ConfigInternals.getUserPreferredVideoImageFormat(); const disableWebSecurity = config_1.ConfigInternals.getChromiumDisableWebSecurity(); const ignoreCertificateErrors = config_1.ConfigInternals.getIgnoreCertificateErrors(); const darkMode = darkModeOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; const userAgent = config_1.ConfigInternals.getChromiumUserAgent(); const metadata = config_1.ConfigInternals.getMetadata(); const outputLocation = config_1.ConfigInternals.getOutputLocation(); 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', 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, }; }; exports.getRenderDefaults = getRenderDefaults;