set custom fps not working?

I got extra_forbidden error when trying to set custom fps for video processing using client.models.generate_content. (code reference: Video understanding  |  Gemini API  |  Google AI for Developers). 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)
                        ]
                    )
                )

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

1 Like

btw, I ran into this issue when using gemini-2.5-pro-preview-05-06.

1 Like

+1, and the same error

Hi friend, what’s your google-genai module’s version? When I upgrade my 1.15.0 to 1.17.0, it works~

Still not working on my end with google-genai 1.17.0 and 1.18.0

Hi @FelixG @Tong_Shen
I was able to successfully reproduce the process from the documentation Video understanding  |  Gemini API  |  Google AI for Developers .It is working correctly with the gemini-2.5-flash-preview-05-20 model.
Could you please verify your video file size <20Mb? Let me know if the issue continues after checking.
Thank you