0

When I use ffmpeg with this command:

$ ffmpeg -i ~/Desktop/The_Karate_Kid_2010.mkv -c:v libx264 -c:a libfdk_aac -c:s mov_text ~/Desktop/The_Karate_Kid_2010.mp4

It works, until this error appears:

Error while opening encoder for output stream #0:2 - maybe incorrect parameters such as bit_rate, rate, width or height

What should I do to fix this? Here is the output:

ffmpeg -i ~/Desktop/The_Karate_Kid_2010.mkv -c:v libx264 -c:a libfdk_aac -c:s mov_text ~/Desktop/file.mp4
ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 8.1.0 (clang-802.0.42)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --disable-lzma --enable-nonfree --enable-vda
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libavresample   3.  5.  0 /  3.  5.  0
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Input #0, matroska,webm, from '/Users/Henry/Desktop/The_Karate_Kid_2010.mkv':
  Metadata:
    title           : Karate Kid, The
    encoder         : libmakemkv v1.10.7 (1.3.3/1.4.4) darwin(x64-release)
    creation_time   : 2017-10-01T21:56:39.000000Z
  Duration: 02:20:01.99, start: 0.000000, bitrate: 4488 kb/s
    Chapter #0:0: start 0.000000, end 423.055967
    Metadata:
      title           : Chapter 01
    Chapter #0:1: start 423.055967, end 627.259967
    Metadata:
      title           : Chapter 02
    Chapter #0:2: start 627.259967, end 907.273033
    Metadata:
      title           : Chapter 03
    Chapter #0:3: start 907.273033, end 1194.560033
    Metadata:
      title           : Chapter 04
    Chapter #0:4: start 1194.560033, end 1468.233433
    Metadata:
      title           : Chapter 05
    Chapter #0:5: start 1468.233433, end 1857.288767
    Metadata:
      title           : Chapter 06
    Chapter #0:6: start 1857.288767, end 2094.058633
    Metadata:
      title           : Chapter 07
    Chapter #0:7: start 2094.058633, end 2390.321267
    Metadata:
      title           : Chapter 08
    Chapter #0:8: start 2390.321267, end 2797.895100
    Metadata:
      title           : Chapter 09
    Chapter #0:9: start 2797.895100, end 2993.357033
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 2993.357033, end 3295.992700
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 3295.992700, end 3615.945667
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 3615.945667, end 3878.624750
    Metadata:
      title           : Chapter 13
    Chapter #0:13: start 3878.624750, end 4187.983800
    Metadata:
      title           : Chapter 14
    Chapter #0:14: start 4187.983800, end 4470.599467
    Metadata:
      title           : Chapter 15
    Chapter #0:15: start 4470.599467, end 4825.587433
    Metadata:
      title           : Chapter 16
    Chapter #0:16: start 4825.587433, end 5062.690967
    Metadata:
      title           : Chapter 17
    Chapter #0:17: start 5062.690967, end 5444.372267
    Metadata:
      title           : Chapter 18
    Chapter #0:18: start 5444.372267, end 5734.995933
    Metadata:
      title           : Chapter 19
    Chapter #0:19: start 5734.995933, end 6105.065633
    Metadata:
      title           : Chapter 20
    Chapter #0:20: start 6105.065633, end 6418.678933
    Metadata:
      title           : Chapter 21
    Chapter #0:21: start 6418.678933, end 6625.585633
    Metadata:
      title           : Chapter 22
    Chapter #0:22: start 6625.585633, end 6980.406767
    Metadata:
      title           : Chapter 23
    Chapter #0:23: start 6980.406767, end 7140.666867
    Metadata:
      title           : Chapter 24
    Chapter #0:24: start 7140.666867, end 7438.197433
    Metadata:
      title           : Chapter 25
    Chapter #0:25: start 7438.197433, end 7875.534333
    Metadata:
      title           : Chapter 26
    Chapter #0:26: start 7875.534333, end 7977.302667
    Metadata:
      title           : Chapter 27
    Chapter #0:27: start 7977.302667, end 8401.993600
    Metadata:
      title           : Chapter 28
    Stream #0:0(eng): Video: mpeg2video (Main), yuv420p(tv, top first), 720x480 [SAR 32:27 DAR 16:9], SAR 186:157 DAR 279:157, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc
    Metadata:
      BPS-eng         : 4096383
      DURATION-eng    : 02:20:01.993600000
      NUMBER_OF_FRAMES-eng: 201483
      NUMBER_OF_BYTES-eng: 4302223608
      SOURCE_ID-eng   : 0100E0
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.10.7 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-10-01 21:56:39
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 384000
      DURATION-eng    : 02:20:01.952000000
      NUMBER_OF_FRAMES-eng: 262561
      NUMBER_OF_BYTES-eng: 403293696
      SOURCE_ID-eng   : 0180BD
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.10.7 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-10-01 21:56:39
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:2(eng): Subtitle: dvd_subtitle, 720x480 (default)
    Metadata:
      BPS-eng         : 2984
      DURATION-eng    : 02:12:24.359400000
      NUMBER_OF_FRAMES-eng: 1051
      NUMBER_OF_BYTES-eng: 2963824
      SOURCE_ID-eng   : 0120BD
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.10.7 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-10-01 21:56:39
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
File '/Users/Henry/Desktop/file.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (ac3 (native) -> aac (libfdk_aac))
  Stream #0:2 -> #0:2 (dvd_subtitle (dvdsub) -> mov_text (native))
Error while opening encoder for output stream #0:2 - maybe incorrect parameters such as bit_rate, rate, width or height

1 Answer 1

2

dvd_subtitle indicates an image-based subtitle. You can skip it, or overlay it on the video, or convert it to a text subtitle.

To skip it, add -map -s.

To overlay it, add -filter_complex "[0:0]yadif[v];[v][0:2]overlay"

To convert to text subtitle, see https://stackoverflow.com/a/36327919/5726027

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.