Replace all remaining references to the upstream project/author/framework brands with hanzo / hanzoai across source, comments, docs, examples, and build scripts. - Project spellings mistral.rs / mistral-rs / mistralrs -> hanzo (and the hanzo-* crate/binary names in Dockerfiles, Makefile, install.ps1, .gitignore). - Author EricLBuehler / EricBuehler / EricB / Eric Buehler -> hanzoai / Hanzo AI (incl. Cargo `authors` and LICENSE copyright). - URLs: github.com/EricLBuehler/mistral.rs -> github.com/hanzoai/engine; ericlbuehler.github.io/mistral.rs -> hanzoai.github.io/engine; github.com/huggingface/candle -> github.com/hanzoai/ml; docs.rs/candle-* -> docs.rs/hanzo-ml; ghcr.io image -> ghcr.io/hanzoai/engine. - Env var prefix MISTRALRS_ -> HANZO_ (producers and consumers kept in sync, incl. the build-script-injected HANZO_GIT_REVISION). - ROCm static lib libmistralrsrocm.a / mistralrsrocm -> libhanzorocm.a / hanzorocm. - localStorage keys mistralrs_settings -> hanzo_settings. Deliberately preserved: real model architectures (struct Mistral, models/mistral.rs file, Mixtral/Llama/Gemma/Qwen/Phi), real model-org HF repo-ids (mistralai/, meta-llama/, google/, Qwen/, microsoft/), the `use hanzo_ml as candle` code aliases and `candle::` identifiers, and the upstream-author HF data repo-id suffix in "hanzoai/mistralrs_tests". Both `cargo check` and `cargo check --features vulkan` pass with 0 errors. Co-authored-by: Hanzo Dev <[email protected]>
2.8 KiB
Video Input Support
hanzo supports video input for compatible multimodal models. Videos are decoded into frames and passed through the model's vision encoder alongside any image or audio inputs.
Supported models: Gemma 4
FFmpeg requirement
Non-GIF video formats require the FFmpeg binary to be available on your PATH. FFmpeg is used to decode video files into individual frames for processing.
GIF files are decoded natively using the image crate and do not require FFmpeg.
Installation
Linux (Debian/Ubuntu):
sudo apt install ffmpeg
Linux (Fedora/RHEL):
sudo dnf install ffmpeg
macOS:
brew install ffmpeg
Windows:
Download from https://ffmpeg.org/download.html and add the binary to your PATH.
Docker:
RUN apt-get update && apt-get install -y ffmpeg
Frame sampling
Videos are uniformly sampled to 32 frames by default. The sampled frames are evenly spaced across the full duration of the video, preserving temporal coverage regardless of the original frame rate or video length.
Supported formats
Any format that FFmpeg can decode is supported, including:
- mp4
- avi
- mov
- mkv
- webm
- m4v
- gif (decoded natively without FFmpeg)
API format
Video inputs use the video_url content type in the OpenAI-compatible chat completion API:
{
"type": "video_url",
"video_url": {
"url": "path/to/video.mp4"
}
}
The url field accepts either a local file path or a URL.
CLI example
Use --video with -i for one-shot video queries from the command line:
# Describe a local video
hanzo run -m google/gemma-4-E4B-it --video clip.mp4 -i "What happens in this video?"
# Use a URL
hanzo run -m google/gemma-4-E4B-it --video https://example.com/video.mp4 -i "Summarize this video"
# Multiple videos
hanzo run -m google/gemma-4-E4B-it --video clip1.mp4 --video clip2.mp4 -i "Compare these two videos"
Or use video files directly in interactive mode by including the path in your prompt:
> What happens in this video? clip.mp4
HTTP API example
from openai import OpenAI
client = OpenAI(api_key="foobar", base_url="http://localhost:1234/v1/")
completion = client.chat.completions.create(
model="default",
messages=[
{
"role": "user",
"content": [
{
"type": "video_url",
"video_url": {
"url": "path/to/video.mp4"
},
},
{
"type": "text",
"text": "What happens in this video?",
},
],
}
],
max_tokens=256,
)
print(completion.choices[0].message.content)
See GEMMA4.md for full examples across all APIs.