Extract subtitles from mp4 file

Identify which track contains the subtitles:

$ ffmpeg -i video.mp4
    Stream #0:1(und): Audio: [...]
    Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
      handler_name    : SubtitleHandler
    Stream #0:3: Video:  [...]

Then, replacing -codec:s:X.Y with the actual stream channel found in the output above:

ffmpeg -i video.mp4 -vn -an -codec:s:0.2 srt video.srt

Nvidia NVENC


Example use:
Use NVENC for transcoding MPEG2 (MOVIE-raw.mkv) to X264 with ffmpeg. The sound (ac3-sound) is just copied.

Without nvenc:

ffmpeg -i MOVIE-raw.mkv -vf "crop=720:416:0:80" -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 0:4 -map 0:5 -c:v libx264 -crf 18 -preset veryslow -tune film -c:s copy -c:a:0 copy -c:a:1 copy enc-MOVIE-raw.mkv

result: frame= 1626 fps= 48 q=-1.0 Lsize= 12518kB time=00:01:05.05 bitrate=1576.3kbits/s speed=1.93x

with nvenc:

Syndicate content