2

This related post gives a solution:

mkvmerge -o output.mkv input.mkv -S # remove all subtitle tracks

This other related post gives a solution:

ffmpeg -i input.mp4 -c:v copy -c:a copy -map_metadata 0:g -map_metadata:s:v 0:s:v -map_metadata:s:a 0:s:a -movflags +faststart -threads 8 -sn removed.mp4

However, both of these solutions require "streaming" all the video/audio tracks to another file, and just skip adding the subtitle streams. Is it possible to simply remove the subtitle track(s) from a movie file without having to stream anything?

Streaming video/audio tracks require significant resources, time, and is basically a remux. I'd like to simply remove the embedded subtitles and touch nothing else... Usually it is a .mkv file, but it could be other formats (e.g. .mp4 as well).

3
  • Not possible with ffmpeg. Commented Aug 3, 2020 at 23:55
  • Is it possible some other way (such as @Moab's comment)? I didn't specifically ask for a way to do this using ffmpeg. I have edited the title, and I will leave ffmpeg since it is quite relevant and is a popular tag. Commented Aug 4, 2020 at 3:26
  • what would be a better tag to add? Commented Aug 4, 2020 at 3:29

1 Answer 1

7

The -sn option does exactly that.

https://ffmpeg.org/ffmpeg.html#Subtitle-options

-sn (input/output)
...
As an output option, disables subtitle recording i.e. automatic selection or mapping of any subtitle stream. For full manual control see the -map option.

Example:

ffmpeg -i video.mkv -c copy -sn video.sn.mkv

add -map 0 to keep all available streams:

ffmpeg -i video.mkv -map 0 -c copy -sn video.sn.mkv

5
  • 1
    Thanks for your suggestion. I don't think it answers the question though, due to it still requiring "streaming" of the video/audio tracks as described in my post. Additionally, in my post, I put a command that already includes the -sn option. Commented Aug 30, 2022 at 21:09
  • Now I understand what you want to achieve. I'm not sure if ffmpeg is able to overwrite the source file directly. Also if something goes wrong, the source file will get corrupted. It would be cool to have a tool that lets us open the file as if it were a folder, so that we would then be able to remove its content just like we do when using a file explorer/manager. But I'm not sure that such a tools exists. Commented Feb 15, 2024 at 12:32
  • Thanks, you described it a bit better than I did -- "opening the file like a folder and taking out a particular track". This explanation makes sense (with the consequence that you will have to essentially make a copy of the original file with modifications such as removing a track). Commented Feb 28, 2024 at 15:21
  • 1
    Note that if the file contains multiple audio streams then this command will remove all but one of them! Add the parameter -map 0 to only affect subtitle streams. Commented Apr 2, 2024 at 16:35
  • @yzfr1 true, gonna add that Commented Nov 28, 2024 at 13:16

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.