Compare commits

..

No commits in common. "modules" and "main" have entirely different histories.

11 changed files with 178 additions and 1224 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
processing/*
__pycache__

View File

@ -1,88 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<config>
<!-- =============================
GENERAL SETTINGS
============================= -->
<general>
<!-- Default temporary working folder (relative to script) -->
<processing_folder>processing</processing_folder>
<!-- File suffix added to encoded outputs -->
<suffix> -EHX</suffix>
<!-- Allowed input extensions -->
<extensions>.mkv,.mp4</extensions>
</general>
<!-- =============================
PATH MAPPINGS (Windows → Linux)
============================= -->
<path_mappings>
<map from="P:\tv" to="/mnt/plex/tv" />
<map from="P:\anime" to="/mnt/plex/anime" />
</path_mappings>
<!-- =============================
SONARR / RADARR SETTINGS
============================= -->
<services>
<sonarr>
<url>http://10.0.0.10:8989/api/v3</url>
<api_key>a3458e2a095e4e1c892626c4a4f6959f</api_key>
</sonarr>
<radarr>
<url>http://10.0.0.10:7878/api/v3</url>
<api_key></api_key>
</radarr>
</services>
<!-- =============================
ENCODE SETTINGS
============================= -->
<encode>
<!-- CQ defaults (per resolution / content type) -->
<cq>
<tv_1080>28</tv_1080>
<tv_720>32</tv_720>
<movie_1080>32</movie_1080>
<movie_720>34</movie_720>
</cq>
<!-- Fallback bitrate-based mode -->
<fallback>
<bitrate_1080>1500k</bitrate_1080>
<maxrate_1080>1750k</maxrate_1080>
<bufsize_1080>2750k</bufsize_1080>
<bitrate_720>900k</bitrate_720>
<maxrate_720>1250k</maxrate_720>
<bufsize_720>1800k</bufsize_720>
</fallback>
<!-- Scale filter defaults -->
<filters>
<default>lanczos</default>
<tv>bicubic</tv>
</filters>
</encode>
<!-- =============================
AUDIO BUCKETS
============================= -->
<audio>
<stereo>
<low>64000</low>
<medium>96000</medium>
<high>128000</high>
</stereo>
<multi_channel>
<low>192000</low>
<high>192000</high>
</multi_channel>
<codec_rules>
<use_opus_below_kbps>128</use_opus_below_kbps>
</codec_rules>
</audio>
</config>

View File

@ -1,26 +0,0 @@
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.

View File

View File

@ -1,122 +0,0 @@
import xml.etree.ElementTree as ET
from pathlib import Path
# Default XML content to write if missing
DEFAULT_XML = """<?xml version="1.0" encoding="UTF-8"?>
<config>
<general>
<processing_folder>processing</processing_folder>
<suffix> -EHX</suffix>
<extensions>.mkv,.mp4</extensions>
</general>
<path_mappings>
<map from="P:\\tv" to="/mnt/plex/tv" />
<map from="P:\\anime" to="/mnt/plex/anime" />
</path_mappings>
<encode>
<cq>
<tv_1080>28</tv_1080>
<tv_720>32</tv_720>
<movie_1080>32</movie_1080>
<movie_720>34</movie_720>
</cq>
<fallback>
<bitrate_1080>1500k</bitrate_1080>
<maxrate_1080>1750k</maxrate_1080>
<bufsize_1080>2250k</bufsize_1080>
<bitrate_720>900k</bitrate_720>
<maxrate_720>1250k</maxrate_720>
<bufsize_720>1600k</bufsize_720>
</fallback>
<filters>
<default>lanczos</default>
<tv>bicubic</tv>
</filters>
</encode>
<audio>
<stereo>
<low>64000</low>
<medium>96000</medium>
<high>128000</high>
</stereo>
<multi_channel>
<low>160000</low>
<high>192000</high>
</multi_channel>
</audio>
</config>
"""
def load_config_xml(path: Path) -> dict:
if not path.exists():
path.write_text(DEFAULT_XML, encoding="utf-8")
print(f" Created default config.xml at {path}")
tree = ET.parse(path)
root = tree.getroot()
# --- General ---
general = root.find("general")
processing_folder_elem = general.find("processing_folder") if general is not None else None
processing_folder = processing_folder_elem.text if processing_folder_elem is not None else "processing"
suffix_elem = general.find("suffix") if general is not None else None
suffix = suffix_elem.text if suffix_elem is not None else " -EHX"
extensions_elem = general.find("extensions") if general is not None else None
extensions = extensions_elem.text.split(",") if extensions_elem is not None else [".mkv", ".mp4"]
# --- Path Mappings ---
path_mappings = {}
for m in root.findall("path_mappings/map"):
f = m.attrib.get("from")
t = m.attrib.get("to")
if f and t:
path_mappings[f] = t
# --- Encode ---
encode_elem = root.find("encode")
cq = {}
fallback = {}
filters = {}
if encode_elem is not None:
cq_elem = encode_elem.find("cq")
if cq_elem is not None:
for child in cq_elem:
if child.text:
cq[child.tag] = int(child.text)
fallback_elem = encode_elem.find("fallback")
if fallback_elem is not None:
for child in fallback_elem:
if child.text:
fallback[child.tag] = child.text
filters_elem = encode_elem.find("filters")
if filters_elem is not None:
for child in filters_elem:
if child.text:
filters[child.tag] = child.text
# --- Audio ---
audio = {"stereo": {}, "multi_channel": {}}
stereo_elem = root.find("audio/stereo")
if stereo_elem is not None:
for child in stereo_elem:
if child.text:
audio["stereo"][child.tag] = int(child.text)
multi_elem = root.find("audio/multi_channel")
if multi_elem is not None:
for child in multi_elem:
if child.text:
audio["multi_channel"][child.tag] = int(child.text)
return {
"processing_folder": processing_folder,
"suffix": suffix,
"extensions": [ext.lower() for ext in extensions],
"path_mappings": path_mappings,
"encode": {"cq": cq, "fallback": fallback, "filters": filters},
"audio": audio
}

View File

@ -1,136 +0,0 @@
# 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

View File

@ -1,35 +0,0 @@
# 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

View File

View File

View File

@ -1,638 +0,0 @@
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

355
main.py
View File

@ -1,66 +1,109 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
import csv
import json import json
import os import os
import shutil import shutil
import subprocess import subprocess
from pathlib import Path from pathlib import Path
import requests
from core.config_helper import load_config_xml
from core.logger_helper import setup_logger
# ============================= # =============================
# Setup logger # CONFIGURATION
# ============================= # =============================
LOG_FOLDER = Path(__file__).parent / "logs" SONARR_URL = "http://10.0.0.10:8989/api/v3"
logger = setup_logger(LOG_FOLDER) RADARR_URL = "http://10.0.0.10:7878/api/v3"
SONARR_API_KEY = os.getenv("SONARR_API_KEY", "")
RADARR_API_KEY = os.getenv("RADARR_API_KEY", "")
# ============================= PATH_MAPPINGS = {
# Tracker CSV "P:\\tv": "/mnt/plex/tv",
# ============================= "P:\\anime": "/mnt/plex/anime",
TRACKER_FILE = Path(__file__).parent / "conversion_tracker.csv" }
if not TRACKER_FILE.exists():
with open(TRACKER_FILE, "w", newline="", encoding="utf-8") as f: # Relative processing folder next to the script
writer = csv.writer(f) DEFAULT_PROCESSING_FOLDER = Path(__file__).parent / "processing"
writer.writerow([
"type","show","filename","original_size_MB","processed_size_MB","percentage","method" SUFFIX = " -EHX"
])
# ============================= # =============================
# AUDIO BUCKET LOGIC # AUDIO BUCKET LOGIC
# ============================= # =============================
def choose_audio_bitrate(channels: int, bitrate_kbps: int, audio_config: dict) -> int: def choose_audio_bitrate(channels: int, bitrate_kbps: int) -> int:
if channels == 2: if channels == 2:
if bitrate_kbps < 80: if bitrate_kbps < 80:
return audio_config["stereo"]["low"] return 64000
elif bitrate_kbps < 112: elif bitrate_kbps < 112:
return audio_config["stereo"]["medium"] return 96000
else: else:
return audio_config["stereo"]["high"] return 128000
else: else:
if bitrate_kbps < 176: if bitrate_kbps < 176:
return audio_config["multi_channel"]["low"] return 160000
else: else:
return audio_config["multi_channel"]["high"] return 192000
# ============================= # =============================
# PATH NORMALIZATION # PATH NORMALIZATION FOR SONARR/RADARR
# ============================= # =============================
def normalize_path_for_service(local_path: str, path_mappings: dict) -> str: def normalize_path_for_service(local_path: str) -> str:
for win_path, linux_path in path_mappings.items(): for win_path, linux_path in PATH_MAPPINGS.items():
if local_path.lower().startswith(win_path.lower()): if local_path.lower().startswith(win_path.lower()):
return local_path.replace(win_path, linux_path).replace("\\", "/") return local_path.replace(win_path, linux_path).replace("\\", "/")
return local_path.replace("\\", "/") return local_path.replace("\\", "/")
# =============================
# SONARR / RADARR RENAME
# =============================
def get_service_preferred_name(input_file: Path, service="sonarr") -> str | None:
api_key = SONARR_API_KEY if service == "sonarr" else RADARR_API_KEY
url_base = SONARR_URL if service == "sonarr" else RADARR_URL
if not api_key:
print(f"⚠️ No {service.upper()} API key; skipping rename lookup.")
return None
norm_path = normalize_path_for_service(str(input_file))
try:
r = requests.get(f"{url_base}/episodefile" if service=="sonarr" else f"{url_base}/moviefile",
headers={"X-Api-Key": api_key}, timeout=10)
r.raise_for_status()
all_files = r.json()
for f in all_files:
if f.get("path", "").lower() == norm_path.lower():
id_field = "id"
series_id_field = "seriesId" if service=="sonarr" else "movieId"
preview_endpoint = "rename/preview"
series_id = f[series_id_field]
file_id = f[id_field]
preview = requests.post(f"{url_base}/{preview_endpoint}",
headers={"X-Api-Key": api_key, "Content-Type": "application/json"},
json=[{series_id_field: series_id, "episodeFileId" if service=="sonarr" else "movieFileId": file_id}],
timeout=10)
preview.raise_for_status()
data = preview.json()
if data and "newName" in data[0]:
new_name = data[0]["newName"]
print(f"{service.capitalize()} rename: {input_file.name}{new_name}")
return new_name
print(f" No {service.capitalize()} match found for {input_file.name}")
except Exception as e:
print(f"{service.capitalize()} rename lookup failed: {e}")
return None
# ============================= # =============================
# AUDIO STREAMS DETECTION # AUDIO STREAMS DETECTION
# ============================= # =============================
def get_audio_streams(input_file: Path): def get_audio_streams(input_file: Path):
cmd = [ cmd = [
"ffprobe","-v","error","-select_streams","a", "ffprobe", "-v", "error",
"-show_entries","stream=index,channels,duration,bit_rate,tags=language", "-select_streams", "a",
"-of","json", str(input_file) "-show_entries", "stream=index,channels,bit_rate",
"-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)
@ -68,213 +111,171 @@ 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)
src_lang = s.get("tags", {}).get("language", "und") bitrate = int(int(s.get("bit_rate", 128000)) / 1000)
bit_rate_meta = int(s.get("bit_rate", 0)) if s.get("bit_rate") else 0 streams.append((index, channels, bitrate))
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):
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)
for (index, channels, avg_bitrate, src_lang, meta_bitrate) in streams: print("\n🧩 ENCODE SETTINGS")
br = choose_audio_bitrate(channels, avg_bitrate, audio_config) print(f" • Resolution: {scale_width}x{scale_height}")
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" • Scale Filter: {filter_flags}")
print(line) print(f" • CQ: {cq}")
logger.info(line) print(f" • Video Encoder: av1_nvenc (preset p1, pix_fmt p010le)")
cmd = ["ffmpeg","-y","-i",str(input_file), print(" • Audio Streams:")
"-vf",f"scale={scale_width}:{scale_height}:flags={filter_flags}:force_original_aspect_ratio=decrease", for (index, channels, bitrate) in streams:
"-map","0:v","-map","0:a","-map","0:s?", br = choose_audio_bitrate(channels, bitrate)
"-c:v","av1_nvenc","-preset","p1","-pix_fmt","p010le"] print(f" - Stream #{index}: {channels}ch, orig≈{bitrate}kbps → target {br/1000:.1f}kbps")
if method=="CQ": # --- Build CQ encode command ---
cmd += ["-cq", str(cq)] cmd = [
else: "ffmpeg", "-y", "-i", str(input_file),
if scale_height>=1080: "-vf", f"scale={scale_width}:{scale_height}:flags={filter_flags}:force_original_aspect_ratio=decrease",
vb, maxrate, bufsize = "1500k","1750k","2250k" "-map", "0:v", "-map", "0:a", "-map", "0:s?",
else: "-c:v", "av1_nvenc", "-preset", "p1", f"-cq", str(cq), "-pix_fmt", "p010le"
vb, maxrate, bufsize = "900k","1250k","1600k" ]
cmd += ["-b:v",vb,"-maxrate",maxrate,"-bufsize",bufsize]
for i, (index, channels, avg_bitrate, src_lang, meta_bitrate) in enumerate(streams): for i, (index, channels, bitrate) in enumerate(streams):
br = choose_audio_bitrate(channels, avg_bitrate, audio_config) br = choose_audio_bitrate(channels, bitrate)
cmd += [f"-c:a:{i}","aac",f"-b:a:{i}",str(br),f"-ac:{i}",str(channels)] cmd += [f"-c:a:{i}", "aac", f"-b:a:{i}", str(br), f"-ac:{i}", str(channels)]
cmd += ["-c:s","copy",str(output_file)] 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}")
print(f"\n🎬 Running CQ encode: {output_file.name}")
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
msg = f"📦 Original: {orig_size/1e6:.2f} MB → Encoded: {out_size/1e6:.2f} MB ({reduction_ratio:.1%} of original)" print(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 ---
if reduction_ratio >= 0.5:
print(f"⚠️ Size reduction insufficient ({reduction_ratio:.0%}). Retrying with bitrate-based encode...")
output_file.unlink(missing_ok=True)
# Pick bitrate settings based on resolution
if scale_height >= 1080:
vb, maxrate, bufsize = "1500k", "1750k", "2250k"
else:
vb, maxrate, bufsize = "900k", "1250k", "1600k"
print("\n🧩 FALLBACK SETTINGS")
print(f" • Bitrate Mode: Target {vb}, Maxrate {maxrate}, Bufsize {bufsize}")
print(f" • Resolution: {scale_width}x{scale_height}")
print(f" • Filter: {filter_flags}")
print(" • Audio Streams:")
for (index, channels, bitrate) in streams:
br = choose_audio_bitrate(channels, bitrate)
print(f" - Stream #{index}: {channels}ch → {br/1000:.1f}kbps AAC")
# --- Build fallback command ---
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)
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 fallback bitrate encode: {output_file.name}")
subprocess.run(cmd, check=True)
return orig_size, out_size, reduction_ratio
# ============================= # =============================
# PROCESS FOLDER # PROCESS FOLDER
# ============================= # =============================
def process_folder(folder: Path, cq: int, resolution: str, config: dict): def process_folder(folder: Path, cq: int, resolution: str, rename: bool, processing_folder: Path):
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
audio_config = config["audio"] # Determine defaults based on folder type and resolution
filters_config = config["encode"]["filters"] filter_flags = "lanczos"
suffix = config["suffix"] res_height = 1080 if resolution == "1080" else 720
extensions = config["extensions"] res_width = 1920 if resolution == "1080" else 1280
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 = filters_config.get("tv","bicubic") filter_flags = "bicubic"
cq_default = config["encode"]["cq"].get(f"tv_{resolution}",32) cq_default = 28 if resolution=="1080" else 32
else: else:
cq_default = config["encode"]["cq"].get(f"movie_{resolution}",32) cq_default = 32 if resolution=="1080" else 34
if cq is None: if cq is None:
cq = cq_default cq = cq_default
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 extensions: if file.suffix.lower() not in [".mkv", ".mp4"]:
continue continue
if any(tag.lower() in file.name.lower() for tag in ["ehx","megusta"]): if any(tag 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}")
# --- Copy to processing folder first ---
temp_input = processing_folder / file.name temp_input = processing_folder / file.name
shutil.copy2(file, temp_input) shutil.copy2(file, temp_input)
logger.info(f"Copied {file.name}{temp_input.name}")
temp_output = processing_folder / f"{file.stem}{suffix}{file.suffix}"
method = "Bitrate" if use_bitrate else "CQ" # --- Run FFmpeg ---
try: temp_output = processing_folder / f"{file.stem}{SUFFIX}{file.suffix}"
orig_size, out_size, reduction_ratio = run_ffmpeg(temp_input, temp_output, cq, res_width, res_height, filter_flags, audio_config, method) run_ffmpeg(temp_input, temp_output, cq, res_width, res_height, filter_flags)
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: # --- Optional rename via Sonarr/Radarr ---
print(f"⚠️ CQ encode did not achieve target size. Switching all remaining files to Bitrate.") final_name = temp_output.name
logger.warning("CQ encode failed target. Switching to Bitrate for remaining files.") if rename:
use_bitrate = True rename_file = get_service_preferred_name(temp_input, "sonarr")
try: if not rename_file:
# Retry current file using bitrate rename_file = get_service_preferred_name(temp_input, "radarr")
temp_output.unlink(missing_ok=True) if rename_file:
orig_size, out_size, reduction_ratio = run_ffmpeg(temp_input, temp_output, cq, res_width, res_height, filter_flags, audio_config, "Bitrate") final_name = rename_file + temp_output.suffix
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 # --- Move to completed folder or back to original ---
dest_file = file.parent / final_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}")
folder_parts = [p.lower() for p in folder.parts] # --- Cleanup ---
if "tv" in folder_parts: if dest_file.exists():
f_type = "tv" try:
tv_index = folder_parts.index("tv") temp_input.unlink() # remove processing copy
show = folder.parts[tv_index + 1] if len(folder.parts) > tv_index + 1 else "Unknown" file.unlink() # remove original
elif "anime" in folder_parts: print(f"🧹 Deleted original and processing copy")
f_type = "anime" except Exception as e:
anime_index = folder_parts.index("anime") print(f"⚠️ Could not delete files: {e}")
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 with logging and tracker") parser = argparse.ArgumentParser(description="Batch encode videos with optional Sonarr/Radarr rename")
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", default="1080", choices=["720","1080"], help="Target resolution") parser.add_argument("--r", "--resolution", dest="resolution", default="1080", choices=["720","1080"], help="Target resolution (720 or 1080)")
parser.add_argument("--rename", action="store_true", help="Attempt Sonarr/Radarr rename")
parser.add_argument("--processing", type=str, default=str(DEFAULT_PROCESSING_FOLDER), help="Processing folder")
args = parser.parse_args() args = parser.parse_args()
config_path = Path(__file__).parent / "config.xml" process_folder(Path(args.folder), args.cq, args.resolution, args.rename, Path(args.processing))
config = load_config_xml(config_path)
process_folder(Path(args.folder), args.cq, args.resolution, config)
if __name__ == "__main__": if __name__ == "__main__":