A safe, automated, and interactive video optimization script using FFmpeg to convert videos into efficient HEVC (H.265) or AV1 formats.
Designed to reduce file size while preserving quality — with built-in validation, safety checks, and an interactive menu.
- 🎯 Converts videos to HEVC (H.265) or AV1.
- 🎛️ Interactive Menu to configure settings on the fly.
- 🚀 Hardware Acceleration Support for NVIDIA (NVENC), AMD (AMF), and Intel (QSV), as well as CPU encoding.
- 📂 Recursive Directory Scanning to process nested folders.
- ⚙️ Configurable Settings including quality control (CRF, CQ, QP, etc.), presets, audio handling (Copy vs. AAC 128k), and output containers (Original, MKV, MP4).
- 🔄 Multi-Pass Quality Fallback allows providing up to 3 quality values (e.g.,
23,27,30). If the first setting results in a file larger than the source, the script automatically attempts the next. - 📊 Shows size comparison after encoding.
- 🧠 Skips already efficient codecs (HEVC / AV1).
- 🔍 Validates output (size + duration check).
- 🔁 Safe replacement system (with backup).
- 🚫 Detects failed or inefficient conversions.
- 📁 Moves problematic files to
Unoptimizable/. - 🧼 Cleans up temp files automatically.
- Windows PowerShell 5.1+
- FFmpeg with:
ffmpegffprobe
- For hardware acceleration: A supported NVIDIA, AMD, or Intel GPU.
👉 Download FFmpeg: https://ffmpeg.org/download.html
Run the script and use the interactive menu to configure your settings before starting the optimization process:
.\"Video Optimizer.ps1"In the interactive menu, when prompted for Quality, enter a comma-separated list of values (up to 3):
Enter new quality value or up to 3 comma-separated values (e.g., 23,27,30): 23,26,28
This tells the script to encode at quality 23 first. If the output is larger than the original video, it cleans up and attempts 26, and finally 28 if necessary.
This project is licensed under the MIT License — see the LICENSE file for details.