This guide covers all configuration options available in Auto Clipper.
The .env file contains sensitive configuration that shouldn't be committed to version control.
# .env file
GEMINI_API_KEY=your_gemini_api_key_here
# Optional: Custom API endpoint (advanced users)
# GEMINI_API_ENDPOINT=https://custom-endpoint.com
# Optional: Request timeout in seconds (default: 30)
# API_TIMEOUT=30
# Optional: Maximum video duration in seconds (default: 3600)
# MAX_VIDEO_DURATION=3600For manual mode, create a JSON configuration file:
{
"input_video": "path/to/video.mp4",
"clips": [
{
"start": "00:00:10",
"end": "00:00:30",
"output": "clip1.mp4"
}
]
}- YouTube URLs:
https://www.youtube.com/watch?v=VIDEO_ID - Local video files:
.mp4,.mkv,.avi,.mov,.webm - Streaming URLs: Direct video URLs
{
"input_video": "video.mp4",
"video_settings": {
"quality": "720p",
"format": "mp4",
"audio_codec": "aac"
}
}{
"clips": [
{
"start": "00:01:30",
"end": "00:02:00",
"output": "my_clip.mp4"
}
]
}{
"clips": [
{
"start": "00:01:30.500",
"end": "00:02:00.750",
"output": "precise_clip.mp4",
"settings": {
"video_codec": "copy",
"audio_codec": "copy",
"quality": "high"
}
}
]
}HH:MM:SS- Hours:Minutes:SecondsHH:MM:SS.mmm- With millisecondsMM:SS- Minutes:Seconds (hours assumed 0)SS- Seconds only (minutes and hours assumed 0)
{
"clips": [
{"start": "01:23:45", "end": "01:24:15"}, // 1h 23m 45s to 1h 24m 15s
{"start": "05:30.500", "end": "06:00.250"}, // 5m 30.5s to 6m 0.25s
{"start": "30", "end": "60"}, // 30s to 60s
{"start": "0", "end": "15.5"} // 0s to 15.5s
]
}Currently supported models:
gemini-2.5-flash(default) - Fast and efficientgemini-pro- More detailed analysis (if available)
You can customize the AI analysis by modifying the prompt in the source code:
let prompt = format!(
"Analyze this YouTube video and suggest 3-5 viral-worthy clips (10-30 seconds each) from a {:.0} second video titled: {}
Return ONLY a JSON object in this exact format:
{{
\"input_video\": \"video.mp4\",
\"clips\": [
{{
\"start\": \"00:00:10\",
\"end\": \"00:00:25\",
\"output\": \"viral_clip_1.mp4\"
}}
]
}}
Focus on moments that would be most engaging for social media.",
duration, video_info.trim()
);- Default: 3-5 clips per video
- Range: 1-10 clips (configurable in prompt)
- Default: 10-30 seconds
- Optimal for social media: 15-20 seconds
- Maximum recommended: 60 seconds
viral_clip_1.mp4
viral_clip_2.mp4
viral_clip_3.mp4
{
"clips": [
{
"start": "00:00:10",
"end": "00:00:30",
"output": "intro_highlight.mp4"
},
{
"start": "00:02:15",
"end": "00:02:45",
"output": "main_point.mp4"
}
]
}{
"output_pattern": "{video_title}_{timestamp}_{duration}s.mp4",
"clips": [...]
}{
"quality_settings": {
"video_bitrate": "2M",
"audio_bitrate": "128k",
"resolution": "1280x720",
"fps": 30
}
}{
"preset": "social_media", // Options: social_media, high_quality, web_optimized
"clips": [...]
}ffmpeg -i input.mp4 -ss 00:00:10 -to 00:00:30 -c copy -avoid_negative_ts make_zero output.mp4{
"ffmpeg_options": {
"video_codec": "libx264",
"audio_codec": "aac",
"additional_flags": ["-preset", "fast", "-crf", "23"]
}
}{
"performance": {
"use_stream_copy": true, // Faster processing
"parallel_processing": false, // Process clips sequentially
"temp_directory": "/tmp" // Custom temp directory
}
}# Environment variables for yt-dlp
export YT_DLP_OPTIONS="--format best[height<=720] --max-filesize 100M"# For users behind corporate firewalls
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=https://proxy.company.com:8080{
"rate_limiting": {
"max_requests_per_minute": 10,
"retry_attempts": 3,
"retry_delay": 5
}
}# Environment variable
export RUST_LOG=debug # Options: error, warn, info, debug, trace{
"logging": {
"level": "info",
"output": "auto_clipper.log",
"format": "json"
}
}# .env file (recommended)
GEMINI_API_KEY=your_key_here
# Environment variable (alternative)
export GEMINI_API_KEY=your_key_here
# Command line (not recommended)
./auto-clipper --api-key your_key_here "https://youtube.com/..."# Secure .env file
chmod 600 .env
# Secure output directory
chmod 755 output/{
"platform": "tiktok",
"settings": {
"aspect_ratio": "9:16",
"max_duration": 60,
"resolution": "1080x1920"
}
}{
"platform": "youtube_shorts",
"settings": {
"aspect_ratio": "9:16",
"max_duration": 59,
"resolution": "1080x1920"
}
}{
"platform": "twitter",
"settings": {
"aspect_ratio": "16:9",
"max_duration": 140,
"max_file_size": "512MB"
}
}- Timestamps: Must be in valid format
- File paths: Must be accessible
- Duration: End time must be after start time
- API key: Must be valid Gemini API key
{
"error_handling": {
"continue_on_error": true,
"skip_invalid_clips": true,
"log_errors": true
}
}{
"input_video": "presentation.mp4",
"output_directory": "./clips",
"quality_settings": {
"preset": "social_media",
"video_codec": "libx264",
"audio_codec": "aac"
},
"clips": [
{
"start": "00:01:30",
"end": "00:02:00",
"output": "key_point_1.mp4",
"description": "Main argument introduction"
},
{
"start": "00:05:15",
"end": "00:05:45",
"output": "key_point_2.mp4",
"description": "Supporting evidence"
}
],
"metadata": {
"title": "Presentation Highlights",
"author": "Content Creator",
"date": "2026-01-24"
}
}{
"input_video": "video.mp4",
"clips": [
{"start": "30", "end": "60", "output": "clip.mp4"}
]
}# Cargo.toml additions
[features]
default = ["ai-analysis"]
ai-analysis = []
batch-processing = []
custom-codecs = []# Development
cp config.dev.json config.json
# Production
cp config.prod.json config.json
# Testing
cp config.test.json config.jsonNext Steps: Check the API Reference for technical implementation details.