尝试将 mkv 与 SRT 字幕结合起来时出现问题

尝试将 mkv 与 SRT 字幕结合起来时出现问题

尝试将字幕嵌入 mkv 格式时遇到此问题。

ffmpeg -i Silence2016.mkv English.srt -map 0 -map 1 -c copy output.mkv
ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --disable-lzma --enable-nonfree --enable-vda
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, matroska,webm, from 'Silence2016.mkv':
  Metadata:
    encoder         : libebml v1.3.3 + libmatroska v1.4.4
    creation_time   : 2017-03-14T12:39:18.000000Z
  Duration: 02:41:24.47, start: 0.000000, bitrate: 3935 kb/s
    Chapter #0:0: start 0.000000, end 779.000000
    Metadata:
      title           : Chapter 1
    Chapter #0:1: start 779.000000, end 1334.000000
    Metadata:
      title           : Chapter 2
    Chapter #0:2: start 1334.000000, end 2000.000000
    Metadata:
      title           : Chapter 3
    Chapter #0:3: start 2000.000000, end 2517.000000
    Metadata:
      title           : Chapter 4
    Chapter #0:4: start 2517.000000, end 3073.000000
    Metadata:
      title           : Chapter 5
    Chapter #0:5: start 3073.000000, end 3794.000000
    Metadata:
      title           : Chapter 6
    Chapter #0:6: start 3794.000000, end 4256.000000
    Metadata:
      title           : Chapter 7
    Chapter #0:7: start 4256.000000, end 4978.000000
    Metadata:
      title           : Chapter 8
    Chapter #0:8: start 4978.000000, end 5419.000000
    Metadata:
      title           : Chapter 9
    Chapter #0:9: start 5419.000000, end 6108.000000
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 6108.000000, end 6476.000000
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 6476.000000, end 6885.000000
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 6885.000000, end 7836.000000
    Metadata:
      title           : Chapter 13
    Chapter #0:13: start 7836.000000, end 8350.000000
    Metadata:
      title           : Chapter 14
    Chapter #0:14: start 8350.000000, end 9261.000000
    Metadata:
      title           : Chapter 15
    Chapter #0:15: start 9261.000000, end 9684.467000
    Metadata:
      title           : Chapter 16
    Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1916x800 [SAR 1:1 DAR 479:200], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 3550456
      BPS-eng         : 3550456
      DURATION        : 02:41:24.467000000
      DURATION-eng    : 02:41:24.467000000
      NUMBER_OF_FRAMES: 232195
      NUMBER_OF_FRAMES-eng: 232195
      NUMBER_OF_BYTES : 4298035203
      NUMBER_OF_BYTES-eng: 4298035203
      _STATISTICS_WRITING_APP: mkvmerge v8.5.2 ('Crosses') 32bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.5.2 ('Crosses') 32bit
      _STATISTICS_WRITING_DATE_UTC: 2017-03-14 12:39:18
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-03-14 12:39:18
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
    Metadata:
      BPS             : 384000
      BPS-eng         : 384000
      DURATION        : 02:41:07.616000000
      DURATION-eng    : 02:41:07.616000000
      NUMBER_OF_FRAMES: 302113
      NUMBER_OF_FRAMES-eng: 302113
      NUMBER_OF_BYTES : 464045568
      NUMBER_OF_BYTES-eng: 464045568
      _STATISTICS_WRITING_APP: mkvmerge v8.5.2 ('Crosses') 32bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.5.2 ('Crosses') 32bit
      _STATISTICS_WRITING_DATE_UTC: 2017-03-14 12:39:18
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-03-14 12:39:18
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Output #0, srt, to 'English.srt':
Output file #0 does not contain any stream

知道哪里出了问题吗?

答案1

遵照你的命令,

ffmpeg -i Silence2016.mkv English.srt -map 0 -map 1 -c copy output.mkv

SRT 文件名前面没有-i,所以 ffmpeg 认为它是输出文件的名称。通常,ffmpeg 会从可以复用到输出的输入中选择一个流,但由于 MKV 没有子流,因此没有要转码的流。不幸的是,当 ffmpeg 打开 SRT 进行写入时,SRT 几乎肯定已被清除。

如果您有 SRT 的备份,请使用

ffmpeg -i Silence2016.mkv -i English.srt -map 0 -map 1 -c copy output.mkv

相关内容