VEO video extension fails after multiple segments with “Input video must be processed” error

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:

  1. Is there a limit on how many times a VEO-generated video can be extended sequentially?

  2. Does a generated video require additional processing time before it becomes eligible for another extension?

  3. Are there internal metadata or processing states that may invalidate videos for later extensions?

  4. Are there lifecycle limits, timeouts, or asset validity windows affecting chained extensions?

  5. 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

Hi @Mawliswaran_M

I wanted to understand your workflow better ,
In your current process , do you download the video segment generated by veo and re-upload it as input for the next steps ?

operation = await this.pollVeoOperation(operation);

const firstGenerated = operation.response?.generatedVideos?.[0];
This is how I used to get the video and pass it’s id to the next generation. Those clips are downloaded but their path was not used for the extension.

To understand better I’ll explain you exactly what is happening.
I was started to generated with four scenes as prompt in an array. The first prompt was generated and its ID was used to generate the next video and so the next video was generated in a loop after serveral attempts of generation according to the length of the array but it fails after third generation. When it begins for the fourth prompt I got the error that the “video should be generated by veo for extension “ since it was running in a loop continuously.