From 121888efdf34d569ccc01c3f76c5dc18f6396be9 Mon Sep 17 00:00:00 2001 From: Ray Douglass <3107146+raydouglass@users.noreply.github.com> Date: Fri, 17 May 2024 21:50:54 -0400 Subject: [PATCH] Only map video, audio, & subtitle during default convert (#14) When performing a regular convert, instead of mapping _all_ streams, only map the video, audio, and subtitles streams. Some videos include extra "other" streams which often are not easily handled. More than likely, the user doesn't care about these streams, so it's okay to drop them. --- media_management_scripts/convert.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/media_management_scripts/convert.py b/media_management_scripts/convert.py index 87019c4..f7c7cde 100644 --- a/media_management_scripts/convert.py +++ b/media_management_scripts/convert.py @@ -207,7 +207,12 @@ def convert_with_config( args.extend(["-c:s", "copy"]) if not mappings: - args.extend(["-map", "0"]) + if metadata.video_streams: + args.extend(["-map", "0:v"]) + if metadata.audio_streams: + args.extend(["-map", "0:a"]) + if metadata.subtitle_streams: + args.extend(["-map", "0:s"]) else: for m in mappings: if type(m) == int: