Fix .mks extension by adding -f matroska.

This commit is contained in:
voussoir 2020-01-22 15:48:50 -08:00
parent a5db669139
commit e8a089ff70

View file

@ -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)