3

I'm trying to convert a movie, using ffmpeg, from Movie.mkv to Movie.m4v. The Movie has 2 Languages and 1 subtitle stream.

Using

ffmpeg -i inputMovie.mkv outputmovie.m4v

the result is just one audio and no soft subtitles.

What should I use to keep both languages and the subtitle (to toggle On-off on streaming box)

Thank you.

The ffprobe from movie is:

ffprobe version 2.8.5 Copyright (c) 2007-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, matroska,webm, from 'DasParfum.mkv':
  Metadata:
    encoder         : libmakemkv v1.9.9 (1.3.3/1.4.4) darwin(x86-release)
    creation_time   : 2016-01-22 21:40:23
  Duration: 02:21:28.44, start: 0.000000, bitrate: 5414 kb/s
    Chapter #0:0: start 0.000000, end 395.200000
    Metadata:
      title           : Chapter 01
    Chapter #0:1: start 395.200000, end 633.880000
    Metadata:
      title           : Chapter 02
    Chapter #0:2: start 633.880000, end 816.400000
    Metadata:
      title           : Chapter 03
    Chapter #0:3: start 816.400000, end 1031.680000
    Metadata:
      title           : Chapter 04
    Chapter #0:4: start 1031.680000, end 1294.280000
    Metadata:
      title           : Chapter 05
    Chapter #0:5: start 1294.280000, end 1593.800000
    Metadata:
      title           : Chapter 06
    Chapter #0:6: start 1593.800000, end 1928.680000
    Metadata:
      title           : Chapter 07
    Chapter #0:7: start 1928.680000, end 2262.000000
    Metadata:
      title           : Chapter 08
    Chapter #0:8: start 2262.000000, end 2598.960000
    Metadata:
      title           : Chapter 09
    Chapter #0:9: start 2598.960000, end 2845.960000
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 2845.960000, end 3193.320000
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 3193.320000, end 3427.320000
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 3427.320000, end 3652.480000
    Metadata:
      title           : Chapter 13
    Chapter #0:13: start 3652.480000, end 3966.560000
    Metadata:
      title           : Chapter 14
    Chapter #0:14: start 3966.560000, end 4235.920000
    Metadata:
      title           : Chapter 15
    Chapter #0:15: start 4235.920000, end 4531.280000
    Metadata:
      title           : Chapter 16
    Chapter #0:16: start 4531.280000, end 4796.480000
    Metadata:
      title           : Chapter 17
    Chapter #0:17: start 4796.480000, end 5003.960000
    Metadata:
      title           : Chapter 18
    Chapter #0:18: start 5003.960000, end 5383.040000
    Metadata:
      title           : Chapter 19
    Chapter #0:19: start 5383.040000, end 5708.040000
    Metadata:
      title           : Chapter 20
    Chapter #0:20: start 5708.040000, end 5943.080000
    Metadata:
      title           : Chapter 21
    Chapter #0:21: start 5943.080000, end 6212.960000
    Metadata:
      title           : Chapter 22
    Chapter #0:22: start 6212.960000, end 6488.560000
    Metadata:
      title           : Chapter 23
    Chapter #0:23: start 6488.560000, end 6734.000000
    Metadata:
      title           : Chapter 24
    Chapter #0:24: start 6734.000000, end 6951.880000
    Metadata:
      title           : Chapter 25
    Chapter #0:25: start 6951.880000, end 7214.480000
    Metadata:
      title           : Chapter 26
    Chapter #0:26: start 7214.480000, end 7466.680000
    Metadata:
      title           : Chapter 27
    Chapter #0:27: start 7466.680000, end 7756.840000
    Metadata:
      title           : Chapter 28
    Chapter #0:28: start 7756.840000, end 7935.200000
    Metadata:
      title           : Chapter 29
    Chapter #0:29: start 7935.200000, end 8488.440000
    Metadata:
      title           : Chapter 30
    Stream #0:0(eng): Video: mpeg2video (Main), yuv420p(tv, bt470bg), 720x576 [SAR 64:45 DAR 16:9], max. 7200 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc
    Metadata:
      BPS-eng         : 4572420
      DURATION-eng    : 02:21:28.440000000
      NUMBER_OF_FRAMES-eng: 212211
      NUMBER_OF_BYTES-eng: 4851589546
      SOURCE_ID-eng   : 0100E0
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.9.9 darwin(x86-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2016-01-22 21:40:23
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:1(ger): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 448000
      DURATION-eng    : 02:21:28.416000000
      NUMBER_OF_FRAMES-eng: 265263
      NUMBER_OF_BYTES-eng: 475351296
      SOURCE_ID-eng   : 0180BD
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.9.9 darwin(x86-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2016-01-22 21:40:23
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 384000
      DURATION-eng    : 02:21:28.416000000
      NUMBER_OF_FRAMES-eng: 265263
      NUMBER_OF_BYTES-eng: 407443968
      SOURCE_ID-eng   : 0182BD
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.9.9 darwin(x86-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2016-01-22 21:40:23
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:3(ger): Subtitle: dvd_subtitle, 720x576 (default)
    Metadata:
      BPS-eng         : 2188
      DURATION-eng    : 02:11:22.676977777
      NUMBER_OF_FRAMES-eng: 871
      NUMBER_OF_BYTES-eng: 2156572
      SOURCE_ID-eng   : 0120BD
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.9.9 darwin(x86-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2016-01-22 21:40:23
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:4(ger): Subtitle: dvd_subtitle, 720x576
    Metadata:
      BPS-eng         : 2079
      DURATION-eng    : 02:10:36.918400000
      NUMBER_OF_FRAMES-eng: 839
      NUMBER_OF_BYTES-eng: 2037440
      SOURCE_ID-eng   : 0122BD
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.9.9 darwin(x86-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2016-01-22 21:40:23
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID

2 Answers 2

3

Try

ffmpeg -i inputMovie.mkv -c copy -map 0 outputmovie.m4v

Depending on the subtitle format, they may not get copied over. In which case,

ffmpeg -i inputMovie.mkv -c copy -c:s mov_text -map 0 outputmovie.m4v

Edit: Once you have a text-based subtitle format like SRT or ASS, you can use

ffmpeg -i inputMovie.mkv -i subtitle.srt -c copy -c:s mov_text -map 0:v -map 0:a -map 1 outputmovie.m4v
7
  • Thank you for quick response, but they dont work ! In First one I become error: Could not write header for output file #0 (incorrect codec parameters : invalid argument. And for second i become:Error while opening encoder for output stream #0:3 - maybe incorrect parameters such as bit_rate, rate, width or height !!
    – salix
    Commented Jan 25, 2016 at 5:30
  • Paste the readout of ffprobe inputmovie.mkv into your question.
    – Gyan
    Commented Jan 25, 2016 at 6:01
  • Your subtitles are image-based and need to be converted to a text-based format like SRT. Once done, you can use the revised 2nd command. Use Subtitle Edit to import from MKV.
    – Gyan
    Commented Jan 25, 2016 at 19:39
  • i try it to do with 3 code (after the srt was exported - or downloaded) and i become again error message: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
    – salix
    Commented Jan 25, 2016 at 22:04
  • Paste the readout of ffprobe srt into your question.
    – Gyan
    Commented Jan 26, 2016 at 4:19
0

I thin MKVtoolnix is better and can help you get the result that you want.

MKVtoolnix is a set of tools to create, alter, split, join and inspect Matroska files(mkv). Use MKVCleaver or gMKVExtractGUI to extract/demultiplex mkv video and audio files.

Supported operating systems: Windows - Mac OS - Linux

Screenshot :

MKVtoolnix Version:8.8.0

2
  • hm i write i need output in m4v and this tool can just mkv output ??
    – salix
    Commented Jan 25, 2016 at 18:59
  • you can extract or add subtitle from/to mkv videos with it and many other things like extracting or creating chapters, extracting audio separately in a few seconds... try it and you'll see
    – MedK
    Commented Jan 25, 2016 at 19:05

Your Answer

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

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