Hi!
According to the blog Gemini could understand videos longer than hour if mediaResolution parameter is set to ‘low’.
When I try to do that, it returns “{‘error’: {‘code’: 400, ‘message’: ‘Please use fewer than 3600 images in your request to models/gemini-2.5-pro-preview-03-25’, ‘status’: ‘INVALID_ARGUMENT’}}”.
What is the problem?
response = client.models.generate_content(
model=model_name,
contents=content_input, # Pass the list of Parts directly
config=types.GenerateContentConfig(
mediaResolution='MEDIA_RESOLUTION_LOW'
)
)
Hi @user1896 , Welcome to the forum.
Thanks for flagging this, I will check with the team.
Thanks for the reply!
MediaResolution ‘low’ works for gemini-2.5-pro-preview-05-06 now, thanks!
But I could not process a video that is longer than 3hrs. In the doc it is stated that 2M context models are able to handle up to 6hrs videos using mediaResolution ‘low’.
Unfortunately, the only model with 2M context is gemini-1.5-pro which returns “{‘error’: {‘code’: 400, ‘message’: ‘Unable to submit request because the model does not support the media_resolution parameter. Remove it and try again. Learn more: Generate content with the Vertex AI Gemini API | Generative AI on Vertex AI | Google Cloud’, ‘status’: ‘INVALID_ARGUMENT’}}”