FFmpeg,错误硬编码字幕

时间:2016-01-09 18:45:22

标签: ffmpeg

我正在尝试使用ffmpeg对字幕进行硬编码,但它会出现此错误:

No such filter: 'subtitles'
Error opening filters!

我的ffmpeg命令和完整的控制台输出:

root@srv96:/home/Kawaii/web/mysite.com/public_html# ffmpeg -i input.mkv -vf subtitles=input.mkv output.mp4
ffmpeg version 1.0.10 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul 25 2014 07:50:40 with gcc 4.7 (Debian 4.7.2-5)
  configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libfdk-aac --enable-libdc1394 --disable-altivec --dis  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, matroska,webm, from 'input.mkv':
  Metadata:
    creation_time   : 2015-11-22 10:34:03
  Duration: 00:12:30.22, start: 0.000000, bitrate: 578 kb/s
    Stream #0:0: Video: h264 (High), yuv420p, 1280x720, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 524797
      BPS-eng         : 524797
      DURATION        : 00:12:30.083000000
      DURATION-eng    : 00:12:30.083000000
      NUMBER_OF_FRAMES: 17984
      NUMBER_OF_FRAMES-eng: 17984
      NUMBER_OF_BYTES : 49205170
      NUMBER_OF_BYTES-eng: 49205170
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2015-11-22 10:34:03
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-11-22 10:34:03
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(jpn): Audio: aac, 48000 Hz, stereo, s16 (default)
    Metadata:
      BPS             : 52275
      BPS-eng         : 52275
      DURATION        : 00:12:30.209000000
      DURATION-eng    : 00:12:30.209000000
      NUMBER_OF_FRAMES: 17583
      NUMBER_OF_FRAMES-eng: 17583
      NUMBER_OF_BYTES : 4902222
      NUMBER_OF_BYTES-eng: 4902222
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2015-11-22 10:34:03
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-11-22 10:34:03
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2: Subtitle: ssa (default)
    Metadata:
      BPS             : 94
      BPS-eng         : 94
      DURATION        : 00:12:29.290000000
      DURATION-eng    : 00:12:29.290000000
      NUMBER_OF_FRAMES: 166
      NUMBER_OF_FRAMES-eng: 166
      NUMBER_OF_BYTES : 8841
      NUMBER_OF_BYTES-eng: 8841
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2015-11-22 10:34:03
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-11-22 10:34:03
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
[AVFilterGraph @ 0x6e4a60] No such filter: 'subtitles'
Error opening filters!
root@srv96:/home/Kawaii/web/mysite.com/public_html#

使用debian 7。

2 个答案:

答案 0 :(得分:0)

您的ffmpeg太旧了。 Download a buildcompile

确保使用--enable-libass配置。

答案 1 :(得分:0)

  

ffmpeg -i input.mkv -vf subtitles = input.mkv output.mp4。

您可能为参数subtitles提供了错误的值。 另请参见文档https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements

[编辑]在ffmpeg配置行中,我可以看到您已经配置了--enable-libass。但是,您使用的ffmpeg版本太旧了。从here开始,我发现自1.1版以来,它更好地支持字幕。因此,您可以尝试使用最新的ffmpeg。