b3c993b4a06ea3f3c7e93d036195362f49400965
Anime Audio Helper
A batch-processing tool for MKV files, designed for high-quality AV1 video encoding and efficient audio handling. This script is tailored for anime and similar content, with a focus on automation, quality, and flexibility.
Features
- Batch processing of MKV files in the current directory
- Automatic VFR to CFR conversion using HandBrakeCLI (if needed)
- UTVideo intermediate for lossless video processing
- AV1 encoding via ffmpeg piped to SvtAv1EncApp2 (SVT-AV1-Essential fork)
- Audio extraction, normalization, and Opus encoding (with optional downmixing)
- Remuxing of supported audio codecs (AAC, Opus) without conversion
- Optional autocrop detection using ffmpeg cropdetect
- Per-file logging and organized output directories
- Automatic cleanup of temporary files
Requirements
- Python 3.7+
- The following tools must be in your PATH:
ffmpeg,ffprobemkvmerge,mkvpropeditsox,opusencmediainfo,HandBrakeCLISvtAv1EncApp2(SVT-AV1-Essential fork, must be named exactly as such)
Usage
python anime_audio_helper.py [--no-downmix] [--autocrop]
--no-downmix: Preserve original audio channel layout (do not force stereo)--autocrop: Automatically detect and crop black bars from video
Place your .mkv files in the script directory. Processed files will be moved to completed/, and originals to original/. Logs are saved in conv_logs/.
Configuration
- Audio remuxing: Edit the
REMUX_CODECSset at the top of the script to control which codecs are remuxed instead of converted. - SVT-AV1 parameters: Edit the
SVT_AV1_PARAMSdictionary at the top of the script to adjust encoding quality, speed, and other options.
Notes
- The script expects the SVT-AV1-Essential fork binary to be named
SvtAv1EncApp2. - All video encoding is 10-bit for maximum quality.
- Scene change detection, auto-tiling, and other advanced options are enabled by default.
- The script is designed for automation and minimal manual intervention.
License
See LICENSE for details.
Languages
Python
100%