You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Any generation request with video_metadata results in a 500 error #854
i think this is a sdk issue no. i have been getting the same errror - 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': '* GenerateContentRequest.contents[1].parts: contents.parts must not be empty.\n', 'status': 'INVALID_ARGUMENT'}}
MOS Log: Error type: ClientError ; for the code: gemini_api_response = gemini_client.models.generate_content( model=GEMINI_MODEL_NAME, contents=[ AUDIO_ONLY_SYSTEM_PROMPT, types.Part.from_bytes(data=audio_data, mime_type=mime_type) ], config={ "response_mime_type": "application/json", "response_schema": GeminiMOSResponse, } ) ; but the same thing works for google-genai 1.15.0
@Madhuvod I believe my particular issue is an api issue since I have the same issue when calling the REST API directly rather than using the Python SDK.
Hi @kfajdsl, Thanks for reporting this issue. While trying to reproduce the error it seems the issue is with gemini-2.5-flash-preview-05-20 but works fine with gemini-2.0-flash. Will bring this issue to the engineering team's attention. Please refer to this gist. Thank You
Perhaps the issue might be with the video processing itself? Have you had a chance to try it with a different video?
Super confusing, the video works for me with gemini-2.5-flash-preview-05-20 and flash 2.0.
But my own video gives the 500 internal error, flash 2.0 works.
I might have found the issue,
it seems like the new API only accepts videos with an valid audiotrack, atleast adding an audiotrack to my video solved it for me.
Having no audio track will result in that error.
Limited to 1fps video analysis (no VideoMetadata fps parameter support)
Works fine for basic analysis but lacks timing precision
Desired setup (Google GenAI SDK):
Using google.generativeai library with API keys
Has VideoMetadata class with fps parameter for 24fps analysis
Would give me much better timing precision for shot detection
The problem is IP protection. I work with unreleased content from major studios (think pre-release studio work etc.) and need to ensure maximum data protection.
My understanding was that:
Vertex AI = enterprise-grade, content not used for training, better IP protection
GenAI SDK with API keys = less secure, potentially used for training?
But I'm honestly not sure if this is accurate or just assumptions I've picked up. The documentation isn't super clear on the security differences between these two approaches.
Specific questions:
Are there actual security/IP protection differences between the Vertex AI SDK and GenAI SDK?
Does vertexai.generative_models support VideoMetadata fps feature in a way that I'm missing?
The VideoMetadata fps feature would be incredibly valuable for my work, but I can't risk client IP. If both libraries offer the same enterprise protections, I'd love to switch. If not, I'll stick with Vertex AI.
Any clarity you can provide would be hugely appreciated!
might have found the issue,
it seems like the new API only accepts videos with an valid audiotrack, atleast adding an audiotrack to my video solved it for > me.
Having no audio track will result in that error.
Hello everyone,
I'm facing the same issue when trying to upload a video with no audio track:
[INFO] google.genai.errors.ServerError: 500 INTERNAL. {'error': {'code': 500, 'message': 'An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting', 'status': 'INTERNAL'}}
I did some experimentation and have seen the inverse scenario as well. When a .mp4 file is sent in with an empty video track (ie. an audio-only .mp4) the API will also return a 500:
google.genai.errors.ServerError: 500 INTERNAL. {'error': {'code': 500, 'message': 'Failed to convert server response to JSON', 'status': 'INTERNAL'}}
Activity
Madhuvod commentedon May 26, 2025
i think this is a sdk issue no. i have been getting the same errror - 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': '* GenerateContentRequest.contents[1].parts: contents.parts must not be empty.\n', 'status': 'INVALID_ARGUMENT'}}
MOS Log: Error type: ClientError ; for the code:
gemini_api_response = gemini_client.models.generate_content( model=GEMINI_MODEL_NAME, contents=[ AUDIO_ONLY_SYSTEM_PROMPT, types.Part.from_bytes(data=audio_data, mime_type=mime_type) ], config={ "response_mime_type": "application/json", "response_schema": GeminiMOSResponse, } ); but the same thing works for google-genai 1.15.0kfajdsl commentedon May 26, 2025
@Madhuvod I believe my particular issue is an api issue since I have the same issue when calling the REST API directly rather than using the Python SDK.
Jumaron commentedon May 27, 2025
Same Issue, looks like an API Issue.
kiransair commentedon May 27, 2025
Hi @kfajdsl, Thanks for reporting this issue. While trying to reproduce the error it seems the issue is with
gemini-2.5-flash-preview-05-20but works fine withgemini-2.0-flash. Will bring this issue to the engineering team's attention. Please refer to this gist. Thank Youhkt74 commentedon May 28, 2025
Hi @kfajdsl
Your code snippet works for me with model
models/gemini-2.5-flash-preview-05-20, (and I agree the docs page is incorrect)I tried with this sample video
Perhaps the issue might be with the video processing itself? Have you had a chance to try it with a different video?
Jumaron commentedon May 28, 2025
Super confusing, the video works for me with gemini-2.5-flash-preview-05-20 and flash 2.0.
But my own video gives the 500 internal error, flash 2.0 works.
Jumaron commentedon May 28, 2025
I might have found the issue,
it seems like the new API only accepts videos with an valid audiotrack, atleast adding an audiotrack to my video solved it for me.
Having no audio track will result in that error.
Etragas commentedon Jun 12, 2025
Wow thank you @Jumaron I added empty audio to my video and it worked!
janasangeetha commentedon Jul 18, 2025
Hi @kfajdsl
Looks like the issue is resolved! Please let us know if you are still facing issue.
Thank you!
khayyamkhan commentedon Jul 19, 2025
I have a bit of a dilemna:
Current setup (Vertex AI SDK):
vertexai.generative_models.GenerativeModelDesired setup (Google GenAI SDK):
google.generativeailibrary with API keysThe problem is IP protection. I work with unreleased content from major studios (think pre-release studio work etc.) and need to ensure maximum data protection.
My understanding was that:
But I'm honestly not sure if this is accurate or just assumptions I've picked up. The documentation isn't super clear on the security differences between these two approaches.
Specific questions:
The VideoMetadata fps feature would be incredibly valuable for my work, but I can't risk client IP. If both libraries offer the same enterprise protections, I'd love to switch. If not, I'll stick with Vertex AI.
Any clarity you can provide would be hugely appreciated!
github-actions commentedon Aug 2, 2025
This issue has been marked as stale because it has been open for 7 days with no activity. It will be closed in 2 days if no further activity occurs.
github-actions commentedon Aug 4, 2025
This issue was closed because it has been inactive for 9 days. Please post a new issue if you need further assistance. Thanks!
aleksac99 commentedon Aug 18, 2025
Hello everyone,
I'm facing the same issue when trying to upload a video with no audio track:
Can you please look into this? Thank you!
Districtfine commentedon Aug 18, 2025
I did some experimentation and have seen the inverse scenario as well. When a .mp4 file is sent in with an empty video track (ie. an audio-only .mp4) the API will also return a 500:
google.genai.errors.ServerError: 500 INTERNAL. {'error': {'code': 500, 'message': 'Failed to convert server response to JSON', 'status': 'INTERNAL'}}janasangeetha commentedon Aug 20, 2025
Hey Users,
Below are my observations:
Below code works fine for "video with audio" and "video without audio"
If you are using mp4 without video and only audio then update
mime_type='audio/mp4github-actions commentedon Aug 28, 2025
This issue has been marked as stale because it has been open for 7 days with no activity. It will be closed in 2 days if no further activity occurs.
github-actions commentedon Aug 31, 2025
This issue was closed because it has been inactive for 9 days. Please post a new issue if you need further assistance. Thanks!