### Install and Setup Veotools Source: https://context7.com/frontboat/veotools/llms.txt Installs the veotools library and its dependencies, including optional MCP server support. Also shows how to set environment variables for API keys and provider configuration. ```bash # Basic installation pip install veotools # With MCP server support pip install "veotools[mcp]" # Development installation pip install -e ".[dev,mcp]" # Environment setup export GEMINI_API_KEY="your-gemini-key" # Optional: Daydreams Router support export VEO_PROVIDER="daydreams" export DAYDREAMS_API_KEY="sk-router-..." ``` -------------------------------- ### Install Veotools and Dependencies Source: https://github.com/frontboat/veotools/blob/main/readme.md Installs the Veotools package for CLI and SDK usage, with optional support for MCP server. Also shows how to set environment variables for API keys and Veo provider. ```bash pip install veotools pip install "veotools[mcp]" pip install -e ".[dev,mcp]" export GEMINI_API_KEY="your-gemini-key" export VEO_PROVIDER="daydreams" export DAYDREAMS_API_KEY="sk-router-..." # export DAYDREAMS_BASE_URL="https://api-beta.daydreams.systems/v1" ``` -------------------------------- ### Install Veotools Python Package Source: https://github.com/frontboat/veotools/blob/main/docs/index.md These commands show how to install the Veotools Python package using pip. It covers basic installation, installation with MCP server support, and installation for development purposes including documentation. ```bash # Basic installation pip install veotools # With MCP server support pip install "veotools[mcp]" # For development pip install -e ".[dev,mcp,docs]" ``` -------------------------------- ### Quick Start: Generate and Execute Video Plan with Python Source: https://github.com/frontboat/veotools/blob/main/readme.md Demonstrates the Python API for generating a scene plan and executing it to render and stitch video clips. It includes setting up Veotools, generating a plan from a text idea, and executing the plan with auto-seeding. ```python import veotools as veo veo.init() # sets up logging + validates GEMINI_API_KEY plan = veo.generate_scene_plan( "N64 Japanese retro explainer about the x402 protocol", number_of_scenes=4, additional_context="Keep the tone energetic and educational", ) result = veo.execute_scene_plan( plan, model="veo-3.1-generate-preview", auto_seed_last_frame=True, # feed each clip the previous clip's final frame seed_frame_offset=-0.25, # extract the seed frame 0.25s before the end ) print("Rendered clip files:") for clip in result.clip_results: print(" -", clip.path) if result.final_result: print("Final stitched video:", result.final_result.path) ``` -------------------------------- ### Quick Start: Plan, Render, and Stitch Video with CLI Source: https://github.com/frontboat/veotools/blob/main/readme.md Executes a full video generation workflow from a single command line. It plans the storyboard, renders individual clips, and stitches them into a final video, with options for saving the plan and seeding frames. ```bash veo plan-run \ --idea "N64 Japanese retro explainer about the x402 protocol" \ --save-plan output-plans/x402.json \ --execute-model veo-3.1-generate-preview \ --seed-last-frame --seed-offset -0.25 ``` -------------------------------- ### Veotools CLI Commands for Video Generation Source: https://context7.com/frontboat/veotools/llms.txt Provides examples of using the Veotools Command Line Interface (CLI) for various video generation tasks. These include environment checks, listing models, generating videos from text or images, continuing existing videos, and planning/executing multi-scene video projects. ```bash # Check environment setup veo preflight # List available AI models remotely veo list-models --remote --json # Generate video from a text prompt veo generate --prompt "A sunset over mountains" --model veo-3.1-generate-preview # Generate video from a text prompt and an input image veo generate --prompt "Clouds moving" --image landscape.jpg --model veo-3.0-fast-generate-preview # Continue an existing video with a new prompt veo continue --video scene1.mp4 --prompt "The action continues" --overlap 1.0 # Plan a multi-scene video and save the plan veo plan --idea "Retro travel vlog" --scenes 4 --save plans/vlog.json --json # Execute a pre-defined video plan veo plan-execute --plan plans/vlog.json --model veo-3.1-generate-preview --seed-last-frame # Plan and execute a video in a single command, saving the plan and using specific generation parameters veo plan-run \ --idea "Documentary about ocean life" \ --scenes 6 \ --save-plan plans/ocean.json \ --execute-model veo-3.1-generate-preview \ --seed-last-frame \ --seed-offset -0.25 ``` -------------------------------- ### Generate Video from Seed Image (Python) Source: https://context7.com/frontboat/veotools/llms.txt Generates a video animation starting from a seed image and a text prompt describing the desired motion. Supports aspect ratio control and resize modes ('crop', 'pad'). Includes an optional progress callback. ```python import veotools as veo from pathlib import Path veo.init() # Animate a landscape photo result = veo.generate_from_image( image_path=Path("landscape.jpg"), prompt="Clouds slowly drifting across the sky, gentle wind rustling through trees", model="veo-3.1-generate-preview" ) print(f"Animated video: {result.path}") # With resize mode for aspect ratio handling result = veo.generate_from_image( image_path=Path("portrait.png"), prompt="The person turns and smiles at the camera", model="veo-3.0-generate-001", aspect_ratio="9:16", resize_mode="crop", # or "pad" on_progress=lambda msg, pct: print(f"{msg}: {pct}%") ) ``` -------------------------------- ### Async Job Lifecycle with Veotools API Source: https://context7.com/frontboat/veotools/llms.txt Demonstrates how to start an asynchronous video generation job, poll for its completion status, and retrieve the results using the Veotools Python API. This pattern is suitable for applications requiring background job processing without blocking the main thread. ```python import veo import time # Start an asynchronous generation job job = veo.generate_start({ "prompt": "A cat playing piano", "model": "veo-3.1-generate-preview" }) print(f"Job started: {job['job_id']}") # Poll for job completion while True: status = veo.generate_get(job['job_id']) print(f"Status: {status['status']} ({status['progress']}%) ") if status['status'] in ('complete', 'failed', 'cancelled'): break time.sleep(5) # Process results if the job was successful if status['status'] == 'complete': print(f"Video: {status['result']['path']}") # Optionally, cancel a running job (example assumes job is still running) # veo.generate_cancel(job['job_id']) ``` -------------------------------- ### Continue Video Generation using VeoTools Source: https://github.com/frontboat/veotools/blob/main/docs/api/generate/video.md Extends an existing video by providing a starting video path and a new prompt using the Veo API. Allows specifying a frame to extract from (e.g., the last frame) for continuation. ```python # Continue from existing video result = veo.generate_from_video( video_path="intro.mp4", prompt="The scene transitions to a forest", extract_at=-1.0, # Use last frame model="veo-3.0-fast-generate-preview" ) ``` -------------------------------- ### Generate Video with Frame Interpolation Source: https://context7.com/frontboat/veotools/llms.txt Creates a video by smoothly transitioning between a first and last frame, with interpolated content guided by a prompt. Useful for time-lapses or morphing effects. Supports different models and durations. ```python import veotools as veo from pathlib import Path veo.init() # Create smooth transition between two images result = veo.generate_with_interpolation( first_frame=Path("morning_scene.jpg"), last_frame=Path("night_scene.jpg"), prompt="Smooth time-lapse showing the passage of day to night", model="veo-3.1-generate-preview", duration_seconds=6 ) print(f"Interpolated video: {result.path}") # Visual morphing effect result = veo.generate_with_interpolation( first_frame=Path("face_young.jpg"), last_frame=Path("face_old.jpg"), prompt="Gradual aging transformation with realistic detail", model="veo-3.1-fast-generate-preview" ) ``` -------------------------------- ### Get Video Information Python Source: https://context7.com/frontboat/veotools/llms.txt Retrieves comprehensive metadata from a video file, including frame rate, duration, resolution, and frame count. Useful for validating video properties before processing. ```python import veotools as veo from pathlib import Path veo.init() info = veo.get_video_info(Path("video.mp4")) print(f"Duration: {info['duration']:.2f} seconds") print(f"Resolution: {info['width']}x{info['height']}") print(f"Frame rate: {info['fps']} fps") print(f"Total frames: {info['frame_count']}") # Use for validation if info['fps'] != 24: print("Warning: Video is not 24fps, may need conversion for Veo extension") ``` -------------------------------- ### Generate and Execute Scene Plan with Veotools Python SDK Source: https://github.com/frontboat/veotools/blob/main/docs/index.md This Python code snippet demonstrates how to initialize the Veotools SDK, generate a scene plan from an idea, and then execute that plan using a specified model. It prints the path to the final video if successful. ```python import veotools as veo veo.init() plan = veo.generate_scene_plan("Retro travel vlog", number_of_scenes=4) result = veo.execute_scene_plan(plan, model="veo-3.0-generate-001", auto_seed_last_frame=True) print("Final video:", result.final_result.path if result.final_result else "clips only") ``` -------------------------------- ### Run Video Plan with Veotools CLI Source: https://github.com/frontboat/veotools/blob/main/docs/index.md This command executes a video plan using the Veotools command-line interface. It takes an idea, an execution model, and an optional seed last frame argument. ```bash veo plan-run --idea "Retro travel vlog" --execute-model veo-3.0-generate-001 --seed-last-frame ``` -------------------------------- ### Initialize Veotools Library (Python) Source: https://context7.com/frontboat/veotools/llms.txt Initializes the veotools library by setting up logging and validating API credentials. This function must be called before using any generation functions. It can use environment variables or explicit API keys. ```python import veotools as veo # Basic initialization (uses GEMINI_API_KEY from environment) veo.init() # Initialize with explicit API key and custom log level veo.init(api_key="your-api-key", log_level="INFO") # After init, you can use all veotools functions result = veo.generate_from_text("A sunset over mountains") print(f"Video saved: {result.path}") ``` -------------------------------- ### Execute Existing Video Plan with CLI Source: https://github.com/frontboat/veotools/blob/main/readme.md Renders clips and stitches a video from a pre-generated storyboard JSON file. This command allows for re-execution of a plan with specified rendering models and frame seeding options. ```bash veo plan-execute --plan output-plans/x402.json --model veo-3.1-generate-preview --seed-last-frame ``` -------------------------------- ### Execute Scene Plan for Video Rendering Source: https://context7.com/frontboat/veotools/llms.txt Renders clips from a ScenePlan, optionally stitching them into a final video. Supports auto-seeding for visual continuity between clips and provides progress tracking. Can execute from a file path or a ScenePlan object. ```python import veotools as veo from pathlib import Path veo.init() # Execute from a saved plan file result = veo.execute_scene_plan( "plans/ocean_doc.json", model="veo-3.1-generate-preview", stitch=True, overlap=1.0, auto_seed_last_frame=True, seed_frame_offset=-0.25 ) # Access results print("Individual clips:") for clip in result.clip_results: print(f" {clip.path}") if result.final_result: print(f"Final stitched video: {result.final_result.path}") # Execute from a ScenePlan object with progress def track_progress(message, percent): print(f"[{percent}%] {message}") plan = veo.generate_scene_plan("Adventure story", number_of_scenes=3) result = veo.execute_scene_plan( plan, model="veo-3.0-fast-generate-001", on_progress=track_progress ) ``` -------------------------------- ### Generate Video from Text Prompt (Python) Source: https://context7.com/frontboat/veotools/llms.txt Generates a video from a text prompt using Google Veo models. Supports text-to-video generation with configurable parameters like model, duration, aspect ratio, negative prompts, and progress callbacks. Returns a VideoResult object. ```python import veotools as veo veo.init() # Basic text-to-video generation result = veo.generate_from_text( "A cat playing with a ball of yarn in a sunlit room", model="veo-3.1-generate-preview" ) print(f"Video: {result.path}") print(f"Duration: {result.metadata.duration}s") print(f"Resolution: {result.metadata.width}x{result.metadata.height}") # With progress callback and options def show_progress(message, percent): print(f"[{percent:3d}%] {message}") result = veo.generate_from_text( "A dancing robot in neon lights", model="veo-3.0-fast-generate-preview", duration_seconds=8, aspect_ratio="16:9", negative_prompt="blurry, low quality", on_progress=show_progress ) # Access full result data print(result.to_dict()) # Output: {'id': '...', 'path': '/output/videos/video_abc123.mp4', # 'metadata': {'fps': 24.0, 'duration': 8.0, 'width': 1920, 'height': 1080}} ``` -------------------------------- ### Generate Video Continuation (Python) Source: https://context7.com/frontboat/veotools/llms.txt Creates a video continuation from an existing video clip by extracting a frame and generating new content that matches the visual style. Allows specifying the extraction point by time (seconds) or from the end (-1.0 for 1 second before end). ```python import veotools as veo from pathlib import Path veo.init() # Continue a video from its last frame result = veo.generate_from_video( video_path=Path("scene1.mp4"), prompt="The character walks through the door into a magical garden", extract_at=-1.0, # 1 second before end (negative = from end) model="veo-3.1-generate-preview" ) print(f"Continuation: {result.path}") # Continue from a specific timestamp result = veo.generate_from_video( video_path=Path("movie.mp4"), prompt="The action intensifies with dramatic lighting", extract_at=5.0, # Extract frame at 5 seconds model="veo-3.0-fast-generate-preview", aspect_ratio="16:9" ) ``` -------------------------------- ### Generate Scene Plan using Gemini Source: https://context7.com/frontboat/veotools/llms.txt Uses Gemini to generate a structured, multi-scene storyboard from a high-level concept. The output is a ScenePlan object containing detailed information for each clip, including cinematography and dialogue. Plans can be saved to a file. ```python import veotools as veo veo.init() # Generate a 4-scene plan plan = veo.generate_scene_plan( "A retro 80s music video about summer love", number_of_scenes=4, additional_context="Keep the tone nostalgic and upbeat", model="gemini-2.5-pro" ) # Inspect the generated plan for clip in plan.clips: print(f"Clip {clip.id}:") print(f" Shot: {clip.shot.composition}") print(f" Action: {clip.visual_details.action}") print(f" Location: {clip.scene.location}") print(f" Duration: {clip.duration_sec}s") # Save plan to file for later use plan_with_save = veo.generate_scene_plan( "Documentary about ocean life", number_of_scenes=6, character_description="Marine biologist narrator", video_type="documentary", video_characteristics="cinematic, 4K, underwater footage", camera_angle="wide establishing shots", save_path="plans/ocean_doc.json" ) ``` -------------------------------- ### Generate Video from Text using VeoTools Source: https://github.com/frontboat/veotools/blob/main/docs/api/generate/video.md Generates a video from a text prompt using the Veo API. Supports basic generation and includes optional progress tracking callbacks. Requires the 'veotools' library. ```python import veotools as veo veo.init() # Basic generation result = veo.generate_from_text( prompt="A cat playing piano", model="veo-3.0-fast-generate-preview" ) # With progress tracking def on_progress(message: str, percent: int): print(f"{message}: {percent}%") result = veo.generate_from_text( prompt="Sunset over mountains", model="veo-3.0-fast-generate-preview", on_progress=on_progress ) ``` -------------------------------- ### Generate Video with Reference Images Source: https://context7.com/frontboat/veotools/llms.txt Generates a video using up to three reference images for character consistency, scene elements, or visual style. Supports specifying duration, aspect ratio, and resolution. ```python import veotools as veo from pathlib import Path veo.init() # Use character reference images for consistency result = veo.generate_with_reference_images( prompt="A character walking confidently through a busy marketplace", reference_images=[ "character_front.jpg", "character_side.jpg", "marketplace_style.jpg" ], model="veo-3.1-generate-preview", duration_seconds=8 ) print(f"Video with references: {result.path}") # With Path objects refs = [Path("ref1.png"), Path("ref2.png")] result = veo.generate_with_reference_images( prompt="The scene unfolds with matching visual style", reference_images=refs, model="veo-3.1-fast-generate-preview", aspect_ratio="16:9", resolution="1080p" ) ``` -------------------------------- ### Stitch Videos with VeoTools Python Source: https://context7.com/frontboat/veotools/llms.txt Combines multiple video files into a single seamless video using FFmpeg. Supports optional overlap trimming for smooth transitions and preserves audio alignment. Allows for custom overlap durations and progress tracking. ```python import veotools as veo from pathlib import Path veo.init() # Stitch videos with default 1-second overlap video_files = [ Path("clip1.mp4"), Path("clip2.mp4"), Path("clip3.mp4") ] result = veo.stitch_videos(video_files) print(f"Stitched video: {result.path}") print(f"Total duration: {result.metadata.duration}s") # Stitch without overlap (hard cuts) result = veo.stitch_videos( video_files, overlap=0.0, output_path=Path("output/final_movie.mp4") ) # With progress tracking result = veo.stitch_videos( video_files, overlap=2.0, # 2-second crossfade trim on_progress=lambda msg, pct: print(f"Stitching: {msg} ({pct}%)") ) ``` -------------------------------- ### Generate Video from Image using VeoTools Source: https://github.com/frontboat/veotools/blob/main/docs/api/generate/video.md Creates a video from a static image and a text prompt using the Veo API. Specifies the image path, a descriptive prompt, and the desired Veo model. ```python # Generate video from an image result = veo.generate_from_image( image_path="landscape.jpg", prompt="The landscape comes to life with moving clouds", model="veo-3.0-fast-generate-preview" ) ``` -------------------------------- ### Build Video Workflows with VeoTools Bridge API Python Source: https://context7.com/frontboat/veotools/llms.txt Provides a fluent, chainable interface for building multi-step video workflows. Handles media queue management, generation, and stitching in a single declarative chain. Supports progress tracking and various workflow types like image-to-video. ```python import veotools as veo from pathlib import Path veo.init() # Chain multiple operations def progress(msg, pct): print(f"[{pct:3d}%] {msg}") final_path = ( veo.Bridge("mountain_story") .with_progress(progress) .generate("Sunrise over misty mountains, warm light flooding the valley") .generate("A soaring eagle glides through the peaks") .generate("The eagle lands as dusk settles over the range") .stitch(overlap=1.0) .save(Path("output/mountain_story.mp4")) ) print(f"Final video: {final_path}") # Image-to-video workflow bridge = ( veo.Bridge("portrait_animation") .add_media("portrait.jpg") .generate("The person slowly turns and smiles warmly") .generate("They begin walking toward the camera") .stitch() ) result_path = bridge.save() # Generate transitions between scenes bridge = ( veo.Bridge("with_transitions") .generate("Opening scene in a forest") .generate("Mysterious cave entrance") .generate_transition("Magical portal effect") .stitch(overlap=0.5) ) ``` -------------------------------- ### Generate Storyboard JSON with CLI Source: https://github.com/frontboat/veotools/blob/main/readme.md Generates only the storyboard (structured JSON) for a video based on a given idea and number of scenes. The output is saved to a specified JSON file. ```bash veo plan --idea "Retro travel vlog" --scenes 4 --save output-plans/vlog.json --json ``` -------------------------------- ### Extend Video using Veo 3.1 Source: https://context7.com/frontboat/veotools/llms.txt Extends an existing video by 7 seconds using Veo's native video extension feature. It maintains visual continuity and can be chained multiple times. Input video must meet specific format requirements. ```python import veotools as veo from pathlib import Path veo.init() # Extend a video with content guidance result = veo.extend_video( video_path=Path("intro.mp4"), # Must be MP4, 1-30s, 24fps, 720p/1080p prompt="Continue with a dramatic reveal as the camera pans right", model="veo-3.1-generate-preview" ) print(f"Extended video: {result.path}") print(f"Extension duration: {result.metadata.duration}s") # Always 7 seconds # Chain multiple extensions original = Path("scene.mp4") extended1 = veo.extend_video(original, "Action continues building") extended2 = veo.extend_video(extended1.path, "Climactic moment arrives") ``` -------------------------------- ### get_video_info() Source: https://context7.com/frontboat/veotools/llms.txt Retrieves comprehensive metadata from a video file, including frame rate, duration, resolution, and frame count. ```APIDOC ## GET /get_video_info ### Description Retrieves comprehensive metadata from a video file including frame rate, duration, resolution, and frame count. ### Method GET ### Endpoint /get_video_info ### Parameters #### Query Parameters - **video_path** (Path) - Required - The path to the video file. ### Request Example ```json { "video_path": "video.mp4" } ``` ### Response #### Success Response (200) - **duration** (float) - The duration of the video in seconds. - **width** (int) - The width of the video in pixels. - **height** (int) - The height of the video in pixels. - **fps** (float) - The frame rate of the video. - **frame_count** (int) - The total number of frames in the video. #### Response Example ```json { "duration": 60.5, "width": 1920, "height": 1080, "fps": 30.0, "frame_count": 1815 } ``` ``` -------------------------------- ### Veo 3.1 Advanced Features with Python Source: https://github.com/frontboat/veotools/blob/main/readme.md Showcases advanced Veo 3.1 features using the Veotools Python API, including extending existing videos, generating content with reference images for consistency, and interpolating between frames. ```python from veotools import extend_video, generate_with_reference_images, generate_with_interpolation from pathlib import Path # Extend an existing video (7-second extensions, up to 20x) result = extend_video( video_path=Path("input.mp4"), prompt="Continue with a dramatic reveal", model="veo-3.1-generate-preview" ) # Generate with reference images for character/scene consistency result = generate_with_reference_images( prompt="A character walking through the forest", reference_images=["char_ref.jpg", "forest_ref.jpg"], model="veo-3.1-generate-preview" ) # Interpolate between first and last frames result = generate_with_interpolation( first_frame=Path("start.jpg"), last_frame=Path("end.jpg"), prompt="Smooth transition showing time passing", model="veo-3.1-generate-preview" ) ``` -------------------------------- ### Stitch Videos with Custom Transitions Python Source: https://context7.com/frontboat/veotools/llms.txt Stitches main video clips together, inserting custom transition videos between each pair. Requires one less transition video than the number of main video clips. ```python import veotools as veo from pathlib import Path veo.init() # Insert transition videos between scenes main_videos = [ Path("scene1.mp4"), Path("scene2.mp4"), Path("scene3.mp4") ] transitions = [ Path("fade_transition1.mp4"), Path("fade_transition2.mp4") ] result = veo.stitch_with_transitions( main_videos, transitions, # Must have len(main_videos) - 1 transitions output_path=Path("final_with_transitions.mp4") ) print(f"Final video: {result.path}") ``` -------------------------------- ### stitch_with_transitions() Source: https://context7.com/frontboat/veotools/llms.txt Stitches videos with custom transition videos inserted between each pair of main clips. ```APIDOC ## POST /stitch_with_transitions ### Description Stitches videos with custom transition videos inserted between each pair of main clips. ### Method POST ### Endpoint /stitch_with_transitions ### Parameters #### Query Parameters - **main_videos** (list[Path]) - Required - A list of Path objects for the main video clips. - **transitions** (list[Path]) - Required - A list of Path objects for the transition videos. Must have `len(main_videos) - 1` transitions. - **output_path** (Path) - Optional - The path where the final video will be saved. Defaults to a temporary path. ### Request Body ```json { "main_videos": [ "scene1.mp4", "scene2.mp4", "scene3.mp4" ], "transitions": [ "fade_transition1.mp4", "fade_transition2.mp4" ], "output_path": "final_with_transitions.mp4" } ``` ### Response #### Success Response (200) - **path** (Path) - The path to the newly created final video file. #### Response Example ```json { "path": "final_with_transitions.mp4" } ``` ``` -------------------------------- ### Bridge API Source: https://context7.com/frontboat/veotools/llms.txt Provides a fluent, chainable interface for building multi-step video workflows. Handles media queue management, generation, and stitching in a single declarative chain. ```APIDOC ## POST /Bridge ### Description Initiates a video workflow using a chainable interface. Allows for generation, stitching, and saving of video content. ### Method POST ### Endpoint /Bridge ### Parameters #### Query Parameters - **workflow_name** (string) - Required - A name for the workflow. - **progress_callback** (callable) - Optional - A callback function for progress updates. ### Operations: - **with_progress(callback)**: Sets a callback for progress updates. - **generate(prompt)**: Generates video content based on a text prompt. - **add_media(path)**: Adds an existing media file to the workflow. - **generate_transition(prompt)**: Generates a transition video. - **stitch(overlap)**: Stitches the generated or added media with optional overlap. - **save(output_path)**: Saves the final video to the specified path. ### Request Example (Generate and Stitch) ```json { "workflow_name": "mountain_story", "operations": [ { "type": "generate", "prompt": "Sunrise over misty mountains, warm light flooding the valley" }, { "type": "generate", "prompt": "A soaring eagle glides through the peaks" }, { "type": "generate", "prompt": "The eagle lands as dusk settles over the range" }, { "type": "stitch", "overlap": 1.0 }, { "type": "save", "output_path": "output/mountain_story.mp4" } ] } ``` ### Response #### Success Response (200) - **path** (Path) - The path to the final saved video file. #### Response Example ```json { "path": "output/mountain_story.mp4" } ``` ``` -------------------------------- ### MCP API Functions Source: https://context7.com/frontboat/veotools/llms.txt JSON-first API functions designed for Model Context Protocol (MCP) server integration. Provides non-blocking job lifecycle management. ```APIDOC ## GET /preflight ### Description Checks system prerequisites for MCP server integration. ### Method GET ### Endpoint /preflight ### Response #### Success Response (200) - **ok** (boolean) - Indicates if the system is ready. - **provider** (string) - The name of the current provider. - **ffmpeg** (dict) - Information about FFmpeg installation status. - **installed** (boolean) - Whether FFmpeg is installed. - **base_path** (string) - The base output path for operations. #### Response Example ```json { "ok": true, "provider": "local", "ffmpeg": { "installed": true }, "base_path": "/app/outputs" } ``` ## GET /version ### Description Retrieves version information for veotools and its dependencies. ### Method GET ### Endpoint /version ### Response #### Success Response (200) - **veotools** (string) - The version of veotools. - **dependencies** (dict) - A dictionary of dependency versions. - **google-genai** (string) - The version of google-genai. #### Response Example ```json { "veotools": "1.2.0", "dependencies": { "google-genai": "0.7.0" } } ``` ## GET /list_models ### Description Lists available models, optionally including remote models. ### Method GET ### Endpoint /list_models ### Parameters #### Query Parameters - **include_remote** (boolean) - Optional - Whether to include remote models. Defaults to false. ### Response #### Success Response (200) - **models** (list[dict]) - A list of available models. - **id** (string) - The model identifier. - **capabilities** (dict) - The capabilities of the model. - **supports_audio** (boolean) - Whether the model supports audio processing. #### Response Example ```json { "models": [ { "id": "model-1", "capabilities": { "supports_audio": true } }, { "id": "model-2", "capabilities": { "supports_audio": false } } ] } ``` ``` -------------------------------- ### MCP API Functions for VeoTools Python Source: https://context7.com/frontboat/veotools/llms.txt JSON-first API functions designed for Model Context Protocol (MCP) server integration. Provides non-blocking job lifecycle management, system prerequisite checks, version information retrieval, and model listing. ```python import veotools as veo import time veo.init() # Check system prerequisites status = veo.preflight() print(f"System ready: {status['ok']}") print(f"Provider: {status['provider']}") print(f"FFmpeg: {status['ffmpeg']['installed']}") print(f"Output path: {status['base_path']}") # Get version information versions = veo.version() print(f"veotools: {versions['veotools']}") print(f"google-genai: {versions['dependencies']['google-genai']}") # List available models models = veo.list_models(include_remote=True) for model in models['models']: caps = model['capabilities'] print(f"{model['id']}: audio={caps.get('supports_audio', False)}") ``` -------------------------------- ### stitch_videos() Source: https://context7.com/frontboat/veotools/llms.txt Combines multiple video files into a single seamless video. Supports optional overlap trimming for smooth transitions and preserves audio alignment using FFmpeg. ```APIDOC ## POST /stitch_videos ### Description Combines multiple video files into a single seamless video with optional overlap trimming for smooth transitions. Preserves audio alignment using FFmpeg. ### Method POST ### Endpoint /stitch_videos ### Parameters #### Query Parameters - **video_files** (list[Path]) - Required - A list of Path objects pointing to the video files to stitch. - **overlap** (float) - Optional - The duration in seconds for overlap trimming. Defaults to 1.0 second for smooth transitions. Set to 0.0 for hard cuts. - **output_path** (Path) - Optional - The path where the stitched video will be saved. Defaults to a temporary path. - **on_progress** (callable) - Optional - A callback function to track the stitching progress. It receives a message string and a percentage. ### Request Body ```json { "video_files": [ "clip1.mp4", "clip2.mp4", "clip3.mp4" ], "overlap": 1.0, "output_path": "output/final_movie.mp4", "on_progress": "function(msg, pct) { ... }" } ``` ### Response #### Success Response (200) - **path** (Path) - The path to the newly created stitched video file. - **metadata** (dict) - A dictionary containing metadata about the stitched video, including 'duration'. #### Response Example ```json { "path": "/tmp/stitched_video.mp4", "metadata": { "duration": 123.45 } } ``` ``` -------------------------------- ### Extract Frames from Video Python Source: https://context7.com/frontboat/veotools/llms.txt Extracts individual frames from video files at specified time offsets. Can extract a single frame or multiple frames to a directory. Useful for creating thumbnails or analyzing video content. ```python import veotools as veo from pathlib import Path veo.init() # Extract single frame frame_path = veo.extract_frame( Path("video.mp4"), time_offset=-1.0 # 1 second from end ) print(f"Frame saved: {frame_path}") # Extract frame at specific time frame = veo.extract_frame( Path("movie.mp4"), time_offset=30.5, # At 30.5 seconds output_path=Path("thumbnail.jpg") ) # Extract multiple frames frame_paths = veo.extract_frames( Path("video.mp4"), times=[0.0, 5.0, 10.0, -2.0, -1.0], # Start, 5s, 10s, 2s from end, 1s from end output_dir=Path("extracted_frames/") ) print(f"Extracted {len(frame_paths)} frames") ``` -------------------------------- ### extract_frame() and extract_frames() Source: https://context7.com/frontboat/veotools/llms.txt Extracts individual frames from video files at specified time offsets. Useful for creating thumbnails or analyzing video content. ```APIDOC ## POST /extract_frame ### Description Extracts a single frame from a video file at a specified time offset. ### Method POST ### Endpoint /extract_frame ### Parameters #### Query Parameters - **video_path** (Path) - Required - The path to the input video file. - **time_offset** (float) - Required - The time offset in seconds from the beginning of the video. Negative values indicate offsets from the end of the video. - **output_path** (Path) - Optional - The path to save the extracted frame image. If not provided, a temporary path is used. ### Request Body ```json { "video_path": "video.mp4", "time_offset": -1.0, "output_path": "thumbnail.jpg" } ``` ### Response #### Success Response (200) - **path** (Path) - The path to the saved extracted frame image. #### Response Example ```json { "path": "thumbnail.jpg" } ``` ## POST /extract_frames ### Description Extracts multiple frames from a video file at specified time offsets. ### Method POST ### Endpoint /extract_frames ### Parameters #### Query Parameters - **video_path** (Path) - Required - The path to the input video file. - **times** (list[float]) - Required - A list of time offsets in seconds. Negative values indicate offsets from the end of the video. - **output_dir** (Path) - Required - The directory where the extracted frame images will be saved. ### Request Body ```json { "video_path": "video.mp4", "times": [0.0, 5.0, 10.0, -2.0, -1.0], "output_dir": "extracted_frames/" } ``` ### Response #### Success Response (200) - **paths** (list[Path]) - A list of paths to the saved extracted frame images. #### Response Example ```json { "paths": [ "extracted_frames/frame_0.jpg", "extracted_frames/frame_1.jpg", "extracted_frames/frame_2.jpg", "extracted_frames/frame_3.jpg", "extracted_frames/frame_4.jpg" ] } ``` ``` -------------------------------- ### Configure Safety Settings for VeoTools Video Generation Source: https://github.com/frontboat/veotools/blob/main/docs/api/generate/video.md Applies safety settings to control the type of content generated by the Veo API. Uses `google.genai.types.SafetySetting` to define categories and blocking thresholds. ```python from google.genai import types safety_settings = [ types.SafetySetting( category="HARM_CATEGORY_HARASSMENT", threshold="BLOCK_ONLY_HIGH" ) ] result = veo.generate_from_text( prompt="A friendly conversation", safety_settings=safety_settings ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.