{"record":{"id":"1545cd7c85628e9b","repo":"remotion-dev/remotion","slug":"the-fps-for-a-gif-cannot-be-higher-than-50-use-th","errorCode":null,"errorMessage":"The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif","messagePattern":"The FPS for a GIF cannot be higher than 50\\. Use the --every-nth-frame option to lower the FPS: https://remotion\\.dev/docs/render-as-gif","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/validation/validate-fps.ts","lineNumber":27,"sourceCode":"\t\t);\n\t}\n\n\tif (!Number.isFinite(fps)) {\n\t\tthrow new Error(\n\t\t\t`\"fps\" must be a finite, but you passed ${fps} ${location}`,\n\t\t);\n\t}\n\n\tif (isNaN(fps)) {\n\t\tthrow new Error(`\"fps\" must not be NaN, but got ${fps} ${location}`);\n\t}\n\n\tif (fps <= 0) {\n\t\tthrow new TypeError(`\"fps\" must be positive, but got ${fps} ${location}`);\n\t}\n\n\tif (isGif && fps > 50) {\n\t\tthrow new TypeError(\n\t\t\t`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`,\n\t\t);\n\t}\n}\n","sourceCodeStart":9,"sourceCodeEnd":32,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validation/validate-fps.ts#L9-L32","documentation":"`validateFps()` enforces a hard cap of 50 fps when the output target is a GIF, because the GIF format cannot reliably encode frame rates above 50 fps. When `isGif` is `true` and `fps > 50`, it throws a `TypeError` directing you to use `--every-nth-frame` to subsample frames instead.","triggerScenarios":"Rendering a composition as a GIF (`renderer` set to gif / `--codec gif`) while the composition or sequence has `fps` greater than 50.","commonSituations":"Building a composition at 60 fps for video output and then also rendering it as a GIF without lowering the frame rate.","solutions":["Lower the composition fps to 50 or less when rendering as GIF.","Pass `--every-nth-frame 2` (or higher) on the CLI to subsample frames while keeping the source fps.","Create a dedicated low-fps composition variant dedicated to GIF export."],"exampleFix":"// before (60fps source rendered as gif)\n<Composition fps={60} ... />\n// after\nbunx remotion render my-comp --codec gif --every-nth-frame 2","handlingStrategy":"validation","validationCode":"const gifFps = Math.min(50, compositionFps);","typeGuard":"const isValidGifFps = (fps: number): boolean => typeof fps === 'number' && fps > 0 && fps <= 50;","tryCatchPattern":null,"preventionTips":["Use a separate low-fps composition for GIF exports.","Pass `--every-nth-frame` when source fps exceeds 50.","Document the GIF fps cap wherever composition presets are defined."],"tags":["validation","gif","fps","rendering","cli"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}