UNPKG

@remotion/cli

Version:

Control Remotion features using the `npx remotion` command

37 lines (36 loc) 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getVideoImageFormat = void 0; const client_1 = require("@remotion/renderer/client"); const pure_1 = require("@remotion/renderer/pure"); const parsed_cli_1 = require("./parsed-cli"); const getVideoImageFormat = ({ codec, uiImageFormat, }) => { if (uiImageFormat !== null) { return uiImageFormat; } const configured = client_1.BrowserSafeApis.options.videoImageFormatOption.getValue({ commandLine: parsed_cli_1.parsedCli, }).value; if (configured !== null) { return configured; } if (pure_1.NoReactAPIs.isAudioCodec(codec)) { return 'none'; } if (codec === 'h264' || codec === 'h264-mkv' || codec === 'h264-ts' || codec === 'h265' || codec === 'av1' || codec === 'vp8' || codec === 'vp9' || codec === 'prores' || codec === 'gif') { return 'jpeg'; } if (codec === undefined) { return 'png'; } throw new Error('Unrecognized codec ' + codec); }; exports.getVideoImageFormat = getVideoImageFormat;