Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete subtiltes from an MKV with FFMPEG

Tags:

ffmpeg

mkv

Can anonye tell me a way to delete all subtiles except from a number of specified languages from a MKV with FFMPEG, preferrably in way that this could be done sequentially from mutltiple files ?

like image 975
Bonita Montero Avatar asked Oct 15 '25 15:10

Bonita Montero


1 Answers

Use the -map option. Example:

ffmpeg -i input.mkv -map 0 -map -0:s -map 0:s:m:language:fra -c copy output.mkv
  • -map 0 Select all streams from input 0 (which is input.mkv in this example).
  • -map -0:s Negative mapping that omits all subtitle streams from input 0.
  • -map 0:s:m:language:fra means input 0:subtitles:metadata:language:french which selects all subtitles streams with French language metadata.
  • -c copy Enables stream copy mode to only re-mux and not re-encoding.

As for sequential usage the answer depends on your OS. See How do you convert an entire directory with ffmpeg? for many examples.

like image 73
llogan Avatar answered Oct 17 '25 11:10

llogan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!