{"record":{"id":"5564eae8026c918d","repo":"remotion-dev/remotion","slug":"samples-must-be-max-samples-but-got-jso","errorCode":null,"errorMessage":"\"samples\" must be <= ${MAX_SAMPLES}, but got ${JSON.stringify(r.samples)}","messagePattern":"\"samples\" must be <= (.+?), but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/zoom-blur/index.ts","lineNumber":117,"sourceCode":"const validateZoomBlurParams = (params: ZoomBlurParams): void => {\n\tassertEffectParamsObject(params, 'Zoom Blur');\n\tassertOptionalFiniteNumber(params.amount, 'amount');\n\tassertOptionalUvCoordinate(params.center, 'center');\n\tassertOptionalFiniteNumber(params.samples, 'samples');\n\tassertOptionalInteger(params.samples, 'samples');\n\n\tconst r = resolve(params);\n\tvalidateNonNegative(r.amount, 'amount');\n\tvalidateUnitInterval(r.center[0], 'center[0]');\n\tvalidateUnitInterval(r.center[1], 'center[1]');\n\tif (r.samples < 1) {\n\t\tthrow new TypeError(\n\t\t\t`\"samples\" must be >= 1, but got ${JSON.stringify(r.samples)}`,\n\t\t);\n\t}\n\n\tif (r.samples > MAX_SAMPLES) {\n\t\tthrow new TypeError(\n\t\t\t`\"samples\" must be <= ${MAX_SAMPLES}, but got ${JSON.stringify(r.samples)}`,\n\t\t);\n\t}\n};\n\nexport const zoomBlur = createEffect<ZoomBlurParams, ZoomBlurState>({\n\ttype: 'remotion/zoom-blur',\n\tlabel: 'zoomBlur()',\n\tdocumentationLink: 'https://www.remotion.dev/docs/effects/zoom-blur',\n\tbackend: 'webgl2',\n\tcalculateKey: (params) => {\n\t\tconst r = resolve(params);\n\t\treturn `zoom-blur-${r.amount}-${r.center[0]}-${r.center[1]}-${r.samples}`;\n\t},\n\tsetup: (target) => setupZoomBlur(target),\n\tapply: ({source, width, height, params, state, flipSourceY}) => {\n\t\tconst r = resolve(params);\n\t\tapplyZoomBlur({","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/zoom-blur/index.ts#L99-L135","documentation":"The zoomBlur effect caps `samples` at a compile-time constant `MAX_SAMPLES` (64). Higher sample counts increase GPU cost proportionally; this guard prevents excessive GPU work that would degrade rendering performance. If the resolved samples value exceeds 64, this TypeError is thrown.","triggerScenarios":"Passing `samples: 100`, `samples: 128`, or an interpolated value that overshoots the cap. Also triggered by multiplying a base count by a scaling factor that exceeds 64.","commonSituations":"A quality slider mapped to a wide range, animation interpolation without clamping, or copying a high sample count from a different effect with a higher cap.","solutions":["Clamp to the maximum: `samples: Math.min(64, computedSamples)`.","Use `interpolate(frame, [...], [1, 64], {extrapolateRight: 'clamp'})`.","Omit samples to use the default of 24."],"exampleFix":"// before\nzoomBlur({ samples: qualityFactor * 100 }); // can exceed 64\n\n// after\nzoomBlur({ samples: Math.min(64, Math.max(1, Math.round(qualityFactor * 64))) });","handlingStrategy":"validation","validationCode":"const MAX_SAMPLES = 64;\nconst samples = Math.min(MAX_SAMPLES, Math.max(1, Math.round(computedSamples)));\nzoomBlur({ samples });","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp samples to [1, 64] before passing to zoomBlur.","Use interpolate with extrapolateRight: 'clamp' for animated values.","Keep quality sliders mapped to the valid range."],"tags":["validation","effects","zoom-blur","range-check","performance"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}