AIPerf supports synthetic video generation for benchmarking multimodal models that process video inputs. This feature allows you to generate videos with different patterns, resolutions, frame rates, and durations to simulate various video understanding workloads.
Video generation requires FFmpeg to be installed on your system.
Ubuntu/Debian:
sudo apt update && sudo apt install ffmpegmacOS (with Homebrew):
brew install ffmpegFedora/RHEL/CentOS:
sudo dnf install ffmpegWindows (with Chocolatey):
choco install ffmpegThe synthetic video feature provides:
- Multiple synthesis types (moving shapes, grid clock patterns)
- Configurable resolution, frame rate, and duration
- Hardware-accelerated encoding options (CPU and GPU codecs)
- Base64-encoded video output for API requests
- MP4 and WebM format support
Generate videos with default settings (640x480, 4fps, 5 seconds):
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--endpoint /v1/chat/completions \
--url localhost:8000 \
--video-width 640 \
--video-height 480 \
--video-fps 4 \
--video-duration 5.0 \
--request-count 20Note: Video generation is disabled by default (width=0, height=0). You must specify non-zero width and height to enable video generation.
Control the resolution of generated videos:
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--url localhost:8000 \
--video-width 1920 \
--video-height 1080 \
--request-count 10Adjust temporal properties:
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--url localhost:8000 \
--video-width 640 \
--video-height 480 \
--video-fps 8 \
--video-duration 10.0 \
--request-count 15Parameters:
--video-fps: Frames per second (default: 4, recommended for models like Cosmos)--video-duration: Clip duration in seconds (default: 5.0)
AIPerf supports two built-in video patterns:
Generates videos with animated geometric shapes moving across the screen:
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--url localhost:8000 \
--video-width 640 \
--video-height 480 \
--video-synth-type moving_shapes \
--request-count 20Features:
- Multiple colored shapes (circles and rectangles)
- Smooth motion patterns
- Wrapping at screen edges
- Black background
Generates videos with a grid pattern and clock-like animation:
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--url localhost:8000 \
--video-width 640 \
--video-height 480 \
--video-synth-type grid_clock \
--request-count 20Features:
- Grid overlay
- Animated rotating elements
- Gray background
- Visual timing markers
Choose encoding codec based on your hardware and requirements:
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--url localhost:8000 \
--video-width 640 \
--video-height 480 \
--video-codec libvpx-vp9 \
--video-format webm \
--request-count 20Available CPU Codecs:
libvpx-vp9: VP9 encoding, BSD-licensed (default, WebM format)libx264: H.264 encoding, GPL-licensed, widely compatible (MP4 format)libx265: H.265 encoding, GPL-licensed, smaller file sizes, slower encoding (MP4 format)
For faster encoding with NVIDIA GPUs:
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--url localhost:8000 \
--video-width 1920 \
--video-height 1080 \
--video-codec h264_nvenc \
--request-count 50Available NVIDIA GPU Codecs:
h264_nvenc: H.264 GPU encodinghevc_nvenc: H.265 GPU encoding, smaller files
Control the number of videos per request:
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--url localhost:8000 \
--video-width 640 \
--video-height 480 \
--video-batch-size 2 \
--request-count 10Benchmark with small, low-framerate videos:
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--url localhost:8000 \
--video-width 320 \
--video-height 240 \
--video-fps 2 \
--video-duration 3.0 \
--video-synth-type moving_shapes \
--concurrency 4 \
--request-count 50Use case: Testing lightweight video processing or mobile-optimized models.
Test with high-resolution, longer videos:
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--url localhost:8000 \
--video-width 1920 \
--video-height 1080 \
--video-fps 8 \
--video-duration 10.0 \
--video-codec h264_nvenc \
--concurrency 2 \
--request-count 20Use case: Stress testing with high-quality video inputs.
Combine video with text prompts for multimodal testing:
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--url localhost:8000 \
--video-width 640 \
--video-height 480 \
--video-fps 4 \
--video-duration 5.0 \
--synthetic-input-tokens-mean 100 \
--synthetic-input-tokens-stddev 20 \
--output-tokens-mean 50 \
--concurrency 8 \
--request-count 100Use case: Simulating video question-answering or video captioning workloads.
Test with many short video clips:
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--url localhost:8000 \
--video-width 640 \
--video-height 360 \
--video-fps 4 \
--video-duration 2.0 \
--video-synth-type grid_clock \
--concurrency 16 \
--request-count 200Use case: Testing throughput with brief video clips.
AIPerf supports both WebM (default) and MP4 formats:
WebM format (default):
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--url localhost:8000 \
--video-width 640 \
--video-height 480 \
--video-format webm \
--video-codec libvpx-vp9 \
--request-count 20MP4 format:
aiperf profile \
--model your-model-name \
--endpoint-type chat \
--url localhost:8000 \
--video-width 640 \
--video-height 480 \
--video-format mp4 \
--video-codec libx264 \
--request-count 20Generated videos are automatically:
- Encoded using the specified codec
- Converted to base64 strings
- Embedded in API request payloads
This allows seamless integration with vision-language model APIs that accept base64-encoded video content.
- CPU codecs (
libvpx-vp9,libx264,libx265): Slower but universally available - GPU codecs (
h264_nvenc,hevc_nvenc): Much faster, requires NVIDIA GPU - Higher resolution and frame rates increase encoding time
Factors affecting video file size:
- Resolution: Higher dimensions = larger files
- Duration: Longer videos = larger files
- Frame rate: More frames = larger files
- Codec: H.265/HEVC produces smaller files than H.264
- For high-throughput testing: Use lower resolutions (320x240 or 640x480) and GPU encoding
- For quality testing: Use higher resolutions (1920x1080) with appropriate concurrency limits
- For API payload testing: Match your production video specifications
- For development: Start with small dimensions and short durations
If you see an error about FFmpeg not being installed:
Error: FFmpeg is required for video generation but was not found
Install with: sudo apt install ffmpeg
Follow the installation instructions in the Prerequisites section.
If NVIDIA GPU codecs fail:
Error: Encoder 'h264_nvenc' not found
Solutions:
- Verify NVIDIA GPU is available:
nvidia-smi - Check FFmpeg was compiled with NVENC support:
ffmpeg -encoders | grep nvenc - Fall back to CPU codec:
--video-codec libvpx-vp9 --video-format webmor--video-codec libx264 --video-format mp4
For high-resolution or long-duration videos:
- Reduce
--video-widthand--video-height - Decrease
--video-duration - Lower
--concurrency
The synthetic video generation feature enables comprehensive benchmarking of video understanding models with:
- Flexible video parameters (resolution, frame rate, duration)
- Multiple synthesis patterns for variety
- Hardware-accelerated encoding options
- Easy integration with multimodal APIs
Use synthetic videos to test your model's performance across different video characteristics without requiring large video datasets.