working 1.0

This commit is contained in:
TylerCG 2026-08-22 21:01:42 -04:00
parent 1fe0feef33
commit 4c5e1ad280
6 changed files with 6928 additions and 8 deletions

3
bluray.txt Normal file
View File

@ -0,0 +1,3 @@
"C:\Users\Tyler\Videos\BluRay Rips\without a paddle" --audio-select 1,3 --crop 816 --keep-original
"C:\Users\Tyler\Videos\BluRay Rips\Pokemon Movie" --audio-select 1 --crop 804 --keep-original
"C:\Users\Tyler\Videos\BluRay Rips\Pokémon Movies 1-3 Collection" --audio-select 1 --keep-original

View File

@ -3312,3 +3312,8 @@ anime,Chaos Dragon (2015),Chaos Dragon - Sekiryuu Seneki 9 - [EHX].mkv,7570.84,3
anime,Chaos Dragon (2015),Chaos Dragon - Sekiryuu Seneki 2 - [EHX].mkv,6744.61,396.4,5.9,1920x1080,1920x1080,3,32,CQ anime,Chaos Dragon (2015),Chaos Dragon - Sekiryuu Seneki 2 - [EHX].mkv,6744.61,396.4,5.9,1920x1080,1920x1080,3,32,CQ
movie,N/A,The Mandalorian and Grogu (2026) h264 TrueHD Atmos 7.1 Remux-1080p BTM - [EHX].mkv,42712.99,1982.05,4.6,1920x1080,1920x1080,8,32,CQ movie,N/A,The Mandalorian and Grogu (2026) h264 TrueHD Atmos 7.1 Remux-1080p BTM - [EHX].mkv,42712.99,1982.05,4.6,1920x1080,1920x1080,8,32,CQ
movie,N/A,Dungeons and Dragons - Honor Among Thieves_t00 - [EHX].mkv,31591.75,2174.97,6.9,1920x1080,1920x804,2,28,CQ movie,N/A,Dungeons and Dragons - Honor Among Thieves_t00 - [EHX].mkv,31591.75,2174.97,6.9,1920x1080,1920x804,2,28,CQ
movie,N/A,Without a Paddle (2004) AVC TrueHD 5.1 Remux-1080p FraMeSToR - [EHX].mkv,26868.28,2598.39,9.7,1920x1080,1920x816,3,28,CQ
movie,N/A,Pokémon Detective Pikachu_t01 - [EHX].mkv,20938.15,2534.76,12.1,1920x1080,1920x804,4,28,CQ
movie,N/A,Pokémon Movies 1-3 Collection_t00 - [EHX].mkv,13812.83,1727.87,12.5,1920x1080,1920x1080,2,28,CQ
movie,N/A,Pokémon Movies 1-3 Collection_t02 - [EHX].mkv,15061.78,1871.14,12.4,1920x1080,1920x1080,2,28,CQ
movie,N/A,Pokémon Movies 1-3 Collection_t03 - [EHX].mkv,13997.76,1461.74,10.4,1920x1080,1920x1080,2,28,CQ

Can't render this file because it has a wrong number of fields in line 14.

View File

@ -144,7 +144,7 @@ def load_config_xml(path: Path) -> dict:
filters[child.tag] = child.text.strip() filters[child.tag] = child.text.strip()
# --- Audio --- # --- Audio ---
audio = {"stereo": {}, "multi_channel": {}} audio = {"stereo": {}, "multi_channel": {}, "surround_8ch": {}}
stereo_elem = root.find("audio/stereo") stereo_elem = root.find("audio/stereo")
if stereo_elem is not None: if stereo_elem is not None:
for child in stereo_elem: for child in stereo_elem:
@ -157,6 +157,12 @@ def load_config_xml(path: Path) -> dict:
if child.text and child.text.strip(): if child.text and child.text.strip():
audio["multi_channel"][child.tag] = int(child.text.strip()) audio["multi_channel"][child.tag] = int(child.text.strip())
surround_8ch_elem = root.find("audio/surround_8ch")
if surround_8ch_elem is not None:
for child in surround_8ch_elem:
if child.text and child.text.strip():
audio["surround_8ch"][child.tag] = int(child.text.strip())
# --- Services (Sonarr/Radarr) --- # --- Services (Sonarr/Radarr) ---
services = {"sonarr": {}, "radarr": {}} services = {"sonarr": {}, "radarr": {}}
sonarr_elem = root.find("services/sonarr") sonarr_elem = root.find("services/sonarr")

View File

@ -215,7 +215,14 @@ def run_ffmpeg(input_file: Path, output_file: Path, cq: int, scale_width: int, s
output_channels = 2 # Commentary always stereo output_channels = 2 # Commentary always stereo
channels_override = False channels_override = False
else: else:
output_channels = 6 if is_1080_class and channels >= 6 else 2 # Apply resolution-based channel clamping (same as choose_audio_bitrate)
if resolution_str == "2160":
max_channels = 8
elif resolution_str == "1080":
max_channels = 6
else:
max_channels = 2
output_channels = min(channels, max_channels)
channels_override = False channels_override = False
codec, br, final_channels = choose_audio_bitrate(output_channels, avg_bitrate, audio_config, is_1080_class, is_commentary, resolution_str, codec_name) codec, br, final_channels = choose_audio_bitrate(output_channels, avg_bitrate, audio_config, is_1080_class, is_commentary, resolution_str, codec_name)
@ -227,7 +234,7 @@ def run_ffmpeg(input_file: Path, output_file: Path, cq: int, scale_width: int, s
else: else:
action = "ENC" action = "ENC"
# Determine output codec based on encode choice # Determine output codec based on encode choice
output_codec = "EAC3" if codec == "eac3" else "AAC" output_codec = "Opus" if codec == "opus" else ("EAC3" if codec == "eac3" else "AAC")
output_bitrate = f"{br/1000:.0f}kbps" output_bitrate = f"{br/1000:.0f}kbps"
# Show language change if audio_language is set # Show language change if audio_language is set
@ -352,7 +359,14 @@ def run_ffmpeg(input_file: Path, output_file: Path, cq: int, scale_width: int, s
elif is_commentary: elif is_commentary:
output_channels = 2 output_channels = 2
else: else:
output_channels = 6 if is_1080_class and channels >= 6 else 2 # Apply resolution-based channel clamping (same as choose_audio_bitrate)
if resolution_str == "2160":
max_channels = 8
elif resolution_str == "1080":
max_channels = 6
else:
max_channels = 2
output_channels = min(channels, max_channels)
# Only add audio filter if re-encoding (not copying) and channels need to be remixed # Only add audio filter if re-encoding (not copying) and channels need to be remixed
if not no_encode: if not no_encode:
@ -451,7 +465,14 @@ def run_ffmpeg(input_file: Path, output_file: Path, cq: int, scale_width: int, s
elif is_commentary: elif is_commentary:
output_channels = 2 # Commentary always stereo output_channels = 2 # Commentary always stereo
else: else:
output_channels = 6 if is_1080_class and channels >= 6 else 2 # Apply resolution-based channel clamping (same as choose_audio_bitrate)
if resolution_str == "2160":
max_channels = 8
elif resolution_str == "1080":
max_channels = 6
else:
max_channels = 2
output_channels = min(channels, max_channels)
# If no_encode is True, always copy audio # If no_encode is True, always copy audio
if no_encode: if no_encode:
@ -493,21 +514,21 @@ def run_ffmpeg(input_file: Path, output_file: Path, cq: int, scale_width: int, s
cmd += [ cmd += [
f"-c:a:{i}", "libopus", f"-c:a:{i}", "libopus",
f"-b:a:{i}", str(br), f"-b:a:{i}", str(br),
f"-ac:{i}", str(final_channels) f"-ac:a:{i}", str(final_channels)
] ]
elif codec == "eac3": elif codec == "eac3":
# Enhanced AC-3 (5.1 surround) # Enhanced AC-3 (5.1 surround)
cmd += [ cmd += [
f"-c:a:{i}", "eac3", f"-c:a:{i}", "eac3",
f"-b:a:{i}", str(br), f"-b:a:{i}", str(br),
f"-ac:{i}", str(final_channels) f"-ac:a:{i}", str(final_channels)
] ]
else: else:
# AAC (stereo) # AAC (stereo)
cmd += [ cmd += [
f"-c:a:{i}", "aac", f"-c:a:{i}", "aac",
f"-b:a:{i}", str(br), f"-b:a:{i}", str(br),
f"-ac:{i}", str(final_channels) f"-ac:a:{i}", str(final_channels)
] ]
# Only add language metadata if explicitly provided # Only add language metadata if explicitly provided
if audio_language: if audio_language:

File diff suppressed because it is too large Load Diff

View File

@ -187,3 +187,7 @@
2026-08-22 02:21:31 | Dungeons and Dragons - Honor Among Thieves_t00.mkv | CQ error: Command '['ffmpeg', '-y', '-i', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\Dungeons and Dragons - Honor Among Thieves_t00.mkv', '-vf', 'crop=in_w:804:0:138,scale=1920:804:flags=lanczos,setsar=1:1', '-map', '0:v:0', '-map', '0:1', '-af', '[0:a:0', '-c:v', 'av1_nvenc', '-preset', 'p7', '-pix_fmt', 'yuv420p', '-cq', '32', '-c:a:0', 'eac3', '-b:a:0', '448000', '-ac:0', '6', '-metadata:s:a:0', 'title=', '-c:s', 'copy', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\Dungeons and Dragons - Honor Among Thieves_t00 - [EHX].mkv']' returned non-zero exit status 4294967274. 2026-08-22 02:21:31 | Dungeons and Dragons - Honor Among Thieves_t00.mkv | CQ error: Command '['ffmpeg', '-y', '-i', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\Dungeons and Dragons - Honor Among Thieves_t00.mkv', '-vf', 'crop=in_w:804:0:138,scale=1920:804:flags=lanczos,setsar=1:1', '-map', '0:v:0', '-map', '0:1', '-af', '[0:a:0', '-c:v', 'av1_nvenc', '-preset', 'p7', '-pix_fmt', 'yuv420p', '-cq', '32', '-c:a:0', 'eac3', '-b:a:0', '448000', '-ac:0', '6', '-metadata:s:a:0', 'title=', '-c:s', 'copy', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\Dungeons and Dragons - Honor Among Thieves_t00 - [EHX].mkv']' returned non-zero exit status 4294967274.
2026-08-22 02:23:58 | Dungeons and Dragons - Honor Among Thieves_t00.mkv | CQ error: Command '['ffmpeg', '-y', '-i', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\Dungeons and Dragons - Honor Among Thieves_t00.mkv', '-i', 'C:\\Users\\Tyler\\Videos\\BluRay Rips\\4k DND\\Dungeons and Dragons - Honor Among Thieves_t00.en.srt', '-vf', 'crop=in_w:804:0:138,scale=1920:804:flags=lanczos,setsar=1:1', '-map', '0:v:0', '-map', '0:1', '-af', '[0:a:0', '-map', '1:s', '-c:v', 'av1_nvenc', '-preset', 'p7', '-pix_fmt', 'yuv420p', '-cq', '32', '-c:a:0', 'eac3', '-b:a:0', '448000', '-ac:0', '6', '-metadata:s:a:0', 'title=', '-c:s', 'srt', '-metadata:s:s:0', 'language=eng', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\Dungeons and Dragons - Honor Among Thieves_t00 - [EHX].mkv']' returned non-zero exit status 4294967274. 2026-08-22 02:23:58 | Dungeons and Dragons - Honor Among Thieves_t00.mkv | CQ error: Command '['ffmpeg', '-y', '-i', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\Dungeons and Dragons - Honor Among Thieves_t00.mkv', '-i', 'C:\\Users\\Tyler\\Videos\\BluRay Rips\\4k DND\\Dungeons and Dragons - Honor Among Thieves_t00.en.srt', '-vf', 'crop=in_w:804:0:138,scale=1920:804:flags=lanczos,setsar=1:1', '-map', '0:v:0', '-map', '0:1', '-af', '[0:a:0', '-map', '1:s', '-c:v', 'av1_nvenc', '-preset', 'p7', '-pix_fmt', 'yuv420p', '-cq', '32', '-c:a:0', 'eac3', '-b:a:0', '448000', '-ac:0', '6', '-metadata:s:a:0', 'title=', '-c:s', 'srt', '-metadata:s:s:0', 'language=eng', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\Dungeons and Dragons - Honor Among Thieves_t00 - [EHX].mkv']' returned non-zero exit status 4294967274.
2026-08-22 02:27:13 | Dungeons and Dragons - Honor Among Thieves_t00.mkv | CQ error: Command '['ffmpeg', '-y', '-i', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\Dungeons and Dragons - Honor Among Thieves_t00.mkv', '-i', 'C:\\Users\\Tyler\\Videos\\BluRay Rips\\4k DND\\Dungeons and Dragons - Honor Among Thieves_t00.en.srt', '-vf', 'crop=in_w:804:0:138,scale=1920:804:flags=lanczos,setsar=1:1', '-map', '0:v:0', '-map', '0:1', '-filter_complex', '[0:a:0]aformat=channel_layouts=5.1[a0]', '-map', '1:s', '-c:v', 'av1_nvenc', '-preset', 'p7', '-pix_fmt', 'yuv420p', '-cq', '32', '-c:a:0', 'eac3', '-b:a:0', '448000', '-ac:0', '6', '-metadata:s:a:0', 'title=', '-c:s', 'srt', '-metadata:s:s:0', 'language=eng', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\Dungeons and Dragons - Honor Among Thieves_t00 - [EHX].mkv']' returned non-zero exit status 4294967274. 2026-08-22 02:27:13 | Dungeons and Dragons - Honor Among Thieves_t00.mkv | CQ error: Command '['ffmpeg', '-y', '-i', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\Dungeons and Dragons - Honor Among Thieves_t00.mkv', '-i', 'C:\\Users\\Tyler\\Videos\\BluRay Rips\\4k DND\\Dungeons and Dragons - Honor Among Thieves_t00.en.srt', '-vf', 'crop=in_w:804:0:138,scale=1920:804:flags=lanczos,setsar=1:1', '-map', '0:v:0', '-map', '0:1', '-filter_complex', '[0:a:0]aformat=channel_layouts=5.1[a0]', '-map', '1:s', '-c:v', 'av1_nvenc', '-preset', 'p7', '-pix_fmt', 'yuv420p', '-cq', '32', '-c:a:0', 'eac3', '-b:a:0', '448000', '-ac:0', '6', '-metadata:s:a:0', 'title=', '-c:s', 'srt', '-metadata:s:s:0', 'language=eng', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\Dungeons and Dragons - Honor Among Thieves_t00 - [EHX].mkv']' returned non-zero exit status 4294967274.
2026-08-22 16:47:35 | The Fast and the Furious_t03.mkv | Unexpected error: 'surround_8ch'
2026-08-22 17:07:51 | The Fast and the Furious_t03.mkv | CQ error: Command '['ffmpeg', '-y', '-i', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\The Fast and the Furious_t03.mkv', '-vf', 'crop=in_w:1634:0:263,scale=3840:1634:flags=lanczos,setsar=1:1', '-map', '0:v:0', '-map', '0:1', '-map', '0:3', '-c:v', 'hevc_nvenc', '-preset', 'p7', '-pix_fmt', 'p010le', '-cq', '24', '-c:a:0', 'libopus', '-b:a:0', '768000', '-ac:0', '8', '-metadata:s:a:0', 'title=', '-c:a:1', 'aac', '-b:a:1', '128000', '-ac:1', '2', '-metadata:s:a:1', 'title=Commentary', '-c:s', 'copy', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\The Fast and the Furious_t03 - [EHX].mkv']' returned non-zero exit status 4294967274.
2026-08-22 17:20:54 | The Fast and the Furious_t03.mkv | CQ error: Command '['ffmpeg', '-y', '-i', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\The Fast and the Furious_t03.mkv', '-vf', 'crop=in_w:1634:0:263,scale=3840:1634:flags=lanczos,setsar=1:1', '-map', '0:v:0', '-map', '0:1', '-map', '0:3', '-c:v', 'hevc_nvenc', '-preset', 'p7', '-pix_fmt', 'p010le', '-cq', '24', '-c:a:0', 'libopus', '-b:a:0', '768000', '-ac:0', '8', '-mapping_family', '1', '-metadata:s:a:0', 'title=', '-c:a:1', 'aac', '-b:a:1', '128000', '-ac:1', '2', '-metadata:s:a:1', 'title=Commentary', '-c:s', 'copy', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\The Fast and the Furious_t03 - [EHX].mkv']' returned non-zero exit status 4294967274.
2026-08-22 17:47:54 | The Fast and the Furious_t03.mkv | CQ error: Command '['ffmpeg', '-y', '-i', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\The Fast and the Furious_t03.mkv', '-vf', 'crop=in_w:1634:0:263,scale=3840:1634:flags=lanczos,setsar=1:1', '-map', '0:v:0', '-map', '0:1', '-map', '0:3', '-c:v', 'hevc_nvenc', '-preset', 'p7', '-pix_fmt', 'p010le', '-cq', '24', '-c:a:0', 'libopus', '-b:a:0', '768000', '-ac:0', '8', '-metadata:s:a:0', 'title=', '-c:a:1', 'aac', '-b:a:1', '128000', '-ac:1', '2', '-metadata:s:a:1', 'title=Commentary', '-c:s', 'copy', 'C:\\Users\\Tyler\\Documents\\GitHub\\conversion_project\\processing\\The Fast and the Furious_t03 - [EHX].mkv']' returned non-zero exit status 4294967274.