A professional-grade, hardware-accelerated video optimization suite featuring state-of-the-art visual quality-targeted encoding. This release introduces absolute feature and engine parity across the Python CustomTkinter GUI, PowerShell WPF GUI, and PowerShell CLI/TUI, powered by an advanced two-stage seeking engine.
This major release unifies both Python and PowerShell codebases under a single, highly precise visual-seeking architecture, yielding up to 300% faster VMAF seeks and absolute prevention of size-wasting quality overshoots.
- Two-Stage Plateau-Aware Binary Search (PABS): Eliminates VMAF overshooting (e.g., defaulting to CQ 1 when intermediate values like CQ 16 yield the same VMAF). Maps unreachable high quality targets exactly to the source's visual ceiling.
- Directional Refinement Scan (Stage 2): Scans the tested quality history, finds the nearest similar CQ in the search direction, and executes a secondary binary search in the interval to perfectly locate the plateau "knee."
- Three-Point Plateau Detection: Analyzes probed CQ trends. If 3 probed CQs have VMAF scores within a
0.05tolerance, a visual quality plateau is detected, and the search immediately narrows boundaries to the highest efficient CQ on that plateau. - One-Time Reference Caching: Extracts reference sample segments exactly once before seeking. Probing loops reuse these segments, cutting Disk I/O overhead and accelerating the seek phase by up to 300%.
- Dynamic Multi-Threaded VMAF: System-aware logical core allocation (
libvmaf=n_threads=N) dynamically scales calculation speed based on system logical processor counts. - Defensive Thread Safety: Protects background thread execution streams via extensive
try/exceptandtry/catchfallbacks to completely eradicate NoneType unpacking crashes. - Robust Platform-Independent Storage: Automatically persists GUI settings inside a secure, home-directory path (
Path.home() / ".Video_Optimizer"), making configuration immune to varying launch paths.
- Full Hardware Accel Detection: Auto-detects NVIDIA NVENC, AMD AMF, and Intel QSV capabilities via a real-world, 1-frame dummy encode pass.
- GPU-Accelerated Pipeline: Injects
-hwaccelflags to ensure hardware-driven decoding AND encoding for maximum throughput. - NVIDIA Visual Tuning: Automatically injects
-spatial_aq 1 -aq-strength 8for superior visual fidelity on NVENC hardware. - Intelligent Audio Compatibility: Analyzes audio streams and automatically transcodes to high-quality AAC only if the original audio is incompatible with the target container.
- Windows 10/11
- FFmpeg (Must be in your system
PATH)- Download FFmpeg here
- Crucial: Build must include
libvmaffor advanced quality targeting.
- Python 3.10+ (The smart launcher handles virtual environment setup automatically)
- Launch: Double-click
Video Optimizer.batin the repository root. - Smart Startup: The batch launcher will automatically verify Python, compile/update the virtual environment, install requirements, and boot up the CustomTkinter GUI.
- Optimize: Configure your visual targets (or use the recommended VMAF 93), choose your encoder, and click START PRO OPTIMIZATION.
The suite provides 100% functional and performance parity for terminal and script-focused workflows under Windows.
- PowerShell WPF GUI (
Video-Optimizer-GUI.ps1): A modern, system-aware XAML graphical interface. Supports multi-pass stepping ladders, VMAF ceilings, and real-time intra-file progress bars. - PowerShell Interactive TUI (
Video-Optimizer.ps1): A robust keyboard-driven CLI menu (Arrow keys, Enter) for fast, headless configurations. - Interrupt Safety: Press 'S' to safely skip the current video or 'Q' to quit the entire session gracefully. Temporary segments are safely unlinked in a robust
finallyblock.
irm https://raw.githubusercontent.com/BishnuMahali/Video-Optimizer/main/Video-Optimizer.ps1 | iex- Run
Video-Optimizer-GUI.ps1(for GUI) orVideo-Optimizer.ps1(for CLI) in PowerShell. - Configure options and initiate optimization.
This project is licensed under the MIT License — see the LICENSE file for details.
Copyright (c) 2026 Bishnu Mahali
These projects are simple utility scripts built to solve everyday problems. If you find them helpful in your workflow and would like to support me, any small contribution is deeply appreciated! ❤️