Skip to content

Commit

Permalink
Only map video, audio, & subtitle during default convert (#14)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
raydouglass authored May 18, 2024
1 parent 392c16a commit 121888e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion media_management_scripts/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 121888e

Please sign in to comment.