Something went wrong. Try again.
tool for taking a folder of videos and converting them to av1! best used with nekotrix's SVT-AV1-Essential
Something went wrong. Try again.
Files
Verified signature Signed by aria.pds.witchcraft.systems SHA256:WqtcVnDMrv1lnUlNah5k31iywFUI/DV+5yHzCTO4Vds Click to copy SHA
Verified signature Signed by aria.pds.witchcraft.systems SHA256:WqtcVnDMrv1lnUlNah5k31iywFUI/DV+5yHzCTO4Vds Click to copy SHA
Verified signature Signed by aria.pds.witchcraft.systems SHA256:WqtcVnDMrv1lnUlNah5k31iywFUI/DV+5yHzCTO4Vds Click to copy SHA
- Python 96%
- Shell 4%
README.md
auto-av1 #
Recursive AV1 re-encoder for a folder tree. Pipes ffmpeg into
nekotrix's SVT-AV1-Essential
fork of SvtAv1EncApp, copies audio/subtitles untouched, and writes a new file
next to each source.
Features #
- Walks a folder (and all subfolders) for video files
- Encodes with
ffmpeg | SvtAv1EncAppusing a 10-bityuv4mpegpipebridge - Keeps audio and subtitles untouched (
-c copy) - Defaults to
.webmoutput; falls back to.mkvwhen audio/subs aren't WebM-compatible (non Opus/Vorbis audio, or non-WebVTT subs) - Output is named
[original].av1.[webm|mkv]and placed next to the source - Optional in-place replacement: delete source and drop the
.av1suffix when the new file is smaller - Resume-friendly: skip sources that already have an AV1 sibling
Requirements #
ffmpegandffprobein$PATHSvtAv1EncAppin$PATH(stocksvt-av1, or the nekotrix SVT-AV1-Essential fork — recommended)- Python 3.10+ (if running the script directly)
Install #
Arch Linux (AUR) #
paru -S auto-av1-folder-git # or yay, etc.
From source (script) #
git clone https://tangled.org/aria.pds.witchcraft.systems/auto-av1
cd auto-av1
./auto-av1.py --help
Build a single-file binary (Nuitka) #
# deps: python, python-nuitka, gcc, patchelf
./build.sh
./auto-av1 --help
Produces a ~8 MB self-contained ELF executable (glibc-linked).
Usage #
auto-av1 [-h] [--crf CRF] [--preset PRESET] [--replace] [--resume] [--skip-av1] folder
| Flag | Description |
|---|---|
folder |
Root directory to scan recursively |
--crf CRF |
Constant Rate Factor, 1-70 in 0.25 steps (default 30) |
--preset PRESET |
Preset 0-13 (→ --preset) or speed name slower/slow/medium/fast/faster (→ --speed). Default 4 |
--replace |
When the new AV1 file is smaller, delete the source and rename the output, dropping the .av1 suffix |
--resume |
Skip any source that already has a .av1.{webm,mkv} sibling. Cheap filename check — avoids re-probing files from a previous run |
--skip-av1 |
Skip sources whose video stream is already AV1 (requires an ffprobe call per file) |
--progress {0,1,2} |
Forward --progress to SvtAv1EncApp (0=none, 1=basic, 2=detailed). Omit to use encoder default |
--log-sizes |
Print a one-line before/after size summary per encoded file (and a grand total at the end) |
--csv PATH |
Append per-file results to a CSV at PATH (creates header if new). Columns: source,output,action,source_bytes,output_bytes,delta_bytes,ratio_pct |
Examples #
Encode a library at CRF 28, preset 4:
auto-av1 /media/videos --crf 28 --preset 4
Slow, high-quality re-encode with named speed:
auto-av1 /media/videos --crf 26 --preset slow
Batch re-encode with resume, replacing smaller originals, skipping already-AV1 files:
auto-av1 /media/videos --crf 28 --preset 4 --resume --skip-av1 --replace
How it works #
For each video file:
ffprobereads streams. Skip if there's no video stream. If--skip-av1is set, also skip when the video stream is already AV1.- Pick container:
.webmif all audio is Opus/Vorbis and all subtitles are WebVTT; otherwise.mkv. - Decode with
ffmpegto 10-bityuv4mpegpipeon stdout. - Pipe into
SvtAv1EncAppwith--crfand--preset/--speed, producing a temporary.ivf. - Mux the
.ivfvideo with the original audio/subtitles/attachments (-c copy) into the final container. - If
--replaceand the new file is smaller than the source, delete the source and rename[name].av1.[ext]→[name].[ext].
Other encoder settings (tuning, psychovisual options, film grain, etc.) are left to SVT-AV1-Essential's defaults, which are tuned for good visual quality out of the box.
Notes #
- Only CRF and preset are exposed to keep the CLI small. If you need
different flags, edit the
svtlist inauto-av1.py. - Source files that already contain
.av1in the stem are skipped during the walk so re-running against a directory of previous outputs is a no-op. - Temporary
.av1.tmp.ivffiles are cleaned up on success and on failure.
License #
zlib