ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.42k stars 9.96k forks source link

Automatically embed subtitles in mkv files #5410

Open zJoul opened 9 years ago

zJoul commented 9 years ago

Since it's possible to embed subtitles in mp4 (in a hard coded way probably), is there a way to embed subtitles files with mkvmerge or with ffmpeg in the post-processing option ?

(Maybe use the --exec command)

kphillisjr commented 8 years ago

This is an interesting idea, and to modify the program requires one to know the proper way to call mkvmerge.

# Example Invocation muxing streams into a specified file:
mkvmerge -o "MyMuxedVideo.mkv" videostream.mp4 --default-track 0 subtitle.enUS.ass subitle.esLA.ass subtitle.ptBR.ass
# Above example, but adding language Identifiers:
# NOTE: Language codes are based on ISO639-2
mkvmerge -o "MyMuxedVideo_withLanguages.mkv"  videostream.mp4 --default-track 0 \
   --language 0:en subtitle.enUS.ass  \
   --language 0:es subtitle.esLA.ass \
   --language 0:por subtitle.ptBR.ass
kdeldycke commented 7 years ago

Isn't that one already supported via the --embed-subs option?

zJoul commented 7 years ago

I can't tell if at the time, the option was available, or at least available for mkv videos.

I did not dig in the source code, but maybe this option hardcode the subtitle into the video, altering the source. I wanted a way for softsubbing.