@remotion/renderer
Version:
Render Remotion videos using Node.js or Bun
42 lines (41 loc) • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.gopSizeOption = exports.validateGopSize = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
let gopSize = null;
const validateGopSize = (value) => {
if (value === null) {
return;
}
if (typeof value !== 'number' ||
!Number.isFinite(value) ||
!Number.isInteger(value) ||
value <= 0) {
throw new TypeError('The GOP size must be an integer greater than 0 or null.');
}
};
exports.validateGopSize = validateGopSize;
const cliFlag = 'gop';
exports.gopSizeOption = {
name: 'GOP size',
cliFlag,
description: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Set the maximum number of frames between two keyframes. This maps to FFmpeg's ",
jsx_runtime_1.jsx("code", { children: "-g" }),
" option. Default: Let the encoder decide."] })),
ssrName: 'gopSize',
docLink: 'https://www.remotion.dev/docs/config#setgopsize',
type: null,
getValue: ({ commandLine }) => {
const value = commandLine[cliFlag];
if (value !== undefined) {
(0, exports.validateGopSize)(value);
return { value: value, source: 'cli' };
}
return { value: gopSize, source: gopSize === null ? 'default' : 'config' };
},
setConfig: (value) => {
(0, exports.validateGopSize)(value);
gopSize = value;
},
id: cliFlag,
};