refact (core): split large code blocks, remove useless files/code #12

Merged
max merged 12 commits from formats_consistency into dev 2026-09-01 15:19:34 +04:00
Showing only changes of commit 5f68eccdbf - Show all commits
+5 -1
View File
@@ -47,7 +47,7 @@ def determine_output_format(stream_info: Dict, user_format: Optional[str],
"""
Decide which container format to use.
If user_format is provided, use it.
If user_format is provided, map it to the correct container if it's a codec name.
Else, try to detect the input file's container and codec, and use the recommended format.
If detection fails or format is not supported, fallback to:
- MKV if video/subtitles exist
@@ -55,6 +55,10 @@ def determine_output_format(stream_info: Dict, user_format: Optional[str],
- MP4 (M4A) otherwise
"""
if user_format:
# Map codec names to their correct containers
# e.g., 'opus' -> 'ogg', 'aac' -> 'mp4', etc.
if user_format in CODEC_TO_CONTAINER_MAP:
return CODEC_TO_CONTAINER_MAP[user_format]
return user_format
if input_file: