working version

This commit is contained in:
TylerCG 2025-10-05 16:25:59 -04:00
parent 6b278ebc7d
commit 14ef29845d
8 changed files with 1021 additions and 90 deletions

View File

@ -53,11 +53,11 @@
<fallback> <fallback>
<bitrate_1080>1500k</bitrate_1080> <bitrate_1080>1500k</bitrate_1080>
<maxrate_1080>1750k</maxrate_1080> <maxrate_1080>1750k</maxrate_1080>
<bufsize_1080>2250k</bufsize_1080> <bufsize_1080>2750k</bufsize_1080>
<bitrate_720>900k</bitrate_720> <bitrate_720>900k</bitrate_720>
<maxrate_720>1250k</maxrate_720> <maxrate_720>1250k</maxrate_720>
<bufsize_720>1600k</bufsize_720> <bufsize_720>1800k</bufsize_720>
</fallback> </fallback>
<!-- Scale filter defaults --> <!-- Scale filter defaults -->
@ -77,9 +77,12 @@
<high>128000</high> <high>128000</high>
</stereo> </stereo>
<multi_channel> <multi_channel>
<low>160000</low> <low>192000</low>
<high>192000</high> <high>192000</high>
</multi_channel> </multi_channel>
<codec_rules>
<use_opus_below_kbps>128</use_opus_below_kbps>
</codec_rules>
</audio> </audio>
</config> </config>

26
conversion_tracker.csv Normal file
View File

@ -0,0 +1,26 @@
type,show,filename,original_size_MB,processed_size_MB,percentage
anime,Season 1,New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG -EHX.mkv,1513.63,242.08,16.0
anime,New Saga (2025),New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG -EHX.mkv,1510.89,269.8,17.9
anime,New Saga (2025),New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG -EHX.mkv,1507.74,284.62,18.9
anime,New Saga (2025),New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG -EHX.mkv,1499.67,339.71,22.7
anime,New Saga (2025),New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG -EHX.mkv,1508.09,226.82,15.0
anime,New Saga (2025),New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv,650.72,298.45,45.9
anime,New Saga (2025),New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG -EHX.mkv,1505.44,242.56,16.1
anime,New Saga (2025),New Saga - S01E05 - Reunion at Dawn h264 EAC3 WEBDL-1080p VARYG -EHX.mkv,891.84,299.91,33.6
anime,New Saga (2025),New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG -EHX.mkv,1514.95,211.47,14.0
anime,New Saga (2025),New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG -EHX.mkv,1505.5,222.61,14.8
anime,New Saga (2025),New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG -EHX.mkv,1499.79,267.68,17.8
anime,New Saga (2025),New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv,459.88,238.76,51.9
anime,You are Ms. Servant (2024),You Are Ms. Servant - S01E01 - My Fateful Encounter With You x264 AAC WEBDL-1080p VARYG -EHX.mkv,1404.32,300.44,21.4,CQ
anime,You are Ms. Servant (2024),You are Ms. Servant - S01E02 - You Want to Know x264 AAC WEBDL-1080p VARYG -EHX.mkv,1408.95,313.09,22.2,CQ
anime,You are Ms. Servant (2024),You are Ms. Servant - S01E03 - You Are Ms. Yuki x264 AAC WEBDL-1080p VARYG -EHX.mkv,1407.34,307.42,21.8,CQ
anime,You are Ms. Servant (2024),You are Ms. Servant - S01E04 - You Won't Miss Out x264 AAC HDTV-1080p SubsPlease -EHX.mkv,1401.62,323.88,23.1,CQ
anime,You are Ms. Servant (2024),You are Ms. Servant - S01E05 - What You Want to Protect x264 AAC WEBDL-1080p VARYG -EHX.mkv,1407.84,263.15,18.7,CQ
anime,You are Ms. Servant (2024),You are Ms. Servant - S01E06 - You're Lonelier Than I Thought x264 AAC WEBDL-1080p VARYG -EHX.mkv,1448.64,344.8,23.8,CQ
anime,You are Ms. Servant (2024),You are Ms. Servant - S01E07 - You've Finally Figured It Out x264 AAC WEBDL-1080p VARYG -EHX.mkv,1445.4,340.7,23.6,CQ
anime,You are Ms. Servant (2024),You are Ms. Servant - S01E08 - The Autumn With You and the Sauce x264 AAC WEBDL-1080p VARYG -EHX.mkv,1450.3,363.32,25.1,CQ
anime,You are Ms. Servant (2024),You are Ms. Servant - S01E09 - You and the Cultural Stage x264 AAC WEBDL-1080p VARYG -EHX.mkv,1450.71,268.45,18.5,CQ
anime,You are Ms. Servant (2024),You are Ms. Servant - S01E10 - You and the Forbidden Fruit x264 AAC WEBDL-1080p VARYG -EHX.mkv,1453.4,319.2,22.0,CQ
anime,You are Ms. Servant (2024),You are Ms. Servant - S01E11 - Your Prayers Are Gods' Prayers x264 AAC WEBDL-1080p VARYG -EHX.mkv,1454.6,310.35,21.3,CQ
anime,You are Ms. Servant (2024),You are Ms. Servant - S01E12 - The Joyous Tidings You All Bring x264 AAC WEBDL-1080p VARYG -EHX.mkv,1444.42,329.28,22.8,CQ
tv,Vikings (2013),Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence -EHX.mkv,1812.11,609.28,33.6,CQ
Can't render this file because it has a wrong number of fields in line 14.

136
core/ffmpeg_helper.py Normal file
View File

@ -0,0 +1,136 @@
# core/ffmpeg_helper.py
import json
import subprocess
from pathlib import Path
from typing import Tuple
from core.logger_helper import setup_logger
logger = setup_logger(Path(__file__).parent.parent / "logs")
# =============================
# STREAM ANALYSIS
# =============================
def get_audio_streams(input_file: Path):
"""Return a list of (index, channels, bitrate_kbps, lang)"""
cmd = [
"ffprobe", "-v", "error",
"-select_streams", "a",
"-show_entries", "stream=index,channels,bit_rate,tags=language",
"-of", "json", str(input_file)
]
result = subprocess.run(cmd, capture_output=True, text=True)
data = json.loads(result.stdout or "{}")
streams = []
for s in data.get("streams", []):
index = s["index"]
channels = s.get("channels", 2)
bitrate = int(int(s.get("bit_rate", 128000)) / 1000)
lang = s.get("tags", {}).get("language", "und")
streams.append((index, channels, bitrate, lang))
return streams
# =============================
# AUDIO DECISION LOGIC
# =============================
def choose_audio_settings(channels: int, bitrate_kbps: int, audio_config: dict) -> Tuple[str, int]:
"""
Return (codec, target_bitrate)
Rules:
- If 128 kbps or lower use Opus
- Otherwise use AAC
- Use audio_config to bucket bitrates.
"""
if channels == 2:
if bitrate_kbps <= 80:
target_br = audio_config["stereo"]["low"]
elif bitrate_kbps <= 112:
target_br = audio_config["stereo"]["medium"]
else:
target_br = audio_config["stereo"]["high"]
else:
if bitrate_kbps <= 176:
target_br = audio_config["multi_channel"]["low"]
else:
target_br = audio_config["multi_channel"]["high"]
# Opus threshold: <=128 kbps
threshold = audio_config.get("use_opus_below_kbps", 128)
codec = "libopus" if target_br <= threshold * 1000 else "aac"
return codec, target_br
# =============================
# FFMPEG COMMAND BUILDER
# =============================
def build_ffmpeg_command(input_file: Path, output_file: Path,
cq: int, width: int, height: int,
filter_flags: str, audio_config: dict):
"""Builds FFmpeg command with smart audio logic."""
streams = get_audio_streams(input_file)
logger.info(f"🎛 Detected {len(streams)} audio stream(s). Building command...")
cmd = [
"ffmpeg", "-y", "-i", str(input_file),
"-vf", f"scale={width}:{height}:flags={filter_flags}:force_original_aspect_ratio=decrease",
"-map", "0:v", "-map", "0:a", "-map", "0:s?",
"-c:v", "av1_nvenc", "-preset", "p1", "-cq", str(cq),
"-pix_fmt", "p010le"
]
for i, (index, channels, bitrate, lang) in enumerate(streams):
codec, br = choose_audio_settings(channels, bitrate, audio_config)
cmd += [
f"-c:a:{i}", codec,
f"-b:a:{i}", str(br),
f"-ac:{i}", str(channels),
f"-metadata:s:a:{i}", f"language={lang}"
]
cmd += ["-c:s", "copy", str(output_file)]
return cmd, streams
# =============================
# ENCODE RUNNER
# =============================
def run_encode(input_file: Path, output_file: Path, cq: int,
width: int, height: int, filter_flags: str,
audio_config: dict):
"""Handles encode, fallback logic, and returns size stats."""
cmd, streams = build_ffmpeg_command(input_file, output_file, cq, width, height, filter_flags, audio_config)
logger.info(f"🎬 Running FFmpeg CQ encode → {output_file.name}")
subprocess.run(cmd, check=True)
# Size check
orig_size = input_file.stat().st_size
out_size = output_file.stat().st_size
ratio = out_size / orig_size
logger.info(f"📦 Size: {orig_size/1e6:.2f}MB → {out_size/1e6:.2f}MB ({ratio:.1%})")
# Fallback logic
if ratio >= 0.5:
logger.warning(f"⚠️ Reduction too low ({ratio:.0%}), retrying with bitrate mode...")
output_file.unlink(missing_ok=True)
vb, maxrate, bufsize = (
("1500k", "1750k", "2250k") if height >= 1080
else ("900k", "1250k", "1600k")
)
cmd = [
"ffmpeg", "-y", "-i", str(input_file),
"-vf", f"scale={width}:{height}:flags={filter_flags}:force_original_aspect_ratio=decrease",
"-map", "0:v", "-map", "0:a", "-map", "0:s?",
"-c:v", "av1_nvenc", "-preset", "p1",
"-b:v", vb, "-maxrate", maxrate, "-bufsize", bufsize,
"-pix_fmt", "p010le"
]
for i, (index, channels, bitrate, lang) in enumerate(streams):
codec, br = choose_audio_settings(channels, bitrate, audio_config)
cmd += [
f"-c:a:{i}", codec,
f"-b:a:{i}", str(br),
f"-ac:{i}", str(channels),
f"-metadata:s:a:{i}", f"language={lang}"
]
cmd += ["-c:s", "copy", str(output_file)]
subprocess.run(cmd, check=True)
return orig_size, out_size

35
core/logger_helper.py Normal file
View File

@ -0,0 +1,35 @@
# core/logger_helper.py
import logging
from logging.handlers import RotatingFileHandler
from pathlib import Path
def setup_logger(log_folder: Path, log_file_name: str = "conversion.log", level=logging.INFO) -> logging.Logger:
"""
Sets up a logger that prints to console and writes to a rotating log file.
"""
log_folder.mkdir(parents=True, exist_ok=True)
log_file = log_folder / log_file_name
logger = logging.getLogger("conversion_logger")
logger.setLevel(level)
logger.propagate = False # Prevent duplicate logging if root logger exists
# Formatter with timestamp
formatter = logging.Formatter("%(asctime)s [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
# Console handler
console_handler = logging.StreamHandler()
console_handler.setFormatter(formatter)
console_handler.setLevel(level)
# File handler with rotation (max 5 MB per file, keep 3 backups)
file_handler = RotatingFileHandler(log_file, maxBytes=5*1024*1024, backupCount=3, encoding="utf-8")
file_handler.setFormatter(formatter)
file_handler.setLevel(level)
# Add handlers
if not logger.handlers:
logger.addHandler(console_handler)
logger.addHandler(file_handler)
return logger

0
core/process_helper.py Normal file
View File

0
core/tracker_helper.py Normal file
View File

638
logs/conversion.log Normal file
View File

@ -0,0 +1,638 @@
2025-10-05 10:24:06 [INFO] Processing: New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:24:19 [INFO] Copied New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG.mkv → New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:24:20 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 10:24:20 [INFO] - Stream #1: 2ch, src=und, orig≈128kbps → target=128.0kbps, tgt=eng
2025-10-05 10:24:20 [INFO] - Stream #2: 2ch, src=und, orig≈128kbps → target=128.0kbps, tgt=eng
2025-10-05 10:24:20 [INFO] Starting CQ encode: New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 10:30:32 [INFO] Processing: New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:30:46 [INFO] Copied New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG.mkv → New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:30:46 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 10:30:46 [INFO] - Stream #1: 2ch, src=und, orig≈128kbps → target=128.0kbps, tgt=eng
2025-10-05 10:30:46 [INFO] - Stream #2: 2ch, src=und, orig≈128kbps → target=128.0kbps, tgt=eng
2025-10-05 10:30:46 [INFO] Starting CQ encode: New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 10:32:25 [INFO] 📦 Original: 1513.63 MB → Encoded: 242.08 MB (16.0% of original)
2025-10-05 10:32:27 [INFO] Moved New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG -EHX.mkv → New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 10:32:27 [INFO] Tracked conversion: New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1513.63MB → 242.08MB (16.0%)
2025-10-05 10:32:28 [INFO] Deleted original and processing copy for New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:32:28 [INFO] Processing: New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:32:41 [INFO] Copied New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG.mkv → New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:32:42 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 10:32:42 [INFO] - Stream #1: 2ch, src=und, orig≈128kbps → target=128.0kbps, tgt=eng
2025-10-05 10:32:42 [INFO] - Stream #2: 2ch, src=und, orig≈128kbps → target=128.0kbps, tgt=eng
2025-10-05 10:32:42 [INFO] Starting CQ encode: New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 10:37:23 [INFO] Processing: New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:37:36 [INFO] Copied New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG.mkv → New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:37:36 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 10:37:36 [INFO] - Stream #1: 2ch, src=und, orig≈128kbps → target=128.0kbps
2025-10-05 10:37:36 [INFO] - Stream #2: 2ch, src=und, orig≈128kbps → target=128.0kbps
2025-10-05 10:37:36 [INFO] Starting CQ encode: New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 10:39:07 [INFO] 📦 Original: 1510.89 MB → Encoded: 269.80 MB (17.9% of original)
2025-10-05 10:39:10 [INFO] Moved New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG -EHX.mkv → New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 10:39:10 [INFO] Tracked conversion: New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1510.89MB → 269.8MB (17.9%)
2025-10-05 10:39:10 [INFO] Deleted original and processing copy for New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:39:10 [INFO] Processing: New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:39:24 [INFO] Copied New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG.mkv → New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:39:24 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 10:39:24 [INFO] - Stream #1: 2ch, src=und, orig≈128kbps → target=128.0kbps
2025-10-05 10:39:24 [INFO] - Stream #2: 2ch, src=und, orig≈128kbps → target=128.0kbps
2025-10-05 10:39:24 [INFO] Starting CQ encode: New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 10:40:53 [INFO] 📦 Original: 1507.74 MB → Encoded: 284.62 MB (18.9% of original)
2025-10-05 10:40:56 [INFO] Moved New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG -EHX.mkv → New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 10:40:56 [INFO] Tracked conversion: New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1507.74MB → 284.62MB (18.9%)
2025-10-05 10:40:56 [INFO] Deleted original and processing copy for New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:40:56 [INFO] Processing: New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:53:59 [INFO] Processing: New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:54:12 [INFO] Copied New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG.mkv → New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:54:12 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 10:54:55 [INFO] Processing: New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:55:08 [INFO] Copied New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG.mkv → New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:55:09 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 10:55:09 [INFO] - Stream #1: 2ch, src=und, orig≈128kbps → target=128.0kbps
2025-10-05 10:55:09 [INFO] - Stream #2: 2ch, src=und, orig≈128kbps → target=128.0kbps
2025-10-05 10:56:55 [INFO] Processing: New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:57:08 [INFO] Copied New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG.mkv → New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:57:08 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 10:57:08 [INFO] - Stream #1: 2ch, src=und, orig≈128kbps → target=128.0kbps
2025-10-05 10:57:08 [INFO] - Stream #2: 2ch, src=und, orig≈128kbps → target=128.0kbps
2025-10-05 10:57:08 [INFO] Starting CQ encode: New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 10:58:40 [INFO] 📦 Original: 1499.67 MB → Encoded: 339.71 MB (22.7% of original)
2025-10-05 10:58:43 [INFO] Moved New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG -EHX.mkv → New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 10:58:43 [INFO] Tracked conversion: New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1499.67MB → 339.71MB (22.7%)
2025-10-05 10:58:43 [INFO] Deleted original and processing copy for New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:58:43 [INFO] Processing: New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:58:57 [INFO] Copied New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG.mkv → New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 10:58:57 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 10:58:57 [INFO] - Stream #1: 2ch, src=und, orig≈128kbps → target=128.0kbps
2025-10-05 10:58:57 [INFO] - Stream #2: 2ch, src=und, orig≈128kbps → target=128.0kbps
2025-10-05 10:58:57 [INFO] Starting CQ encode: New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:00:34 [INFO] 📦 Original: 1508.09 MB → Encoded: 226.82 MB (15.0% of original)
2025-10-05 11:00:36 [INFO] Moved New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG -EHX.mkv → New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:00:36 [INFO] Tracked conversion: New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1508.09MB → 226.82MB (15.0%)
2025-10-05 11:00:36 [INFO] Deleted original and processing copy for New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:00:36 [INFO] Processing: New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:00:42 [INFO] Copied New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws.mkv → New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:00:42 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:00:42 [INFO] - Stream #1: 2ch, src=und, orig≈128kbps → target=128.0kbps
2025-10-05 11:00:42 [INFO] Starting CQ encode: New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:02:07 [INFO] Processing: New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:02:13 [INFO] Copied New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws.mkv → New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:02:13 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:02:13 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=224kbps, bucket_target=128.0kbps
2025-10-05 11:03:17 [INFO] Processing: New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:03:23 [INFO] Copied New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws.mkv → New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:03:23 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:03:23 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=224kbps, bucket_target=128.0kbps
2025-10-05 11:03:23 [INFO] Starting CQ encode: New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:04:56 [INFO] 📦 Original: 650.72 MB → Encoded: 298.45 MB (45.9% of original)
2025-10-05 11:04:59 [INFO] Moved New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv → New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:04:59 [INFO] Tracked conversion: New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv, 650.72MB → 298.45MB (45.9%)
2025-10-05 11:04:59 [INFO] Deleted original and processing copy for New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:04:59 [INFO] Processing: New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:05:12 [INFO] Copied New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG.mkv → New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:05:12 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:05:12 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:05:12 [INFO] - Stream #2: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:05:12 [INFO] Starting CQ encode: New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:06:52 [INFO] 📦 Original: 1505.44 MB → Encoded: 242.56 MB (16.1% of original)
2025-10-05 11:06:54 [INFO] Moved New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG -EHX.mkv → New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:06:54 [INFO] Tracked conversion: New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1505.44MB → 242.56MB (16.1%)
2025-10-05 11:06:54 [INFO] Deleted original and processing copy for New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:06:54 [INFO] Skipping: New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:06:54 [INFO] Processing: New Saga - S01E05 - Reunion at Dawn h264 EAC3 WEBDL-1080p VARYG.mkv
2025-10-05 11:07:02 [INFO] Copied New Saga - S01E05 - Reunion at Dawn h264 EAC3 WEBDL-1080p VARYG.mkv → New Saga - S01E05 - Reunion at Dawn h264 EAC3 WEBDL-1080p VARYG.mkv
2025-10-05 11:07:02 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:07:02 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=224kbps, bucket_target=128.0kbps
2025-10-05 11:07:02 [INFO] - Stream #2: 2ch, src=und, avg_bitrate=128kbps, metadata=224kbps, bucket_target=128.0kbps
2025-10-05 11:07:02 [INFO] Starting CQ encode: New Saga - S01E05 - Reunion at Dawn h264 EAC3 WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:08:32 [INFO] 📦 Original: 891.84 MB → Encoded: 299.91 MB (33.6% of original)
2025-10-05 11:08:34 [INFO] Moved New Saga - S01E05 - Reunion at Dawn h264 EAC3 WEBDL-1080p VARYG -EHX.mkv → New Saga - S01E05 - Reunion at Dawn h264 EAC3 WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:08:34 [INFO] Tracked conversion: New Saga - S01E05 - Reunion at Dawn h264 EAC3 WEBDL-1080p VARYG -EHX.mkv, 891.84MB → 299.91MB (33.6%)
2025-10-05 11:08:34 [INFO] Deleted original and processing copy for New Saga - S01E05 - Reunion at Dawn h264 EAC3 WEBDL-1080p VARYG.mkv
2025-10-05 11:08:34 [INFO] Skipping: New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:08:34 [INFO] Processing: New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:09:02 [INFO] Copied New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG.mkv → New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:09:03 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:09:03 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:09:03 [INFO] - Stream #2: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:09:03 [INFO] Starting CQ encode: New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:10:39 [INFO] 📦 Original: 1514.95 MB → Encoded: 211.47 MB (14.0% of original)
2025-10-05 11:10:41 [INFO] Moved New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG -EHX.mkv → New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:10:41 [INFO] Tracked conversion: New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1514.95MB → 211.47MB (14.0%)
2025-10-05 11:10:41 [INFO] Deleted original and processing copy for New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:10:41 [INFO] Skipping: New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:10:41 [INFO] Processing: New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:10:54 [INFO] Copied New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG.mkv → New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:10:55 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:10:55 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:10:55 [INFO] - Stream #2: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:10:55 [INFO] Starting CQ encode: New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:12:29 [INFO] 📦 Original: 1505.50 MB → Encoded: 222.61 MB (14.8% of original)
2025-10-05 11:12:31 [INFO] Moved New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG -EHX.mkv → New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:12:31 [INFO] Tracked conversion: New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1505.5MB → 222.61MB (14.8%)
2025-10-05 11:12:31 [INFO] Deleted original and processing copy for New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:12:31 [INFO] Skipping: New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:12:31 [INFO] Processing: New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:12:45 [INFO] Copied New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG.mkv → New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:12:45 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:12:45 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:12:45 [INFO] - Stream #2: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:12:45 [INFO] Starting CQ encode: New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:14:16 [INFO] 📦 Original: 1499.79 MB → Encoded: 267.68 MB (17.8% of original)
2025-10-05 11:14:19 [INFO] Moved New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG -EHX.mkv → New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:14:19 [INFO] Tracked conversion: New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1499.79MB → 267.68MB (17.8%)
2025-10-05 11:14:19 [INFO] Deleted original and processing copy for New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:14:19 [INFO] Processing: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:14:23 [INFO] Copied New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv → New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:14:23 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:14:23 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=224kbps, bucket_target=128.0kbps
2025-10-05 11:14:23 [INFO] Starting CQ encode: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:14:54 [INFO] Skipping: New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:14:54 [INFO] Skipping: New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:14:54 [INFO] Skipping: New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:14:54 [INFO] Skipping: New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:14:54 [INFO] Skipping: New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:14:54 [INFO] Skipping: New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:14:54 [INFO] Skipping: New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:14:54 [INFO] Skipping: New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:14:54 [INFO] Skipping: New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:14:54 [INFO] Processing: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:14:58 [INFO] Copied New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv → New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:14:59 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:14:59 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=224kbps, bucket_target=128.0kbps, codec=aac
2025-10-05 11:14:59 [INFO] Starting CQ encode: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:16:28 [INFO] 📦 Original: 459.88 MB → Encoded: 238.76 MB (51.9% of original)
2025-10-05 11:16:28 [WARNING] ⚠️ Size reduction insufficient (52%). Retrying with bitrate-based encode...
2025-10-05 11:16:28 [INFO] Running fallback bitrate encode: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:17:20 [INFO] Skipping: New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:17:20 [INFO] Skipping: New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:17:20 [INFO] Skipping: New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:17:20 [INFO] Skipping: New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:17:20 [INFO] Skipping: New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:17:20 [INFO] Skipping: New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:17:20 [INFO] Skipping: New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:17:20 [INFO] Skipping: New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:17:20 [INFO] Skipping: New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:17:20 [INFO] Processing: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:17:24 [INFO] Copied New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv → New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:17:24 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:17:24 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=224kbps, bucket_target=128.0kbps, codec=aac
2025-10-05 11:17:24 [INFO] Starting CQ encode: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:18:54 [INFO] 📦 Original: 459.88 MB → Encoded: 238.76 MB (51.9% of original)
2025-10-05 11:18:54 [WARNING] ⚠️ Size reduction insufficient (52%). Retrying with bitrate-based encode...
2025-10-05 11:18:54 [INFO] Running fallback bitrate encode: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:21:27 [INFO] Skipping: New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:21:27 [INFO] Skipping: New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:21:27 [INFO] Skipping: New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:21:27 [INFO] Skipping: New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:21:27 [INFO] Skipping: New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:21:27 [INFO] Skipping: New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:21:27 [INFO] Skipping: New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:21:27 [INFO] Skipping: New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:21:27 [INFO] Skipping: New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:21:27 [INFO] Processing: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:21:31 [INFO] Copied New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv → New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:21:31 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:21:31 [INFO] - Stream #1: 2ch, src=und, avg=128kbps, metadata=224kbps, closest bucket=128.0kbps → codec=aac
2025-10-05 11:21:31 [INFO] Starting CQ encode: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:23:01 [INFO] 📦 Original: 459.88 MB → Encoded: 238.76 MB (51.9% of original)
2025-10-05 11:23:01 [WARNING] ⚠️ Size reduction insufficient (52%). Retrying with bitrate-based encode...
2025-10-05 11:23:01 [INFO] Running fallback bitrate encode: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:28:30 [INFO] Skipping: New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:28:30 [INFO] Skipping: New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:28:30 [INFO] Skipping: New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:28:30 [INFO] Skipping: New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:28:30 [INFO] Skipping: New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:28:30 [INFO] Skipping: New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:28:30 [INFO] Skipping: New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:28:30 [INFO] Skipping: New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:28:30 [INFO] Skipping: New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:28:30 [INFO] Processing: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:28:34 [INFO] Copied New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv → New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:28:34 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:28:34 [INFO] - Stream #1: 2ch, src=und, avg=128kbps, metadata=224kbps, closest bucket=128.0kbps → codec=opus
2025-10-05 11:28:34 [INFO] Starting CQ encode: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:32:11 [INFO] Skipping: New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:32:11 [INFO] Skipping: New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:32:11 [INFO] Skipping: New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:32:11 [INFO] Skipping: New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:32:11 [INFO] Skipping: New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:32:11 [INFO] Skipping: New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:32:11 [INFO] Skipping: New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:32:11 [INFO] Skipping: New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:32:11 [INFO] Skipping: New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:32:11 [INFO] Processing: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:32:15 [INFO] Copied New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv → New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:32:15 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:32:15 [INFO] - Stream #1: 2ch, src=und, avg=128kbps, metadata=224kbps, closest bucket=128.0kbps → codec=opus
2025-10-05 11:32:15 [INFO] Starting CQ encode: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:33:48 [INFO] Skipping: New Saga - S01E12 - The Heroic Tale Continues x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:33:48 [INFO] Skipping: New Saga - S01E01 - I'll Change My Fate x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:33:48 [INFO] Skipping: New Saga - S01E06 - Brothers in Arms x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:33:48 [INFO] Skipping: New Saga - S01E11 - Secret Red-Hot Strategy x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:33:48 [INFO] Skipping: New Saga - S01E07 - To the Blacksmith's Nation x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:33:48 [INFO] Skipping: New Saga - S01E04 - The Perfect Start to a Heroic Tale x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:33:48 [INFO] Skipping: New Saga - S01E03 - Application of the Contract x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:33:48 [INFO] Skipping: New Saga - S01E10 - Duel x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:33:48 [INFO] Skipping: New Saga - S01E08 - Those Who Act Out of Sight x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:33:48 [INFO] Processing: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:33:52 [INFO] Copied New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv → New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:33:52 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:33:52 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=224kbps, bucket_target=128.0kbps
2025-10-05 11:33:52 [INFO] Starting CQ encode: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:35:22 [INFO] 📦 Original: 459.88 MB → Encoded: 238.76 MB (51.9% of original)
2025-10-05 11:35:22 [WARNING] ⚠️ Size reduction insufficient (52%). Retrying with bitrate-based encode...
2025-10-05 11:35:22 [INFO] Running fallback bitrate encode: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:36:54 [INFO] Moved New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv → New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv
2025-10-05 11:36:54 [INFO] Tracked conversion: New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws -EHX.mkv, 459.88MB → 238.76MB (51.9%)
2025-10-05 11:36:54 [INFO] Deleted original and processing copy for New Saga - S01E02 - The Hero's Conditions x265 EAC3 WEBRip-1080p Erai-raws.mkv
2025-10-05 11:36:54 [INFO] Skipping: New Saga - S01E05 - Reunion at Dawn h264 EAC3 WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:36:54 [INFO] Skipping: New Saga - S01E09 - Hidden Ambitions x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:46:30 [INFO] Processing: You Are Ms. Servant - S01E01 - My Fateful Encounter With You x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:46:42 [INFO] Copied You Are Ms. Servant - S01E01 - My Fateful Encounter With You x264 AAC WEBDL-1080p VARYG.mkv → You Are Ms. Servant - S01E01 - My Fateful Encounter With You x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:46:42 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:46:42 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128000kbps
2025-10-05 11:46:42 [INFO] Running CQ encode: You Are Ms. Servant - S01E01 - My Fateful Encounter With You x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:49:22 [INFO] Processing: You Are Ms. Servant - S01E01 - My Fateful Encounter With You x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:49:34 [INFO] Copied You Are Ms. Servant - S01E01 - My Fateful Encounter With You x264 AAC WEBDL-1080p VARYG.mkv → You Are Ms. Servant - S01E01 - My Fateful Encounter With You x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:49:35 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:49:35 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:49:35 [INFO] Running CQ encode: You Are Ms. Servant - S01E01 - My Fateful Encounter With You x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:50:44 [INFO] 📦 Original: 1404.32 MB → Encoded: 300.44 MB (21.4% of original)
2025-10-05 11:50:47 [INFO] Moved You Are Ms. Servant - S01E01 - My Fateful Encounter With You x264 AAC WEBDL-1080p VARYG -EHX.mkv → You Are Ms. Servant - S01E01 - My Fateful Encounter With You x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:50:47 [INFO] Tracked conversion: You Are Ms. Servant - S01E01 - My Fateful Encounter With You x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1404.32MB → 300.44MB (21.4%), method=CQ
2025-10-05 11:50:47 [INFO] Deleted original and processing copy for You Are Ms. Servant - S01E01 - My Fateful Encounter With You x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:50:47 [INFO] Processing: You are Ms. Servant - S01E02 - You Want to Know x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:51:01 [INFO] Copied You are Ms. Servant - S01E02 - You Want to Know x264 AAC WEBDL-1080p VARYG.mkv → You are Ms. Servant - S01E02 - You Want to Know x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:51:01 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:51:01 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:51:01 [INFO] Running CQ encode: You are Ms. Servant - S01E02 - You Want to Know x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:52:12 [INFO] 📦 Original: 1408.95 MB → Encoded: 313.09 MB (22.2% of original)
2025-10-05 11:52:15 [INFO] Moved You are Ms. Servant - S01E02 - You Want to Know x264 AAC WEBDL-1080p VARYG -EHX.mkv → You are Ms. Servant - S01E02 - You Want to Know x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:52:15 [INFO] Tracked conversion: You are Ms. Servant - S01E02 - You Want to Know x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1408.95MB → 313.09MB (22.2%), method=CQ
2025-10-05 11:52:15 [INFO] Deleted original and processing copy for You are Ms. Servant - S01E02 - You Want to Know x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:52:15 [INFO] Processing: You are Ms. Servant - S01E03 - You Are Ms. Yuki x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:52:28 [INFO] Copied You are Ms. Servant - S01E03 - You Are Ms. Yuki x264 AAC WEBDL-1080p VARYG.mkv → You are Ms. Servant - S01E03 - You Are Ms. Yuki x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:52:28 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:52:28 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:52:28 [INFO] Running CQ encode: You are Ms. Servant - S01E03 - You Are Ms. Yuki x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:53:37 [INFO] 📦 Original: 1407.34 MB → Encoded: 307.42 MB (21.8% of original)
2025-10-05 11:53:39 [INFO] Moved You are Ms. Servant - S01E03 - You Are Ms. Yuki x264 AAC WEBDL-1080p VARYG -EHX.mkv → You are Ms. Servant - S01E03 - You Are Ms. Yuki x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:53:39 [INFO] Tracked conversion: You are Ms. Servant - S01E03 - You Are Ms. Yuki x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1407.34MB → 307.42MB (21.8%), method=CQ
2025-10-05 11:53:40 [INFO] Deleted original and processing copy for You are Ms. Servant - S01E03 - You Are Ms. Yuki x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:53:40 [INFO] Processing: You are Ms. Servant - S01E04 - You Won't Miss Out x264 AAC HDTV-1080p SubsPlease.mkv
2025-10-05 11:53:52 [INFO] Copied You are Ms. Servant - S01E04 - You Won't Miss Out x264 AAC HDTV-1080p SubsPlease.mkv → You are Ms. Servant - S01E04 - You Won't Miss Out x264 AAC HDTV-1080p SubsPlease.mkv
2025-10-05 11:53:53 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:53:53 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:53:53 [INFO] Running CQ encode: You are Ms. Servant - S01E04 - You Won't Miss Out x264 AAC HDTV-1080p SubsPlease -EHX.mkv
2025-10-05 11:55:02 [INFO] 📦 Original: 1401.62 MB → Encoded: 323.88 MB (23.1% of original)
2025-10-05 11:55:05 [INFO] Moved You are Ms. Servant - S01E04 - You Won't Miss Out x264 AAC HDTV-1080p SubsPlease -EHX.mkv → You are Ms. Servant - S01E04 - You Won't Miss Out x264 AAC HDTV-1080p SubsPlease -EHX.mkv
2025-10-05 11:55:05 [INFO] Tracked conversion: You are Ms. Servant - S01E04 - You Won't Miss Out x264 AAC HDTV-1080p SubsPlease -EHX.mkv, 1401.62MB → 323.88MB (23.1%), method=CQ
2025-10-05 11:55:06 [INFO] Deleted original and processing copy for You are Ms. Servant - S01E04 - You Won't Miss Out x264 AAC HDTV-1080p SubsPlease.mkv
2025-10-05 11:55:06 [INFO] Processing: You are Ms. Servant - S01E05 - What You Want to Protect x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:55:18 [INFO] Copied You are Ms. Servant - S01E05 - What You Want to Protect x264 AAC WEBDL-1080p VARYG.mkv → You are Ms. Servant - S01E05 - What You Want to Protect x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:55:18 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:55:18 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:55:18 [INFO] Running CQ encode: You are Ms. Servant - S01E05 - What You Want to Protect x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:56:26 [INFO] 📦 Original: 1407.84 MB → Encoded: 263.15 MB (18.7% of original)
2025-10-05 11:56:29 [INFO] Moved You are Ms. Servant - S01E05 - What You Want to Protect x264 AAC WEBDL-1080p VARYG -EHX.mkv → You are Ms. Servant - S01E05 - What You Want to Protect x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:56:29 [INFO] Tracked conversion: You are Ms. Servant - S01E05 - What You Want to Protect x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1407.84MB → 263.15MB (18.7%), method=CQ
2025-10-05 11:56:29 [INFO] Deleted original and processing copy for You are Ms. Servant - S01E05 - What You Want to Protect x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:56:29 [INFO] Processing: You are Ms. Servant - S01E06 - You're Lonelier Than I Thought x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:56:41 [INFO] Copied You are Ms. Servant - S01E06 - You're Lonelier Than I Thought x264 AAC WEBDL-1080p VARYG.mkv → You are Ms. Servant - S01E06 - You're Lonelier Than I Thought x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:56:42 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:56:42 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:56:42 [INFO] - Stream #2: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:56:42 [INFO] Running CQ encode: You are Ms. Servant - S01E06 - You're Lonelier Than I Thought x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:58:01 [INFO] 📦 Original: 1448.64 MB → Encoded: 344.80 MB (23.8% of original)
2025-10-05 11:58:04 [INFO] Moved You are Ms. Servant - S01E06 - You're Lonelier Than I Thought x264 AAC WEBDL-1080p VARYG -EHX.mkv → You are Ms. Servant - S01E06 - You're Lonelier Than I Thought x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:58:04 [INFO] Tracked conversion: You are Ms. Servant - S01E06 - You're Lonelier Than I Thought x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1448.64MB → 344.8MB (23.8%), method=CQ
2025-10-05 11:58:04 [INFO] Deleted original and processing copy for You are Ms. Servant - S01E06 - You're Lonelier Than I Thought x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:58:04 [INFO] Processing: You are Ms. Servant - S01E07 - You've Finally Figured It Out x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:58:19 [INFO] Copied You are Ms. Servant - S01E07 - You've Finally Figured It Out x264 AAC WEBDL-1080p VARYG.mkv → You are Ms. Servant - S01E07 - You've Finally Figured It Out x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:58:19 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:58:19 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:58:19 [INFO] - Stream #2: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:58:19 [INFO] Running CQ encode: You are Ms. Servant - S01E07 - You've Finally Figured It Out x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:59:37 [INFO] 📦 Original: 1445.40 MB → Encoded: 340.70 MB (23.6% of original)
2025-10-05 11:59:40 [INFO] Moved You are Ms. Servant - S01E07 - You've Finally Figured It Out x264 AAC WEBDL-1080p VARYG -EHX.mkv → You are Ms. Servant - S01E07 - You've Finally Figured It Out x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 11:59:40 [INFO] Tracked conversion: You are Ms. Servant - S01E07 - You've Finally Figured It Out x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1445.4MB → 340.7MB (23.6%), method=CQ
2025-10-05 11:59:40 [INFO] Deleted original and processing copy for You are Ms. Servant - S01E07 - You've Finally Figured It Out x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:59:40 [INFO] Processing: You are Ms. Servant - S01E08 - The Autumn With You and the Sauce x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:59:54 [INFO] Copied You are Ms. Servant - S01E08 - The Autumn With You and the Sauce x264 AAC WEBDL-1080p VARYG.mkv → You are Ms. Servant - S01E08 - The Autumn With You and the Sauce x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 11:59:54 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 11:59:54 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:59:54 [INFO] - Stream #2: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 11:59:54 [INFO] Running CQ encode: You are Ms. Servant - S01E08 - The Autumn With You and the Sauce x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 12:01:12 [INFO] 📦 Original: 1450.30 MB → Encoded: 363.32 MB (25.1% of original)
2025-10-05 12:01:15 [INFO] Moved You are Ms. Servant - S01E08 - The Autumn With You and the Sauce x264 AAC WEBDL-1080p VARYG -EHX.mkv → You are Ms. Servant - S01E08 - The Autumn With You and the Sauce x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 12:01:15 [INFO] Tracked conversion: You are Ms. Servant - S01E08 - The Autumn With You and the Sauce x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1450.3MB → 363.32MB (25.1%), method=CQ
2025-10-05 12:01:15 [INFO] Deleted original and processing copy for You are Ms. Servant - S01E08 - The Autumn With You and the Sauce x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 12:01:15 [INFO] Processing: You are Ms. Servant - S01E09 - You and the Cultural Stage x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 12:01:29 [INFO] Copied You are Ms. Servant - S01E09 - You and the Cultural Stage x264 AAC WEBDL-1080p VARYG.mkv → You are Ms. Servant - S01E09 - You and the Cultural Stage x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 12:01:29 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 12:01:29 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 12:01:29 [INFO] - Stream #2: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 12:01:29 [INFO] Running CQ encode: You are Ms. Servant - S01E09 - You and the Cultural Stage x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 12:02:50 [INFO] 📦 Original: 1450.71 MB → Encoded: 268.45 MB (18.5% of original)
2025-10-05 12:02:52 [INFO] Moved You are Ms. Servant - S01E09 - You and the Cultural Stage x264 AAC WEBDL-1080p VARYG -EHX.mkv → You are Ms. Servant - S01E09 - You and the Cultural Stage x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 12:02:52 [INFO] Tracked conversion: You are Ms. Servant - S01E09 - You and the Cultural Stage x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1450.71MB → 268.45MB (18.5%), method=CQ
2025-10-05 12:02:52 [INFO] Deleted original and processing copy for You are Ms. Servant - S01E09 - You and the Cultural Stage x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 12:02:52 [INFO] Processing: You are Ms. Servant - S01E10 - You and the Forbidden Fruit x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 12:03:05 [INFO] Copied You are Ms. Servant - S01E10 - You and the Forbidden Fruit x264 AAC WEBDL-1080p VARYG.mkv → You are Ms. Servant - S01E10 - You and the Forbidden Fruit x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 12:03:05 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 12:03:05 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 12:03:05 [INFO] - Stream #2: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 12:03:05 [INFO] Running CQ encode: You are Ms. Servant - S01E10 - You and the Forbidden Fruit x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 12:04:24 [INFO] 📦 Original: 1453.40 MB → Encoded: 319.20 MB (22.0% of original)
2025-10-05 12:04:26 [INFO] Moved You are Ms. Servant - S01E10 - You and the Forbidden Fruit x264 AAC WEBDL-1080p VARYG -EHX.mkv → You are Ms. Servant - S01E10 - You and the Forbidden Fruit x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 12:04:26 [INFO] Tracked conversion: You are Ms. Servant - S01E10 - You and the Forbidden Fruit x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1453.4MB → 319.2MB (22.0%), method=CQ
2025-10-05 12:04:27 [INFO] Deleted original and processing copy for You are Ms. Servant - S01E10 - You and the Forbidden Fruit x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 12:04:27 [INFO] Processing: You are Ms. Servant - S01E11 - Your Prayers Are Gods' Prayers x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 12:04:40 [INFO] Copied You are Ms. Servant - S01E11 - Your Prayers Are Gods' Prayers x264 AAC WEBDL-1080p VARYG.mkv → You are Ms. Servant - S01E11 - Your Prayers Are Gods' Prayers x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 12:04:40 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 12:04:40 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 12:04:40 [INFO] - Stream #2: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 12:04:40 [INFO] Running CQ encode: You are Ms. Servant - S01E11 - Your Prayers Are Gods' Prayers x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 12:06:01 [INFO] 📦 Original: 1454.60 MB → Encoded: 310.35 MB (21.3% of original)
2025-10-05 12:06:04 [INFO] Moved You are Ms. Servant - S01E11 - Your Prayers Are Gods' Prayers x264 AAC WEBDL-1080p VARYG -EHX.mkv → You are Ms. Servant - S01E11 - Your Prayers Are Gods' Prayers x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 12:06:04 [INFO] Tracked conversion: You are Ms. Servant - S01E11 - Your Prayers Are Gods' Prayers x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1454.6MB → 310.35MB (21.3%), method=CQ
2025-10-05 12:06:04 [INFO] Deleted original and processing copy for You are Ms. Servant - S01E11 - Your Prayers Are Gods' Prayers x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 12:06:04 [INFO] Processing: You are Ms. Servant - S01E12 - The Joyous Tidings You All Bring x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 12:06:17 [INFO] Copied You are Ms. Servant - S01E12 - The Joyous Tidings You All Bring x264 AAC WEBDL-1080p VARYG.mkv → You are Ms. Servant - S01E12 - The Joyous Tidings You All Bring x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 12:06:17 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: lanczos
• CQ: 32
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 12:06:17 [INFO] - Stream #1: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 12:06:17 [INFO] - Stream #2: 2ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=128.0kbps
2025-10-05 12:06:17 [INFO] Running CQ encode: You are Ms. Servant - S01E12 - The Joyous Tidings You All Bring x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 12:07:40 [INFO] 📦 Original: 1444.42 MB → Encoded: 329.28 MB (22.8% of original)
2025-10-05 12:07:43 [INFO] Moved You are Ms. Servant - S01E12 - The Joyous Tidings You All Bring x264 AAC WEBDL-1080p VARYG -EHX.mkv → You are Ms. Servant - S01E12 - The Joyous Tidings You All Bring x264 AAC WEBDL-1080p VARYG -EHX.mkv
2025-10-05 12:07:43 [INFO] Tracked conversion: You are Ms. Servant - S01E12 - The Joyous Tidings You All Bring x264 AAC WEBDL-1080p VARYG -EHX.mkv, 1444.42MB → 329.28MB (22.8%), method=CQ
2025-10-05 12:07:43 [INFO] Deleted original and processing copy for You are Ms. Servant - S01E12 - The Joyous Tidings You All Bring x264 AAC WEBDL-1080p VARYG.mkv
2025-10-05 12:33:23 [INFO] Skipping: Vikings - S03E06 - Born Again x265 AAC Bluray-1080p Silence -EHX.mkv
2025-10-05 12:33:23 [INFO] Processing: Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence.mkv
2025-10-05 12:33:39 [INFO] Copied Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence.mkv → Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence.mkv
2025-10-05 12:33:39 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: bicubic
• CQ: 28
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 12:33:39 [INFO] - Stream #1: 6ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=160.0kbps
2025-10-05 12:33:39 [INFO] Running CQ encode: Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence -EHX.mkv
2025-10-05 12:38:42 [INFO] Skipping: Vikings - S03E06 - Born Again x265 AAC Bluray-1080p Silence -EHX.mkv
2025-10-05 12:38:42 [INFO] Processing: Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence.mkv
2025-10-05 12:38:57 [INFO] Copied Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence.mkv → Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence.mkv
2025-10-05 12:38:57 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: bicubic
• CQ: 28
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 12:38:57 [INFO] - Stream #1: 6ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=192.0kbps
2025-10-05 12:38:57 [INFO] Running CQ encode: Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence -EHX.mkv
2025-10-05 12:43:01 [INFO] 📦 Original: 1812.11 MB → Encoded: 1746.19 MB (96.4% of original)
2025-10-05 12:43:01 [WARNING] CQ encode failed target. Switching to Bitrate for remaining files.
2025-10-05 12:43:01 [INFO]
🧩 ENCODE SETTINGS
• Resolution: 1920x1080
• Scale Filter: bicubic
• CQ: N/A
• Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)
• Audio Streams:
2025-10-05 12:43:01 [INFO] - Stream #1: 6ch, src=und, avg_bitrate=128kbps, metadata=0kbps, bucket_target=192.0kbps
2025-10-05 12:43:01 [INFO] Running Bitrate encode: Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence -EHX.mkv
2025-10-05 12:47:05 [INFO] 📦 Original: 1812.11 MB → Encoded: 609.28 MB (33.6% of original)
2025-10-05 12:47:10 [INFO] Moved Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence -EHX.mkv → Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence -EHX.mkv
2025-10-05 12:47:10 [INFO] Tracked conversion: Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence -EHX.mkv, 1812.11MB → 609.28MB (33.6%), method=CQ
2025-10-05 12:47:11 [INFO] Deleted original and processing copy for Vikings - S03E08 - To the Gates! x265 AAC Bluray-1080p Silence.mkv
2025-10-05 12:47:11 [INFO] Skipping: Vikings - S03E02 - The Wanderer x265 AAC Bluray-1080p Silence -EHX.mkv
2025-10-05 12:47:11 [INFO] Skipping: Vikings - S03E03 - Warrior's Fate x265 AAC Bluray-1080p Silence -EHX.mkv
2025-10-05 12:47:11 [INFO] Skipping: Vikings - S03E04 - Scarred x265 AAC Bluray-1080p Silence -EHX.mkv
2025-10-05 12:47:11 [INFO] Skipping: Vikings - S03E05 - The Usurper x265 AAC Bluray-1080p Silence -EHX.mkv
2025-10-05 12:47:11 [INFO] Skipping: Vikings - S03E09 - Breaking Point x265 AAC Bluray-1080p Silence -EHX.mkv
2025-10-05 12:47:11 [INFO] Skipping: Vikings - S03E07 - Paris x265 AAC Bluray-1080p Silence -EHX.mkv
2025-10-05 12:47:11 [INFO] Skipping: Vikings - S03E10 - The Dead x265 AAC Bluray-1080p Silence -EHX.mkv
2025-10-05 12:47:11 [INFO] Skipping: Vikings - S03E01 - Mercenary x265 AAC Bluray-1080p Silence -EHX.mkv

267
main.py
View File

@ -1,11 +1,31 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
import csv
import json import json
import os
import shutil import shutil
import subprocess import subprocess
from pathlib import Path from pathlib import Path
from core.config_helper import load_config_xml from core.config_helper import load_config_xml
from core.logger_helper import setup_logger
# =============================
# Setup logger
# =============================
LOG_FOLDER = Path(__file__).parent / "logs"
logger = setup_logger(LOG_FOLDER)
# =============================
# Tracker CSV
# =============================
TRACKER_FILE = Path(__file__).parent / "conversion_tracker.csv"
if not TRACKER_FILE.exists():
with open(TRACKER_FILE, "w", newline="", encoding="utf-8") as f:
writer = csv.writer(f)
writer.writerow([
"type","show","filename","original_size_MB","processed_size_MB","percentage","method"
])
# ============================= # =============================
# AUDIO BUCKET LOGIC # AUDIO BUCKET LOGIC
@ -25,15 +45,22 @@ def choose_audio_bitrate(channels: int, bitrate_kbps: int, audio_config: dict) -
return audio_config["multi_channel"]["high"] return audio_config["multi_channel"]["high"]
# ============================= # =============================
# AUDIO STREAM DETECTION # PATH NORMALIZATION
# =============================
def normalize_path_for_service(local_path: str, path_mappings: dict) -> str:
for win_path, linux_path in path_mappings.items():
if local_path.lower().startswith(win_path.lower()):
return local_path.replace(win_path, linux_path).replace("\\", "/")
return local_path.replace("\\", "/")
# =============================
# AUDIO STREAMS DETECTION
# ============================= # =============================
def get_audio_streams(input_file: Path): def get_audio_streams(input_file: Path):
cmd = [ cmd = [
"ffprobe", "-v", "error", "ffprobe","-v","error","-select_streams","a",
"-select_streams", "a", "-show_entries","stream=index,channels,duration,bit_rate,tags=language",
"-show_entries", "stream=index,channels,bit_rate", "-of","json", str(input_file)
"-of", "json",
str(input_file)
] ]
result = subprocess.run(cmd, capture_output=True, text=True) result = subprocess.run(cmd, capture_output=True, text=True)
data = json.loads(result.stdout) data = json.loads(result.stdout)
@ -41,148 +68,214 @@ def get_audio_streams(input_file: Path):
for s in data.get("streams", []): for s in data.get("streams", []):
index = s["index"] index = s["index"]
channels = s.get("channels", 2) channels = s.get("channels", 2)
bitrate = int(int(s.get("bit_rate", 128000)) / 1000) src_lang = s.get("tags", {}).get("language", "und")
streams.append((index, channels, bitrate)) bit_rate_meta = int(s.get("bit_rate", 0)) if s.get("bit_rate") else 0
try:
duration = float(s.get("duration", 0))
if duration and bit_rate_meta == 0:
fmt_cmd = [
"ffprobe","-v","error","-show_entries","format=size,duration",
"-of","json", str(input_file)
]
fmt_result = subprocess.run(fmt_cmd, capture_output=True, text=True)
fmt_data = json.loads(fmt_result.stdout)
size_bytes = int(fmt_data.get("format", {}).get("size", 0))
total_duration = float(fmt_data.get("format", {}).get("duration", duration))
n_streams = len(data.get("streams", []))
avg_bitrate_kbps = int((size_bytes*8/n_streams)/total_duration/1000)
elif duration and bit_rate_meta:
avg_bitrate_kbps = int(bit_rate_meta / 1000)
else:
avg_bitrate_kbps = 128
except Exception:
avg_bitrate_kbps = 128
streams.append((index, channels, avg_bitrate_kbps, src_lang, int(bit_rate_meta / 1000)))
return streams return streams
# ============================= # =============================
# FFmpeg ENCODE # FFmpeg ENCODE
# ============================= # =============================
def run_ffmpeg(input_file: Path, output_file: Path, cq: int, scale_width: int, scale_height: int, def run_ffmpeg(input_file: Path, output_file: Path, cq: int, scale_width: int, scale_height: int,
filter_flags: str, audio_config: dict, encode_config: dict): filter_flags: str, audio_config: dict, method: str):
streams = get_audio_streams(input_file) streams = get_audio_streams(input_file)
header = f"\n🧩 ENCODE SETTINGS\n • Resolution: {scale_width}x{scale_height}\n • Scale Filter: {filter_flags}\n • CQ: {cq if method=='CQ' else 'N/A'}\n • Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)\n • Audio Streams:"
logger.info(header)
print(" ")
# print(header)
print("\n🧩 ENCODE SETTINGS") for (index, channels, avg_bitrate, src_lang, meta_bitrate) in streams:
print(f" • Resolution: {scale_width}x{scale_height}") br = choose_audio_bitrate(channels, avg_bitrate, audio_config)
print(f" • Scale Filter: {filter_flags}") line = f" - Stream #{index}: {channels}ch, src={src_lang}, avg_bitrate={avg_bitrate}kbps, metadata={meta_bitrate}kbps, bucket_target={br/1000:.1f}kbps"
print(f" • CQ: {cq}") print(line)
print(f" • Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)") logger.info(line)
print(" • Audio Streams:") cmd = ["ffmpeg","-y","-i",str(input_file),
for (index, channels, bitrate) in streams: "-vf",f"scale={scale_width}:{scale_height}:flags={filter_flags}:force_original_aspect_ratio=decrease",
br = choose_audio_bitrate(channels, bitrate, audio_config) "-map","0:v","-map","0:a","-map","0:s?",
print(f" - Stream #{index}: {channels}ch, orig≈{bitrate}kbps → target {br/1000:.1f}kbps") "-c:v","av1_nvenc","-preset","p1","-pix_fmt","p010le"]
# Build CQ encode command if method=="CQ":
cmd = [ cmd += ["-cq", str(cq)]
"ffmpeg", "-y", "-i", str(input_file), else:
"-vf", f"scale={scale_width}:{scale_height}:flags={filter_flags}:force_original_aspect_ratio=decrease", if scale_height>=1080:
"-map", "0:v", "-map", "0:a", "-map", "0:s?", vb, maxrate, bufsize = "1500k","1750k","2250k"
"-c:v", "av1_nvenc", "-preset", "p1", "-cq", str(cq), "-pix_fmt", "p010le" else:
] vb, maxrate, bufsize = "900k","1250k","1600k"
for i, (index, channels, bitrate) in enumerate(streams): cmd += ["-b:v",vb,"-maxrate",maxrate,"-bufsize",bufsize]
br = choose_audio_bitrate(channels, bitrate, audio_config)
cmd += [f"-c:a:{i}", "aac", f"-b:a:{i}", str(br), f"-ac:{i}", str(channels)] for i, (index, channels, avg_bitrate, src_lang, meta_bitrate) in enumerate(streams):
br = choose_audio_bitrate(channels, avg_bitrate, audio_config)
cmd += [f"-c:a:{i}","aac",f"-b:a:{i}",str(br),f"-ac:{i}",str(channels)]
cmd += ["-c:s","copy",str(output_file)]
print(f"\n🎬 Running {method} encode: {output_file.name}")
logger.info(f"Running {method} encode: {output_file.name}")
cmd += ["-c:s", "copy", str(output_file)]
subprocess.run(cmd, check=True) subprocess.run(cmd, check=True)
# Check size reduction
orig_size = input_file.stat().st_size orig_size = input_file.stat().st_size
out_size = output_file.stat().st_size out_size = output_file.stat().st_size
reduction_ratio = out_size / orig_size reduction_ratio = out_size / orig_size
print(f"📦 Original: {orig_size/1e6:.2f} MB → Encoded: {out_size/1e6:.2f} MB ({reduction_ratio:.1%} of original)") msg = f"📦 Original: {orig_size/1e6:.2f} MB → Encoded: {out_size/1e6:.2f} MB ({reduction_ratio:.1%} of original)"
print(msg)
logger.info(msg)
# Fallback if too large return orig_size, out_size, reduction_ratio
if reduction_ratio >= 0.5:
print(f"⚠️ Size reduction insufficient ({reduction_ratio:.0%}). Retrying with bitrate-based encode...")
output_file.unlink(missing_ok=True)
if scale_height >= 1080:
vb, maxrate, bufsize = encode_config["fallback"]["bitrate_1080"], encode_config["fallback"]["maxrate_1080"], encode_config["fallback"]["bufsize_1080"]
else:
vb, maxrate, bufsize = encode_config["fallback"]["bitrate_720"], encode_config["fallback"]["maxrate_720"], encode_config["fallback"]["bufsize_720"]
cmd = [
"ffmpeg", "-y", "-i", str(input_file),
"-vf", f"scale={scale_width}:{scale_height}:flags={filter_flags}:force_original_aspect_ratio=decrease",
"-map", "0:v", "-map", "0:a", "-map", "0:s?",
"-c:v", "av1_nvenc", "-preset", "p1",
"-b:v", vb, "-maxrate", maxrate, "-bufsize", bufsize,
"-pix_fmt", "p010le"
]
for i, (index, channels, bitrate) in enumerate(streams):
br = choose_audio_bitrate(channels, bitrate, audio_config)
cmd += [f"-c:a:{i}", "aac", f"-b:a:{i}", str(br), f"-ac:{i}", str(channels)]
cmd += ["-c:s", "copy", str(output_file)]
subprocess.run(cmd, check=True)
# ============================= # =============================
# PROCESS FOLDER # PROCESS FOLDER
# ============================= # =============================
def process_folder(folder: Path, cq: int, resolution: str, processing_folder: Path, config: dict): def process_folder(folder: Path, cq: int, resolution: str, config: dict):
if not folder.exists(): if not folder.exists():
print(f"❌ Folder not found: {folder}") print(f"❌ Folder not found: {folder}")
logger.error(f"Folder not found: {folder}")
return return
filter_flags_default = config["encode"]["filters"]["default"] audio_config = config["audio"]
filter_flags_tv = config["encode"]["filters"]["tv"] filters_config = config["encode"]["filters"]
suffix = config["suffix"]
extensions = config["extensions"]
res_height = 1080 if resolution=="1080" else 720
res_width = 1920 if resolution=="1080" else 1280
filter_flags = filters_config.get("default","lanczos")
folder_lower = str(folder).lower() folder_lower = str(folder).lower()
if "\\tv\\" in folder_lower or "/tv/" in folder_lower: if "\\tv\\" in folder_lower or "/tv/" in folder_lower:
filter_flags = filter_flags_tv filter_flags = filters_config.get("tv","bicubic")
cq_default_key = f"tv_{resolution}" cq_default = config["encode"]["cq"].get(f"tv_{resolution}",32)
else: else:
filter_flags = filter_flags_default cq_default = config["encode"]["cq"].get(f"movie_{resolution}",32)
cq_default_key = f"movie_{resolution}"
if cq is None: if cq is None:
cq = config["encode"]["cq"][cq_default_key] cq = cq_default
res_height = 1080 if resolution == "1080" else 720
res_width = 1920 if resolution == "1080" else 1280
processing_folder = Path(config["processing_folder"])
processing_folder.mkdir(parents=True, exist_ok=True) processing_folder.mkdir(parents=True, exist_ok=True)
# Track if we switch to bitrate mode
use_bitrate = False
for file in folder.rglob("*"): for file in folder.rglob("*"):
if file.suffix.lower() not in config["extensions"]: if file.suffix.lower() not in extensions:
continue continue
if any(tag in file.name.lower() for tag in ["ehx", "megusta"]): if any(tag.lower() in file.name.lower() for tag in ["ehx","megusta"]):
print(f"⏭️ Skipping: {file.name}") print(f"⏭️ Skipping: {file.name}")
logger.info(f"Skipping: {file.name}")
continue continue
print("="*60) print("="*60)
logger.info(f"Processing: {file.name}")
print(f"📁 Processing: {file.name}") print(f"📁 Processing: {file.name}")
temp_input = processing_folder / file.name temp_input = processing_folder / file.name
shutil.copy2(file, temp_input) shutil.copy2(file, temp_input)
temp_output = processing_folder / f"{file.stem}{config['suffix']}{file.suffix}" logger.info(f"Copied {file.name}{temp_input.name}")
temp_output = processing_folder / f"{file.stem}{suffix}{file.suffix}"
run_ffmpeg(temp_input, temp_output, cq, res_width, res_height, filter_flags, method = "Bitrate" if use_bitrate else "CQ"
config["audio"], config["encode"]) try:
orig_size, out_size, reduction_ratio = run_ffmpeg(temp_input, temp_output, cq, res_width, res_height, filter_flags, audio_config, method)
except subprocess.CalledProcessError as e:
print(f"❌ FFmpeg failed: {e}")
logger.error(f"FFmpeg failed: {e}")
temp_input.unlink(missing_ok=True)
break
if method=="CQ" and reduction_ratio>=0.5:
print(f"⚠️ CQ encode did not achieve target size. Switching all remaining files to Bitrate.")
logger.warning("CQ encode failed target. Switching to Bitrate for remaining files.")
use_bitrate = True
try:
# Retry current file using bitrate
temp_output.unlink(missing_ok=True)
orig_size, out_size, reduction_ratio = run_ffmpeg(temp_input, temp_output, cq, res_width, res_height, filter_flags, audio_config, "Bitrate")
if reduction_ratio>=0.5:
print("❌ Bitrate encode also failed target. Stopping process.")
logger.error("Bitrate encode failed target. Stopping process.")
temp_input.unlink(missing_ok=True)
break
except subprocess.CalledProcessError as e:
print(f"❌ Bitrate retry failed: {e}")
logger.error(f"Bitrate retry failed: {e}")
temp_input.unlink(missing_ok=True)
break
elif method=="Bitrate" and reduction_ratio>=0.5:
print("❌ Bitrate encode failed target. Stopping process.")
logger.error("Bitrate encode failed target. Stopping process.")
temp_input.unlink(missing_ok=True)
break
dest_file = file.parent / temp_output.name dest_file = file.parent / temp_output.name
shutil.move(temp_output, dest_file) shutil.move(temp_output, dest_file)
print(f"🚚 Moved {temp_output.name}{dest_file.name}") print(f"🚚 Moved {temp_output.name}{dest_file.name}")
logger.info(f"Moved {temp_output.name}{dest_file.name}")
# Cleanup folder_parts = [p.lower() for p in folder.parts]
if dest_file.exists(): if "tv" in folder_parts:
try: f_type = "tv"
temp_input.unlink() tv_index = folder_parts.index("tv")
file.unlink() show = folder.parts[tv_index + 1] if len(folder.parts) > tv_index + 1 else "Unknown"
print(f"🧹 Deleted original and processing copy") elif "anime" in folder_parts:
except Exception as e: f_type = "anime"
print(f"⚠️ Could not delete files: {e}") anime_index = folder_parts.index("anime")
show = folder.parts[anime_index + 1] if len(folder.parts) > anime_index + 1 else "Unknown"
else:
f_type = "movie"
show = "N/A"
orig_size_mb = round(orig_size / 1e6, 2)
proc_size_mb = round(out_size / 1e6, 2)
percentage = round(proc_size_mb / orig_size_mb * 100, 1)
with open(TRACKER_FILE, "a", newline="", encoding="utf-8") as f:
writer = csv.writer(f)
writer.writerow([f_type, show, dest_file.name, orig_size_mb, proc_size_mb, percentage, method])
logger.info(f"Tracked conversion: {dest_file.name}, {orig_size_mb}MB → {proc_size_mb}MB ({percentage}%), method={method}")
print(f"📝 Logged conversion: {dest_file.name} ({percentage}%), method={method}")
try:
temp_input.unlink()
file.unlink()
logger.info(f"Deleted original and processing copy for {file.name}")
except Exception as e:
print(f"⚠️ Could not delete files: {e}")
logger.warning(f"Could not delete files: {e}")
# ============================= # =============================
# MAIN # MAIN
# ============================= # =============================
def main(): def main():
parser = argparse.ArgumentParser(description="Batch encode videos") parser = argparse.ArgumentParser(description="Batch encode videos with logging and tracker")
parser.add_argument("folder", help="Path to folder containing videos") parser.add_argument("folder", help="Path to folder containing videos")
parser.add_argument("--cq", type=int, help="Override default CQ") parser.add_argument("--cq", type=int, help="Override default CQ")
parser.add_argument("--r", "--resolution", dest="resolution", choices=["720","1080"], help="Target resolution (720 or 1080)") parser.add_argument("--r", "--resolution", dest="resolution", default="1080", choices=["720","1080"], help="Target resolution")
parser.add_argument("--processing", type=str, help="Processing folder")
args = parser.parse_args() args = parser.parse_args()
config_path = Path(__file__).parent / "config.xml" config_path = Path(__file__).parent / "config.xml"
config = load_config_xml(config_path) config = load_config_xml(config_path)
cq = args.cq if args.cq is not None else None process_folder(Path(args.folder), args.cq, args.resolution, config)
resolution = args.resolution if args.resolution else "1080"
processing_folder = Path(args.processing) if args.processing else Path(config["processing_folder"])
process_folder(Path(args.folder), cq, resolution, processing_folder, config)
if __name__ == "__main__": if __name__ == "__main__":
main() main()