I have a video in MP4 format that is predominantly English language, but has a scene in which a character speaks another language. I have an English subtitle track in SRT format for this character's dialogue. Is it possible to embed the subtitle track in the MP4 itself and have it be on by default without having to manually turn it on. With the command I'm currently using (below), the subtitle track is added to the file, but I have to manually select it when playing the video.
ffmpeg -i movie.mp4 -i movie.srt -c:v copy -c:a copy -c:s mov_text \
-metadata:s:s:0 language=eng movie-sub.mp4
Is there some other bit of metadata I need to add in order for the subs to show up by default? I'd like to avoid hard subs if possible. If this is a limitation of the MP4 container, I'd be fine with switching to another format like MKV.
Output from ffmpeg:
ffmpeg version 2.1.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Dec 31 2013 15:44:02 with Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-nonfree --enable-libfaac
libavutil 52. 48.101 / 52. 48.101
libavcodec 55. 39.101 / 55. 39.101
libavformat 55. 19.104 / 55. 19.104
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 90.100 / 3. 90.100
libavresample 1. 1. 0 / 1. 1. 0
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'movie.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2013-03-18 08:10:43
Duration: 01:37:23.05, start: 0.000000, bitrate: 1877 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 1683 kb/s, 23.98 fps, 23.98 tbr, 48k tbn, 47.95 tbc (default)
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 191 kb/s (default)
Input #1, srt, from 'movie.srt':
Duration: N/A, bitrate: N/A
Stream #1:0: Subtitle: subrip
Output #0, mp4, to 'movie-sub.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf55.19.104
Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720, q=2-31, 1683 kb/s, 23.98 fps, 48k tbn, 48k tbc (default)
Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 191 kb/s (default)
Stream #0:2(eng): Subtitle: mov_text ([8][0][0][0] / 0x0008)
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Stream #1:0 -> #0:2 (subrip -> mov_text)
Press [q] to stop, [?] for help
frame=140093 fps=9457 q=-1.0 Lsize= 1340911kB time=01:37:23.04 bitrate=1880.0kbits/s
video:1200658kB audio:136946kB subtitle:0 global headers:0kB muxing overhead 0.247196%
ffmpeg -i movie-sub.mp4 -c copy -map 0 -t 1 out.mp4
and upload it somewhere?