{"record":{"id":"ab09eea31cf24233","repo":"remotion-dev/remotion","slug":"could-not-determine-animated-image-duration","errorCode":null,"errorMessage":"Could not determine animated image duration","messagePattern":"Could not determine animated image duration","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/animated-image/get-duration-in-seconds.ts","lineNumber":29,"sourceCode":"\trequestInit?: RequestInit;\n\tcontentType: string | null;\n}) => {\n\tconst {decoder, selectedTrack} = await createImageDecoder({\n\t\tresolvedSrc,\n\t\tsignal,\n\t\trequestInit,\n\t\tcontentType,\n\t});\n\n\ttry {\n\t\tconst {image} = await decoder.decode({\n\t\t\tframeIndex: selectedTrack.frameCount - 1,\n\t\t\tcompleteFramesOnly: true,\n\t\t});\n\n\t\ttry {\n\t\t\tif (image.duration === null) {\n\t\t\t\tthrow new Error('Could not determine animated image duration');\n\t\t\t}\n\n\t\t\treturn (image.timestamp + image.duration) / 1_000_000;\n\t\t} finally {\n\t\t\timage.close();\n\t\t}\n\t} finally {\n\t\tdecoder.close();\n\t}\n};\n","sourceCodeStart":11,"sourceCodeEnd":40,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/animated-image/get-duration-in-seconds.ts#L11-L40","documentation":"Thrown by getAnimatedImageDurationInSeconds when the last decoded frame reports duration === null. Without a duration the total animated image duration cannot be computed, so Remotion cannot schedule playback.","triggerScenarios":"Decoded the final frame of an animated image but the decoder did not supply a duration (some AVIF/GIF variants in certain browsers return null durations).","commonSituations":"Firefox decoding certain AVIF sequences; non-standard animated images; browser decoder implementation gaps.","solutions":["Convert the image to a widely supported animated format (GIF or animated WebP).","Try a Chromium-based browser/renderer.","If you control the asset, re-export with explicit frame durations."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Pre-check the asset's frame durations with a tool like ffprobe\n// to ensure they are populated.","typeGuard":null,"tryCatchPattern":"try {\n  await getAnimatedImageDurationInSeconds({...});\n} catch (e) {\n  if (e.message === 'Could not determine animated image duration') {\n    // fall back to a format the decoder handles, or a static image\n  }\n}","preventionTips":["Use GIF or animated WebP for broad browser support.","Re-export AVIF sequences with explicit durations."],"tags":["image-decoder","animated-image","duration","browser-support"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}