set custom fps not working?
Description of the bug:
I got extra_forbidden error when trying to set custom fps for video processing using client.models.generate_content. (code reference: https://ai.google.dev/gemini-api/docs/video-understanding). Please share if you have ran into the same issue and look forward to hearing how you solved it!
My code:
with open(video_local.name, 'rb') as f:
video_bytes = f.read()
# Create content using inline data
response = await self.gemini_client.aio.models.generate_content(
model=model,
contents=types.Content(
parts=[
types.Part(
inline_data=types.Blob(
data=video_bytes,
mime_type=mime_type,
video_metadata=types.VideoMetadata(fps=5)
)
),
types.Part(text=prompt)
]
)
)
Actual vs expected behavior:
Error Message: Failed to process video [https://....mp4] for Gemini: 1 validation error for Blob video_metadata Extra inputs are not permitted [type=extra_forbidden, input_value=VideoMetadata(fps=5.0, en...None, start_offset=None), input_type=VideoMetadata] For further information visit https://errors.pydantic.dev/2.10/v/extra_forbidden ERROR:app.routes.ads:Failed to analyze xxxxx: 1 validation error for Blob video_metadata Extra inputs are not permitted [type=extra_forbidden, input_value=VideoMetadata(fps=5.0, en...None, start_offset=None), input_type=VideoMetadata] For further information visit https://errors.pydantic.dev/2.10/v/extra_forbidden
Any other information you'd like to share?
No response
Hi @gobigandwin, May I know the model you are using for video understanding with custom FPS. Thank You.
Hi @kiransair, I'm using "gemini-2.5-pro-preview-05-06", the latest model.
Hi @gobigandwin, May I know the model you are using for video understanding with custom FPS. Thank You.
Hi @gobigandwin, while reproducing we have encountered the same error. will check with the engineering team. Thank You.
Hi @gobigandwin, while reproducing we have encountered the same error. will check with the engineering team. Thank You.
Hi, same question also occurred in gemini-2.5-flash-05-20
I'm also getting this issue. It works when switching back to gemini-2.0-flash. I would prefer to use the File API, but that does not currently support specifying a custom FPS.
Description of the bug:
I got extra_forbidden error when trying to set custom fps for video processing using client.models.generate_content. (code reference: https://ai.google.dev/gemini-api/docs/video-understanding). Please share if you have ran into the same issue and look forward to hearing how you solved it!
My code:
with open(video_local.name, 'rb') as f: video_bytes = f.read() # Create content using inline data response = await self.gemini_client.aio.models.generate_content( model=model, contents=types.Content( parts=[ types.Part( inline_data=types.Blob( data=video_bytes, mime_type=mime_type, video_metadata=types.VideoMetadata(fps=5) ) ), types.Part(text=prompt) ] ) )Actual vs expected behavior:
Error Message: Failed to process video [https://....mp4] for Gemini: 1 validation error for Blob video_metadata Extra inputs are not permitted [type=extra_forbidden, input_value=VideoMetadata(fps=5.0, en...None, start_offset=None), input_type=VideoMetadata] For further information visit https://errors.pydantic.dev/2.10/v/extra_forbidden ERROR:app.routes.ads:Failed to analyze xxxxx: 1 validation error for Blob video_metadata Extra inputs are not permitted [type=extra_forbidden, input_value=VideoMetadata(fps=5.0, en...None, start_offset=None), input_type=VideoMetadata] For further information visit https://errors.pydantic.dev/2.10/v/extra_forbidden
Any other information you'd like to share?
No response
Hi friend, what's your google-genai module's version? When I upgrade my 1.15.0 to 1.17.0, it works~
It didn't work for me. Then I upgraded google-genai to 1.17.0. Works now, but only for Gemini 2.0 Flash. Still not working for 2.5 series
I confirm that it works perfectly in Gemini 2.0 Flash. It failed In every 2.5 series at the current date (July 23rd)
Hi, I just tested it using the 2.5 model, and it seems to be working fine. For your reference, I am attaching a Colab Gist file. Let me know if you are still facing the same issues.
Thanks!
Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.
This issue was closed because it has been inactive for 27 days. Please post a new issue if you need further assistance. Thanks!