cleanvid downloads, strips metadata, re-encodes, and standardizes video files with parallel terminal progress. It is built as a single Bash script for Linux shell workflows.
| Area | What it does |
|---|---|
| Parallel processing | Handles multiple inputs concurrently instead of processing one file at a time. |
| Download mode | Downloads remote videos with wget, then sends successful downloads into the sterilization phase. |
| Metadata removal | Uses FFmpeg metadata and bit-exact flags to remove container and stream metadata. |
| Standard output | Produces H.264 video with AAC audio in an .mp4 container. |
| Encoder selection | Supports NVIDIA h264_nvenc by default and CPU libx264 with -c cpu. |
| Command | Required for |
|---|---|
ffmpeg |
Re-encoding and metadata removal |
ffprobe |
Duration detection for progress calculation |
awk / gawk |
Numeric formatting and progress math |
tput |
Terminal cursor control for live progress |
wget |
Remote download mode only |
The install command also uses curl to download the script.
On Debian/Ubuntu, install the required runtime tools with:
sudo apt install curl ffmpeg gawk wget ncurses-binInstall cleanvid directly into /usr/local/bin:
sudo sh -c 'curl -fsSL https://raw.githubusercontent.com/tarpetos/cleanvid/master/cleanvid -o /usr/local/bin/cleanvid && chmod +x /usr/local/bin/cleanvid'After that, run it from anywhere:
cleanvidTo update later, run the install command again:
sudo sh -c 'curl -fsSL https://raw.githubusercontent.com/tarpetos/cleanvid/master/cleanvid -o /usr/local/bin/cleanvid && chmod +x /usr/local/bin/cleanvid'cleanvid [-c cpu|cuda] [-k] [-w] INPUT1 [INPUT2 ...]| Option | Meaning |
|---|---|
-c cpu |
Encode video with CPU using libx264. |
-c cuda |
Encode video with NVIDIA h264_nvenc. This is the default mode. |
-k |
Keep original input files after successful processing. |
-w |
Treat inputs as remote URLs and download them before processing. |
By default, successful local inputs are removed after the sanitized output is written. Use -k when you want to keep the original files.
Process one local file:
cleanvid sample-5s-360p.mp4Process multiple local files:
cleanvid vacation.mp4 wedding.movKeep the original local file:
cleanvid -k sample-5s-360p.mp4Download and process a remote file:
cleanvid -w https://samplelib.com/mp4/sample-5s-360p.mp4Download, process, and keep the downloaded source file:
cleanvid -w -k https://samplelib.com/mp4/sample-5s-360p.mp4Use CPU encoding:
cleanvid -c cpu sample-5s-360p.mp4More examples are available in examples/README.md.
You can use this small public MP4 for testing:
https://samplelib.com/mp4/sample-5s-360p.mp4
To download it locally:
wget -O sample-5s-360p.mp4 https://samplelib.com/mp4/sample-5s-360p.mp4- Inputs are collected from local file paths or remote URLs.
- In wget mode, remote files are downloaded to temporary files first.
- Each successful input is probed with
ffprobeto read its duration. - Files are processed in parallel with
ffmpeg. - Metadata is stripped and streams are re-encoded to H.264/AAC.
- Outputs are written as sequential
videoN.mp4files. - Source files are removed after successful processing unless
-kis used.
FFmpeg is invoked with metadata stripping and bit-exact flags:
-map_metadata -1
-fflags +bitexact
-flags:v +bitexact
-flags:a +bitexact
Output filenames avoid existing videoN.mp4 files in the current directory.