Hi everyone,
I’m currently building an instructional video generation workflow for an LMS platform using the Gemini API with VEO video generation and extension capabilities.
The workflow successfully generates videos, and I implemented an automated loop that extends videos segment-by-segment to create longer instructional content.
However, during the extension process, the workflow consistently fails after a few successful generations. The failure typically happens after several extension iterations, even though all extensions are performed using videos that were originally generated by VEO itself.
Below is the recurring error response:
{
"statusCode": 502,
"message": "Veo extension failed after segment 4/17. Latest successful output saved at: /Users/santhosh/codes/nola/video generation/SA-video-generation/generated/checkpoint_segment_4_of_17_1774253857870.mp4 Original error: {\"error\":{\"code\":400,\"message\":\"Input video must be a video that was generated by VEO that has been processed.\",\"status\":\"INVALID_ARGUMENT\"}}",
"error": "Bad Gateway",
"operation": "POST /gemini/scenes-and-extend"
}
What makes this confusing is:
-
The input video is a VEO-generated output from a previous successful step.
-
The same extension logic works initially.
-
Failures begin only after several chained extensions inside the loop.
I’m trying to understand whether this is caused by my implementation or by platform constraints.
I would appreciate clarification on the following:
-
Is there a limit on how many times a VEO-generated video can be extended sequentially?
-
Does a generated video require additional processing time before it becomes eligible for another extension?
-
Are there internal metadata or processing states that may invalidate videos for later extensions?
-
Are there lifecycle limits, timeouts, or asset validity windows affecting chained extensions?
-
What are the recommended best practices for generating long-form videos using multiple extensions?
Any guidance or architectural recommendations for reliably generating longer videos using VEO extensions would be greatly appreciated.
Thanks in advance for your help!
— Mawliswaran
NANONINO