Skip to content

EthanTwo2022/video_comp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

VideoComp

One-command video compression for paper submissions

Compress screen recordings, simulation captures, and experiment videos to H.264 MP4 — so they fit within conference supplementary material size limits.

Python 3.6+ FFmpeg License: MIT


Why?

Many conferences and journals (ICRA, RSS, CoRL, RA-L, etc.) impose strict file-size limits on supplementary videos. Raw screen recordings or simulation captures are often 10–100× too large. VideoComp turns a multi-step FFmpeg pipeline into a single command:

python compress_video.py "my_experiment.webm"
# → ~/Videos/compressedmp4/my_experiment.mp4  (typically 5-20× smaller)

Zero pip dependencies — only Python standard library + system FFmpeg.


Installation

Option A — conda (recommended)

Installs both Python and FFmpeg in one isolated environment:

conda create -n videocomp python=3 ffmpeg -y
conda activate videocomp
Option B — system FFmpeg
# Ubuntu / Debian
sudo apt install ffmpeg

# macOS
brew install ffmpeg

# Windows (winget)
winget install FFmpeg

Then use any Python ≥ 3.6 you already have.


Usage

Basic

# Single file
python compress_video.py "video.webm"

# Multiple files
python compress_video.py "video1.webm" "video2.mkv" "video3.avi"

# Custom output directory
python compress_video.py -o ./compressed "video.webm"

Tuning Quality (CRF)

CRF controls the quality–size trade-off (0–51, lower = better quality). Default: 23.

python compress_video.py --crf 18 "video.webm"   # high quality, larger file
python compress_video.py --crf 28 "video.webm"   # smaller file, still decent
CRF Quality Typical Use
18 Near-lossless High-quality demos, archival
23 Good (default) General screen recordings
28 Medium Most conference submissions
35+ Low Quick preview only

Tuning Speed (Preset)

Slower presets → better compression at the same quality. Default: medium.

python compress_video.py --preset slow "video.webm"

Available presets (fast → slow):

ultrafast · superfast · veryfast · faster · fast · medium · slow · slower · veryslow

Full Example

python compress_video.py --crf 20 --preset slow -o ~/Desktop "experiment.webm"

CLI Reference

usage: compress_video.py [-h] [-o OUTPUT_DIR] [--crf CRF] [--preset PRESET] input [input ...]

positional arguments:
  input                 Input video file(s)

options:
  -h, --help            Show this help message and exit
  -o, --output-dir DIR  Output directory (default: ~/Videos/compressedmp4)
  --crf N               CRF value 0-51, lower = better quality (default: 23)
  --preset P            Encoding speed preset (default: medium)

Tips for Paper Submissions

  • Start with --crf 23 (default). If the file is still too large, increase to 28 or 30.
  • Use --preset slow if you have time — it squeezes out ~10-20% more compression at the same CRF.
  • Most conferences accept H.264 MP4, which is exactly what this tool outputs.
  • Check your conference's size limit (commonly 50 MB or 100 MB) and adjust CRF accordingly.

Contributing

Issues and PRs are welcome! This is a simple tool — if you have ideas for useful features (e.g. target file-size mode, batch folder processing), feel free to open an issue.

License

MIT

About

One-command video compression for paper submissions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages