1
votes

I am trying to add multiple languages of subtitles to a video using ffmpeg. I succeeded in adding 1 language, but can't seem to add a second one. I use this simple script to add english subtitles to my video.

ffmpeg -i %1 -i subs_eng.srt -map 0 -vcodec copy -acodec copy -scodec subrip -metadata:s:s:0 language=English "%~n1"_eng.mkv

In addition, I run another script to add the Dutch subtitles.

ffmpeg -i %1 -i subs_nl.srt -map 0? -vcodec copy -acodec copy -scodec subrip -metadata:s:s:1 language=Dutch "%~n1"_nl.mkv

But whenever I add the second language, it doesn't seem to do anything. The command terminal shows that ffmpeg is processing the video, but there is only 1 subtitle language available in vlc media player (the first one).

I really want to be able to add it in 2 takes rather than in the same script, as I don't have both languages for all of my video's.

1

1 Answers

2
votes

Without -map for the subtitle stream, ffmpeg will select only one subtitle stream from among all inputs.

ffmpeg -i %1 -i subs_nl.srt -map 0 -map 1 -vcodec copy -acodec copy -c:s:0 copy -c:s:1 subrip -metadata:s:s:1 language=Dutch "%~n1"_nl.mkv

I set codec mode for the existing subtitle stream to copy and subrip for only the new one. This assumes you muxed exactly one subtitle stream earlier.