Troubleshooting¶
Common issues and solutions.
Authentication Issues¶
"Invalid API key"¶
Problem: API key is not valid or expired
Solutions:
- Check key prefix:
AIzaSy...for Gemini API - Regenerate key at Google AI Studio
- Ensure key is not quoted incorrectly
# Check key format
echo $GOOGLE_API_KEY | head -c 10
# Should show: AIzaSy...
"Permission denied" / "403 Forbidden"¶
Problem: API access not authorized
Solutions:
- Enable Vertex AI API in Cloud Console
- Check billing is enabled
- Verify API key has correct permissions
# For Vertex AI, use OAuth instead of API key
gcloud auth application-default login
TOKEN=$(gcloud auth application-default print-access-token)
python video_gen.py "test" --key "$TOKEN"
"401 Unauthorized"¶
Problem: Authentication failed
Solutions:
- Vertex AI keys (
AQ...) need OAuth for some operations - Token may be expired - refresh it
# Refresh OAuth token
gcloud auth application-default login
Video Generation Issues¶
"Model not found"¶
Problem: Specified model doesn't exist
Solutions:
- Check model name spelling
- List available models
python check_api.py --key "$GOOGLE_API_KEY"
Common models:
veo-3.1-generate-previewveo-3.1-fast-generate-previewveo-2.0
"Rate limit exceeded"¶
Problem: Too many requests
Solutions:
- Wait 30-60 seconds between requests
- Use
--preset budgetfor lower cost - Batch requests during off-peak hours
"Billing not enabled"¶
Problem: Video generation requires billing
Solution:
- Go to Cloud Console
- Enable billing for your project
- Link a payment method
Free Tier
Image generation with Gemini 2.0 Flash is free tier, but video generation requires billing.
Video Extension Issues¶
"video is empty"¶
Problem: External URL used for extension
Cause: API doesn't support HTTP/HTTPS URLs
Solution: Download video first, then use local file
# Download
curl -o local.mp4 "https://example.com/video.mp4"
# Use local file
python video_gen.py "Continue" --extend-video local.mp4
"fps mismatch"¶
Problem: Source video is not 24fps
Solution: Convert to 24fps using ffmpeg
# Check current fps
ffprobe -v error -select_streams v:0 -show_entries stream=r_frame_rate input.mp4
# Convert to 24fps
ffmpeg -i input.mp4 -r 24 -c:v libx264 output_24fps.mp4
# Use converted file
python video_gen.py "Continue" --extend-video output_24fps.mp4
"Model does not support video_extension"¶
Problem: Using veo-3.1 for extension
Solution: Use veo-2.0 for video extension
python video_gen.py "Continue" \
--extend-video input.mp4 \
--model veo-2.0
Reference Image Issues¶
"Too many references"¶
Problem: Exceeded reference image limits
Limits:
- Maximum 3 asset images
- Maximum 1 style image
- Cannot mix asset and style
Solution: Reduce number of references
# Use max 3 assets
python video_gen.py "prompt" \
--reference-image img1.png:asset \
--reference-image img2.png:asset \
--reference-image img3.png:asset
"does not support this mix"¶
Problem: Mixing asset and style references
Solution: Use only one type per request
# ❌ Wrong
--reference-image face.png:asset --reference-image style.jpg:style
# ✅ Correct - assets only
--reference-image face1.png:asset --reference-image face2.png:asset
# ✅ Correct - style only
--reference-image painting.jpg:style
"Reference type not supported"¶
Problem: Style reference on wrong model
Solution: Use veo-2.0-exp for style
python video_gen.py "prompt" \
--reference-image style.jpg:style \
--model veo-2.0-exp
GCS Issues¶
"Bucket not found"¶
Problem: GCS bucket doesn't exist
Solution:
# Create bucket
gsutil mb gs://your-bucket-name
"Permission denied on bucket"¶
Problem: No access to GCS bucket
Solution:
# Grant access
gsutil iam ch user:your@email.com:objectAdmin gs://your-bucket
"gsutil not found"¶
Problem: gcloud SDK not installed
Solution:
# Install gcloud
curl https://sdk.cloud.google.com | bash
# Or use Python package
pip install google-cloud-storage
General Issues¶
"Timeout"¶
Problem: Request took too long
Solutions:
- Video generation can take 60-180 seconds
- Check internet connection
- Try again - may be temporary
"Output file not created"¶
Problem: Video generation failed silently
Solutions:
- Check
--verboseoutput for errors - Verify output directory exists
- Check disk space
python video_gen.py "prompt" --verbose
"Import error: requests"¶
Problem: Missing dependencies
Solution:
pip install requests google-auth google-auth-oauthlib
Getting Help¶
- Check this troubleshooting guide
- Run with
--verbosefor details - Check Changelog for known issues
- Open issue on GitHub
Learn More¶
- Authentication - Auth setup guide
- Video Extension - Extension requirements
- GCS Storage - GCS configuration