AV1 Batch Video Transcoder
A high-performance batch video transcoding tool using NVIDIA's AV1 NVENC codec with intelligent audio/subtitle handling and automatic quality optimization.
✨ Key Features
- 8-bit AV1 Encoding - NVIDIA GPU acceleration (yuv420p, preset p7)
- Smart Audio Processing - Auto-detects bitrate, AAC for stereo, EAC3 for 5.1, downmixes, re-encodes only when needed
- Audio Filtering - Keep only best English audio + Commentary tracks (remove other languages)
- Subtitle Embedding - Auto-detects and embeds subtitles (.vtt, .srt, .ass, .ssa, .sub)
- Smart Resolution - Scales 4K→1080p, preserves lower resolutions
- Two-Phase Encoding - CQ mode first, automatic Bitrate fallback if size threshold exceeded
- Automatic Cleanup - Deletes originals + subtitles after successful encoding
- Test Mode - Encode one file, check compression ratio before batch processing
- Optional Language Tagging - Tag audio streams with language codes
- CSV Tracking - Detailed conversion logs with compression ratios
🚀 Quick Start
Requirements
- Python 3.8+
- FFmpeg with libfdk-aac support
- NVIDIA GPU (GeForce RTX 2060+, Quadro, or newer)
- NVIDIA CUDA Toolkit (for av1_nvenc support)
Installation
# Clone repository
git clone https://github.com/yourusername/conversion_project.git
cd conversion_project
# Install Python dependencies (if any needed in future)
# pip install -r requirements.txt
Basic Usage
# Encode a TV folder (smart mode)
python main.py "P:\tv\Show Name"
# Test single file before batch processing
python main.py "P:\tv\Show Name" --test
# Force specific quality (CQ 30)
python main.py "P:\movies\Movie" --cq 30
# Force bitrate mode
python main.py "P:\tv\Show" --m bitrate
# Specific resolution
python main.py "P:\movies" --r 720
# Tag audio with language
python main.py "P:\tv\Show" --language eng
📖 Documentation
- Full Usage Guide - Detailed commands, features, troubleshooting
- Technical Architecture - Module breakdown, workflow, config reference
⚙️ Configuration
Edit config.xml to customize:
<!-- CQ quality per content type -->
<cq>
<tv_1080>28</tv_1080>
<tv_720>32</tv_720>
<movie_1080>32</movie_1080>
<movie_720>34</movie_720>
</cq>
<!-- Audio bitrate buckets -->
<audio>
<stereo>
<high>192000</high>
<medium>160000</medium>
</stereo>
<multi_channel>
<medium>448000</medium>
<low>384000</low>
</multi_channel>
</audio>
<!-- Subtitle auto-detection -->
<subtitles>
<enabled>true</enabled>
<extensions>.vtt,.srt,.ass,.ssa,.sub</extensions>
</subtitles>
📊 Example Output
Input:
Show.S01E01.mkv (1.5GB)
Show.S01E01.en.vtt (subtitle)
Output:
Show.S01E01 - [EHX].mkv (450MB, subtitle embedded, audio tagged)
Compression: 1.5GB → 450MB (30% ratio, 70% reduction)
🔧 Encoding Specs
| Setting | Value |
|---|---|
| Video Codec | AV1 (av1_nvenc) |
| Bit Depth | 8-bit (yuv420p) |
| GPU Preset | p1 (high quality) |
| Audio Codec | AAC |
| Audio Mode | Smart (copy or re-encode) |
| Container | MKV |
| Subtitles | Embedded SRT |
🎯 Workflow
- Scan folder for video files
- Detect subtitles, audio streams, resolution
- Encode with AV1 codec (Phase 1: CQ)
- Check size threshold (default 75%)
- Retry with Bitrate mode if needed (Phase 2)
- Move encoded file to original location
- Cleanup original + subtitles + temp files
- Log results to CSV tracker
📋 Requirements
- Windows 10/11 or Linux
- NVIDIA GPU with NVENC support
- NVIDIA CUDA Toolkit 11.0+
- FFmpeg compiled with av1_nvenc support
- Python 3.8+
🛠️ Troubleshooting
Files not moving?
- Check
reduction_ratio_thresholdin config.xml (default 0.75) - Run with
--testto see compression ratio
Subtitles not embedding?
- Verify filename:
video.en.vttorvideo.vtt - Check config.xml
<subtitles><enabled>true</enabled>
Wrong audio quality?
- Adjust CQ values in config.xml per content type
- Use
--cqoverride:python main.py folder --cq 30
See Full Guide for more help.
📄 License
MIT
📞 Support
For detailed usage, see README_RESTRUCTURE.md
For technical architecture, see PROJECT_STRUCTURE.md
Description
Languages
Python
94.7%
Batchfile
5.3%