From e8a089ff705e11745eb03dc1309f4235f0471cf1 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 22 Jan 2020 15:48:50 -0800 Subject: [PATCH] Fix .mks extension by adding -f matroska. --- ffstreams.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ffstreams.py b/ffstreams.py index 64f920f..27747a8 100644 --- a/ffstreams.py +++ b/ffstreams.py @@ -17,7 +17,7 @@ AUDIO_EXTENSIONS = { SUBTITLE_EXTENSIONS = { 'ass': 'ass', 'subrip': 'srt', - '*': 'mkv', + '*': 'mks', } FFMPEG = winwhich.which('ffmpeg') @@ -44,7 +44,14 @@ def ffextractor(input_filename, prefix, search_pattern, extension_map, moveto=No output_filename = input_filename.replace_extension('').add_extension(f'{prefix}{stream_index}.{extension}') if moveto: output_filename = moveto.with_child(output_filename.basename) - maps.extend(['-map', f'0:{stream_index}', '-c', 'copy', output_filename.absolute_path]) + + args = ['-map', f'0:{stream_index}', '-c', 'copy'] + + if extension == 'mks': + args.extend(['-f', 'matroska']) + + args.append(output_filename.absolute_path) + maps.extend(args) command = [FFMPEG, '-i', input_filename.absolute_path, *maps] print(command)