Changed audio processing of input codecs
This commit is contained in:
@@ -22,7 +22,7 @@ DIR_COMPLETED = Path("completed")
|
|||||||
DIR_ORIGINAL = Path("original")
|
DIR_ORIGINAL = Path("original")
|
||||||
|
|
||||||
REMUX_CODECS = {"aac", "opus"} # Using a set for efficient lookups
|
REMUX_CODECS = {"aac", "opus"} # Using a set for efficient lookups
|
||||||
CONVERT_CODECS = {"dts", "ac3", "eac3", "flac", "wavpack", "alac"}
|
# Removed CONVERT_CODECS, now all non-remux codecs will be converted
|
||||||
|
|
||||||
def check_tools():
|
def check_tools():
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
@@ -222,7 +222,8 @@ def main(no_downmix=False):
|
|||||||
print(f"Processing Audio Stream #{stream_index} (TID: {track_id}, Codec: {codec}, Channels: {channels})")
|
print(f"Processing Audio Stream #{stream_index} (TID: {track_id}, Codec: {codec}, Channels: {channels})")
|
||||||
if codec in REMUX_CODECS:
|
if codec in REMUX_CODECS:
|
||||||
audio_tracks_to_remux.append(str(track_id))
|
audio_tracks_to_remux.append(str(track_id))
|
||||||
elif codec in CONVERT_CODECS:
|
else:
|
||||||
|
# Convert any codec that is not in REMUX_CODECS
|
||||||
opus_file = convert_audio_track(
|
opus_file = convert_audio_track(
|
||||||
stream_index, channels, language, audio_temp_dir, str(input_file_abs), not no_downmix
|
stream_index, channels, language, audio_temp_dir, str(input_file_abs), not no_downmix
|
||||||
)
|
)
|
||||||
@@ -232,9 +233,6 @@ def main(no_downmix=False):
|
|||||||
"Title": track_title,
|
"Title": track_title,
|
||||||
"Delay": track_delay
|
"Delay": track_delay
|
||||||
})
|
})
|
||||||
else:
|
|
||||||
print(f"Warning: Unsupported codec '{codec}'. Remuxing as is.", file=sys.stderr)
|
|
||||||
audio_tracks_to_remux.append(str(track_id))
|
|
||||||
|
|
||||||
print("--- Finished Audio Processing ---")
|
print("--- Finished Audio Processing ---")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user