claude-video-enhance
Skill41 starsChanged 8 months agoMITView on GitHub
AI video enhancement using Real-ESRGAN (4x upscaling, 720p to 4K, 2-6GB VRAM), Practical-RIFE (frame interpolation for smooth slow motion, 60+ FPS at 720p), CodeFormer (face restoration for old/low-quality footage, adjustable fidelity), and rembg (transparent video via background removal, VP9+alpha or ProRes 4444). Use when user says "upscale", "enhance video", "4K", "super resolution", "frame interpolation", "slow motion AI", "smooth slow motion", "restore faces", "fix faces", "remove video background", "transparent video", "increase resolution", or "improve quality".
In this repository16 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- claude-video-analyzeSkill
- claude-video-audioSkill
- claude-video-captionSkill
- claude-video-createSkill
- claude-video-downloadSkill
- claude-video-editSkill
- claude-video-enhance-audioSkill
- claude-video-exportSkill
- claude-video-generateSkill
- claude-video-imageSkill
- claude-video-promoSkill
- claude-video-screenshotSkill
- claude-video-shortsSkill
- claude-videoSkill
- claude-video-transcodeSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Check free VRAM: nvidia-smi --query-gpu=memory.free --format=csv,noheader,nounits
- Distinctive: line 64
Create smooth slow motion by generating intermediate frames.
- Distinctive: line 87
Create cinematic slow motion from normal-speed footage
- Distinctive: line 123
Remove background from video to create transparent video.
- Distinctive: line 187
All operations load models on-demand and unload after processing.
- Distinctive: line 191
Always estimate time and disk space: before starting — confirm with user
- Very specific: line 192
Run bash scripts/preflight.sh "$INPUT" "$OUTPUT" before writes
- Distinctive: line 193
Never overwrite source video
- Distinctive: line 195
Use trap to clean up temp directories on failure
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
claude-video-enhance — AI Video Enhancement
Pre-Flight
- Activate venv:
source ~/.video-skill/bin/activate - Check free VRAM:
nvidia-smi --query-gpu=memory.free --format=csv,noheader,nounits - Get input video info:
ffprobe -v quiet -print_format json -show_streams "$INPUT" - Estimate processing time and disk space (frame-based pipelines are slow and large)
- Always warn the user about expected processing time before starting
AI Upscaling (Real-ESRGAN)
Upscale video resolution by 2x or 4x using AI super-resolution.
source ~/.video-skill/bin/activate
python3 scripts/video_enhance.py upscale "$INPUT" \
--scale 4 \
--output upscaled_4k.mp4Options:
--scale 2|4— Upscale factor (default: 4)--model realesrgan-x4plus— General purpose model (default)--model realesrgan-x4plus-anime— Optimized for anime/cartoon content--half— Use FP16 precision (faster, less VRAM, recommended)--output FILE— Output path--codec h264|hevc|av1— Output codec (default: h264_nvenc if available)
VRAM: 2-6GB with --half flag
Performance expectations:
- 720p → 4K (4x): 2-5 FPS → 10 min video (18,000 frames) takes ~1-2.5 hours
- 1080p → 4K (2x): 1-3 FPS → expect even longer
Pipeline:
- Extract all frames to temp directory (large disk usage: ~5x input size)
- Upscale each frame with Real-ESRGAN (GPU)
- Extract audio from original video
- Reassemble upscaled frames + audio into output video
- Clean up temp frames
Disk space warning: A 10-minute 30fps video creates 18,000 PNG frames. At 4K, each frame is ~10-20MB. Total temp space: 180-360GB. Ensure sufficient disk space.
Frame Interpolation (Practical-RIFE)
Create smooth slow motion by generating intermediate frames.
source ~/.video-skill/bin/activate
python3 scripts/video_enhance.py interpolate "$INPUT" \
--multi 2 \
--output smooth_slowmo.mp4Options:
--multi 2|4|8— Frame multiplication factor (default: 2)- 2x: 30fps → 60fps, or half-speed smooth slow motion
- 4x: 30fps → 120fps, or quarter-speed smooth slow motion
- 8x: 30fps → 240fps, extreme slow motion
--output FILE— Output path--fps-target N— Instead of multiplier, set target FPS
VRAM: 2-4GB
Performance: 60+ FPS for 2x interpolation at 720p. Slower at higher resolutions.
Use cases:
- Convert 30fps to 60fps for smoother playback
- Create cinematic slow motion from normal-speed footage
- Smooth out choppy screen recordings
Face Restoration (CodeFormer)
Restore degraded faces in old or low-quality video footage.
source ~/.video-skill/bin/activate
python3 scripts/video_enhance.py restore-faces "$INPUT" \
--fidelity 0.7 \
--output restored.mp4Options:
--fidelity 0.0-1.0— Quality-fidelity balance (default: 0.7)- 0.0 = Most beautiful (more hallucinated/enhanced)
- 0.5 = Balanced
- 0.7 = Recommended (good quality while staying faithful)
- 1.0 = Most faithful to original (minimal enhancement)
--bg-upscale— Also upscale background with Real-ESRGAN--output FILE— Output path
VRAM: 2-4GB (CodeFormer) + 2-4GB if --bg-upscale enabled
Pipeline:
- Extract frames
- Detect faces in each frame
- Restore each detected face with CodeFormer
- Optionally upscale background
- Reassemble with audio
Best for: Old family videos, low-resolution webcam footage, compressed video with face artifacts.
Background Removal (rembg)
Remove background from video to create transparent video.
source ~/.video-skill/bin/activate
python3 scripts/video_enhance.py remove-bg "$INPUT" \
--format webm \
--output transparent.webmOptions:
--format webm— VP9 with alpha channel (for web, default)--format prores— ProRes 4444 with alpha (for editing workflows)--model u2net_human_seg— Optimized for humans (default)--model u2net— General purpose (any subject)--model isnet-general-use— Alternative general model--output FILE— Output path
VRAM: 1-2GB (GPU) or CPU fallback
Performance: 5-10 FPS for 1080p
Output formats:
- WebM (VP9+alpha):
ffmpeg -c:v libvpx-vp9 -pix_fmt yuva420p output.webm - ProRes 4444:
ffmpeg -c:v prores_ks -profile:v 4 -pix_fmt yuva444p10le output.mov
Combined Enhancement Pipeline
Chain multiple enhancements on a single video:
python3 scripts/video_enhance.py upscale "$INPUT" --scale 2 --output /tmp/step1.mp4
python3 scripts/video_enhance.py restore-faces /tmp/step1.mp4 --fidelity 0.7 --output /tmp/step2.mp4
python3 scripts/video_enhance.py interpolate /tmp/step2.mp4 --multi 2 --output final_enhanced.mp4The script extracts frames once and applies multiple enhancements to minimize I/O when using --pipeline mode:
python3 scripts/video_enhance.py pipeline "$INPUT" \
--upscale 2 --restore-faces 0.7 --interpolate 2 \
--output final_enhanced.mp4Time and Space Estimates
| Operation | Input | Time | Temp Space |
| Upscale 4x | 10min 720p 30fps | 1-2.5 hours | 180-360GB |
| Upscale 2x | 10min 1080p 30fps | 2-4 hours | 300-600GB |
| Interpolate 2x | 10min 720p 30fps | ~5 minutes | Minimal |
| Face restore | 10min 720p 30fps | 30-60 minutes | 5-10GB |
| Remove BG | 10min 1080p 30fps | 30-60 minutes | 10-20GB |
Always run bash scripts/estimate_size.sh "$INPUT" before starting.
VRAM Management
| Operation | VRAM | Priority |
| Real-ESRGAN (--half) | 2-6GB | Medium |
| RIFE | 2-4GB | Light |
| CodeFormer | 2-4GB | Light |
| rembg (GPU) | 1-2GB | Light |
All operations load models on-demand and unload after processing. Multiple light models can coexist if combined VRAM < 12GB.
Safety Rules
- Always estimate time and disk space before starting — confirm with user
- Run
bash scripts/preflight.sh "$INPUT" "$OUTPUT"before writes - Never overwrite source video
- For upscaling: verify sufficient disk space for temp frames (can be 100x+ input size)
- Use trap to clean up temp directories on failure
- Confirm before operations estimated to take >30 minutes
Reference
Load references/video-enhance.md for model details, quality comparisons, and pipeline optimization.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

