Fuente: https://www.blackestknight.com/index.php/2016/10/13/use-avconv-to-add-subtitles/
avconv -i origen.ts -f srt -i origen.srt -c:v copy -c:a copy -c:s mov_text destino.mp4
2 pistas de subtítulos:
avconv -i input.mp4 -f srt -i input.srt -i input2.srt -map 0:0 -map 0:1 -map 1:0 -map 2:0 -c:v copy -c:a copy -c:s srt -c:s srt output.mkv
mkvmerge en el paquete mkvtoolnix
# mkvmerge -o mymovie.mkv mymovie.avi mymovie.srt
mkvmerge -o 1x01.mkv peli.avi --language 0:English subtitulo_english.srt --language 0:es subtitulo_spanish.srt
Para listar códigos de lenguaje:
mkvmerge --list-languages
Ejemplo:
English language name | ISO639-2 code | ISO639-1 code |
---|---|---|
English | eng | en |
Spanish | spa | es |
mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut without-lang-codes.mkv
# mkvmerge -i 1x01.mkv
File '1x01.mkv': container: Matroska Track ID 1: video (V_MS/VFW/FOURCC, XVID) Track ID 2: audio (A_MPEG/L3) Track ID 3: audio (A_MPEG/L3) Track ID 4: subtitles (S_TEXT/UTF8) Track ID 5: subtitles (S_TEXT/UTF8)
# mkvextract tracks fichero.mkv 1:fichero_video.avi 2:fichero_audio.mp3 Extracting track 1 with the CodecID 'V_MPEG4/ISO/AVC' to the file 'fichero_video.avi'. Container format: AVC/h.264 elementary stream Extracting track 2 with the CodecID 'A_AC3' to the file 'fichero_audio.mp3'. Container format: Dolby Digital (AC3) Progress: 100%
Para que funcione, da un error al cargar el video:
$ sudo add-apt-repository ppa:nilarimogard/webupd8 $ sudo apt-get update && sudo apt-get install subtitleeditor