video-compressor

Compress videos with FFmpeg CRF encoding and remove silent static segments.

636|91|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/cat-xierluo/legal-skills --skill video-compressor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: video-compressor
Source: https://github.com/cat-xierluo/legal-skills/tree/main/skills/video-compressor
Command: npx skills add https://github.com/cat-xierluo/legal-skills --skill video-compressor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ffmpeg, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Large video files from screen recordings, course captures, and meeting recordings consume excessive storage and are slow to transfer, while long silent or static segments (breaks, black screens, idle waiting) waste viewing time.

Core Features & Use Cases

  • FFmpeg CRF Compression: Compress videos to low-bitrate MP4 using CRF adaptive quality mode, with automatic hardware detection that selects VideoToolbox hardware encoding on Apple Silicon or falls back to libx264 software encoding.
  • Silent/Static Segment Trimming: Detect segments that are simultaneously silent and visually static, cut them into a trimmed version, and save the removed clips with a JSON timestamp report for review.
  • Batch & Detach Modes: Compress multiple files or directories concurrently, and use --detach to run long encodes in the background immune to session termination.
  • Use Case: A 3-hour course recording with a 20-minute break in the middle can be trimmed of the silent idle segment and compressed from gigabytes down to a fraction of its size in one workflow.

Quick Start

Compress the video file lecture.mp4 and remove any silent static segments longer than two minutes using the video-compressor skill.

Frequently Asked Questions about video-compressor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress a video with FFmpeg using CRF mode?

Run the compress script with the input path: python3 scripts/compress.py -i <file>. It uses CRF 23 with a 2500k maxrate cap by default, which adapts bitrate to scene complexity and works well for screen recordings and courseware.

How to remove silent or static segments from a video automatically?

Use the trim_silences.py script with the video path. It detects segments that are both audio-silent and visually static, outputs a trimmed MP4, and saves the removed clips plus a JSON timestamp report for review.

Does FFmpeg hardware acceleration work on Apple Silicon Macs?

Yes. The tool auto-detects Apple Silicon and uses hevc_videotoolbox hardware encoding, achieving roughly 2-5x realtime for 1080p60 content. You can also force encoders with --codec hevc_vt, h264_vt, x264, or x265.

Why does ffmpeg fail with dyld Library not loaded on macOS?

This happens when brew upgrades a dependency like x265 without relinking ffmpeg. The script runs a smoke test that detects this crash and prints the fix: run brew upgrade ffmpeg or brew reinstall ffmpeg.

What video formats are supported for batch compression?

The tool accepts mp4, mov, avi, mkv, webm, flv, wmv, and ts files. You can pass multiple files, directories, or a mix, and it processes them concurrently with a configurable worker count.

When should I not use this video compression tool?

It is not suited for video editing, audio extraction, or format conversion tasks. It always outputs MP4 with AAC audio and never overwrites originals, so use a dedicated editor for cutting creative content.