A Python toolkit for AI-powered video generation and seamless stitching using Google's Veo models.
Project description
Veotools
Concise Python SDK and MCP server for generating and extending videos with Google Veo.
Features
- Video generation from text, image seed, or continuation from an existing video
- Seamless extension workflow (extract last-second frame → generate → stitch with trim)
- MCP tools with progress streaming (start/get/cancel, continue_video) and recent videos resource
- Model discovery (local registry + remote list, cached)
- Accurate metadata via ffprobe/OpenCV; outputs under project
output/(override withVEO_OUTPUT_DIR)
Install
pip install veotools
# Or install from source
pip install -e .
pip install "veotools[mcp]" # optional MCP CLI
# Set your API key
export GEMINI_API_KEY="your-api-key"
# Or create a .env file with:
# GEMINI_API_KEY=your-api-key
SDK quick start
Simple Video Generation
import veotools as veo
# Initialize
veo.init()
# Generate video from text
result = veo.generate_from_text(
"A serene mountain landscape at sunset",
model="veo-3.0-fast-generate-preview"
)
print(f"Generated: {result.path}")
Continue and stitch
# Continue from an existing video (like one from your phone)
result = veo.generate_from_video(
"my_dog.mp4",
"the dog discovers a treasure chest",
extract_at=-1.0 # Use last frame
)
# Stitch them together seamlessly
final = veo.stitch_videos(
["my_dog.mp4", result.path],
overlap=1.0 # Trim 1 second overlap
)
CLI
Install exposes the veo command. Use -h/--help on any subcommand.
# Basics
veo preflight
veo list-models --remote
# Generate from text
veo generate --prompt "cat riding a hat" --model veo-3.0-fast-generate-preview
# Continue a video and stitch seamlessly
veo continue --video dog.mp4 --prompt "the dog finds a treasure chest" --overlap 1.0
# Help
veo --help
veo generate --help
Create a Story with Bridge
# Chain operations together
bridge = veo.Bridge("my_story")
final_video = (bridge
.add_media("sunrise.jpg")
.generate("sunrise coming to life")
.add_media("my_video.mp4")
.generate("continuing the adventure")
.stitch(overlap=1.0)
.save("my_story.mp4")
)
Core functions
Generation
generate_from_text(prompt, model, **kwargs)- Generate video from textgenerate_from_image(image_path, prompt, model, **kwargs)- Generate video from imagegenerate_from_video(video_path, prompt, extract_at, model, **kwargs)- Continue video
Processing
extract_frame(video_path, time_offset)- Extract single frameextract_frames(video_path, times)- Extract multiple framesget_video_info(video_path)- Get video metadata
Stitching
stitch_videos(video_paths, overlap)- Stitch videos with overlap trimmingstitch_with_transitions(videos, transitions)- Stitch with transition videos
Workflow
Bridge()- Create workflow chainsVideoResult- Web-ready result objectsProgressTracker- Progress callback handling
MCP tools
These functions are designed for integration with MCP servers and return deterministic JSON-friendly dicts.
System
import veotools as veo
veo.preflight()
# -> { ok: bool, gemini_api_key: bool, ffmpeg: {installed, version}, write_permissions: bool, base_path: str }
veo.version()
# -> { veotools: str | None, dependencies: {...}, ffmpeg: str | None }
Non-blocking generation jobs
import veotools as veo
# Start a job immediately
start = veo.generate_start({
"prompt": "A serene mountain landscape at sunset",
"model": "veo-3.0-fast-generate-preview"
})
job_id = start["job_id"]
# Poll status
status = veo.generate_get(job_id)
# -> { job_id, status, progress, message, kind, remote_operation_id?, result?, error_code?, error_message? }
# Request cancellation (cooperative)
veo.generate_cancel(job_id)
Model discovery
models = veotools.list_models(include_remote=True)
print([m["id"] for m in models["models"] if m["id"].startswith("veo-")])
Progress Tracking
def my_progress(message: str, percent: int):
print(f"{message}: {percent}%")
result = veo.generate_from_text(
"sunset over ocean",
on_progress=my_progress
)
Web-ready results
All results are JSON-serializable for API integration:
result = veo.generate_from_text("sunset")
# Convert to dictionary
data = result.to_dict()
# Ready for JSON API
import json
json_response = json.dumps(data)
Examples
See the examples/ folder for complete examples:
examples/text_to_video.pyexamples/video_to_video.pyexamples/chained_workflow.pyexamples/all_functions.py
Layout
.
├── __init__.py
├── bridge.py
├── core.py
├── generate
│ ├── __init__.py
│ └── video.py
├── mcp_api.py
├── models.py
├── process
│ ├── __init__.py
│ └── extractor.py
└── stitch
├── __init__.py
└── seamless.py
Key Concepts
VideoResult
Web-ready result object with metadata, progress, and JSON serialization.
Bridge Pattern
Chain operations together for complex workflows:
bridge.add_media().generate().stitch().save()
Progress Callbacks
Track long-running operations:
on_progress=lambda msg, pct: print(f"{msg}: {pct}%")
Storage Manager
Organized file management (local now, cloud-ready for future).
Notes
- Generation usually takes 1–3 minutes
- Veo access may require allowlist
License
MIT
Contributing
Pull requests welcome!
Support
For issues and questions, please use GitHub Issues.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file veotools-0.1.6.tar.gz.
File metadata
- Download URL: veotools-0.1.6.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e71d6e497a78ee84312dfcefa46c0972ced2314a4ef392e1a2ebcb2086b1419
|
|
| MD5 |
c994aba7b726a54873cfc8807628389b
|
|
| BLAKE2b-256 |
673428001f31d3c573451ff9d342a91a7c93be237882e554c23cc04ad56dbaa8
|
Provenance
The following attestation bundles were made for veotools-0.1.6.tar.gz:
Publisher:
python-publish.yml on frontboat/veotools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veotools-0.1.6.tar.gz -
Subject digest:
5e71d6e497a78ee84312dfcefa46c0972ced2314a4ef392e1a2ebcb2086b1419 - Sigstore transparency entry: 372444735
- Sigstore integration time:
-
Permalink:
frontboat/veotools@204d3acadea4628f4cd4c24812b2065f2c9d5338 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/frontboat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@204d3acadea4628f4cd4c24812b2065f2c9d5338 -
Trigger Event:
release
-
Statement type:
File details
Details for the file veotools-0.1.6-py3-none-any.whl.
File metadata
- Download URL: veotools-0.1.6-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82f55c5ca2904c1fb7c9e7645d5df65fa73e79c9d471912563242b47bc0f3f77
|
|
| MD5 |
c05ed8fd1e72cf0c605875c2d34c3454
|
|
| BLAKE2b-256 |
43f40aa122cbf56dcb865ea80b3c4bb5f2d332cf5f0b402e24df26a534679b41
|
Provenance
The following attestation bundles were made for veotools-0.1.6-py3-none-any.whl:
Publisher:
python-publish.yml on frontboat/veotools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veotools-0.1.6-py3-none-any.whl -
Subject digest:
82f55c5ca2904c1fb7c9e7645d5df65fa73e79c9d471912563242b47bc0f3f77 - Sigstore transparency entry: 372444757
- Sigstore integration time:
-
Permalink:
frontboat/veotools@204d3acadea4628f4cd4c24812b2065f2c9d5338 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/frontboat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@204d3acadea4628f4cd4c24812b2065f2c9d5338 -
Trigger Event:
release
-
Statement type: