Gemini API Video Understanding Timeout (504 DEADLINE_EXCEEDED) with 1.08 GB Video in GCS

I’m trying to use Google Cloud Storage (GCS) with the Gemini API for video understanding, but I’m consistently running into timeouts.

  • Video size: 1.08 GB

  • Duration: 3:30

  • Error:
    google.genai.errors.ServerError: 504 DEADLINE_EXCEEDED
    {'error': {'code': 504, 'message': 'Deadline expired before operation could complete.', 'status': 'DEADLINE_EXCEEDED'}}

I also tried using the File API with the same file, but it times out as well. Since the File API limit is 2 GB, I expected this to work.

Has anyone run into this with larger videos? What’s the recommended approach to handle this?
Thanks in advance.

This thread was automatically closed 60 days after the last reply. If you are running into an issue, please create a new post.