VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Search PM
    Hello

    I'm trying to use ffmpeg to convert a big MKV file into a smaller MP4 file, but ffmpeg ain't happy:

    Code:
    c:\>ffprobe.exe -i input.mkv
    ffprobe version N-66595-g1c4c78e Copyright (c) 2007-2014 the FFmpeg developers
      built on Oct  3 2014 22:01:53 with gcc 4.9.1 (GCC)
      configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
    isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
    enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-lib
    modplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
    b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
    r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en
    able-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
     --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-
    libx265 --enable-libxavs --enable-libxvid --enable-zlib
      libavutil      54.  9.100 / 54.  9.100
      libavcodec     56.  2.101 / 56.  2.101
      libavformat    56.  7.104 / 56.  7.104
      libavdevice    56.  1.100 / 56.  1.100
      libavfilter     5.  1.102 /  5.  1.102
      libswscale      3.  1.100 /  3.  1.100
      libswresample   1.  1.100 /  1.  1.100
      libpostproc    53.  1.100 / 53.  1.100
    Input #0, matroska,webm, from 'input.mkv':
      Metadata:
        encoder         : libmkv 0.6.5
      Duration: 01:26:39.28, start: 0.000000, bitrate: 3165 kb/s
        Chapter #0.0: start 0.000000, end 271.813200
        Metadata:
          title           : Chapter 1
        Chapter #0.1: start 271.813200, end 708.124078
        Metadata:
          title           : Chapter 2
        Chapter #0.2: start 708.124078, end 1519.017500
        Metadata:
          title           : Chapter 3
        Chapter #0.3: start 1519.017500, end 2245.826911
        Metadata:
          title           : Chapter 4
        Chapter #0.4: start 2245.826911, end 2611.358744
        Metadata:
          title           : Chapter 5
        Chapter #0.5: start 2611.358744, end 3152.399244
        Metadata:
          title           : Chapter 6
        Chapter #0.6: start 3152.399244, end 3468.506700
        Metadata:
          title           : Chapter 7
        Chapter #0.7: start 3468.506700, end 3865.361500
        Metadata:
          title           : Chapter 8
        Chapter #0.8: start 3865.361500, end 4347.176167
        Metadata:
          title           : Chapter 9
        Chapter #0.9: start 4347.176167, end 4607.060789
        Metadata:
          title           : Chapter 10
        Chapter #0.10: start 4607.060789, end 5035.280244
        Metadata:
          title           : Chapter 11
        Chapter #0.11: start 5035.280244, end 5199.277500
        Metadata:
          title           : Chapter 12
        Stream #0:0(eng): Video: h264 (Main), yuv420p(tv, smpte170m), 720x492 [SAR 5
    33:450 DAR 26:15], SAR 71:60 DAR 71:41, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
    (default)
        Stream #0:1(eng): Audio: aac, 48000 Hz, stereo, fltp (default)
    Here's what it says:
    Code:
    c:\>ffmpeg -i input.mkv -c:v libx264 -vf scale=640:-1 -pix_fmt yuv420p -c:a aac -strict experimental -b:a 128k -ac 2 -f mp4 output.mp4
    
    Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
    I can't figure out what's wrong with the command. Is it because the file contains chapters?

    Thanks for any hint.
    Quote Quote  
  2. Scaling it to 640:-1 may not be such a hot idea. Try specifying the size.
    Quote Quote  
  3. Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Search PM
    I always use that setting, as given in the wiki:

    https://trac.ffmpeg.org/wiki/Scaling%20%28resizing%29%20with%20ffmpeg
    Quote Quote  
  4. http://filmowiec.pl/forum/viewtopic.php?f=12&t=28371&start=30
    At the end you have an example MKV to MP4 converter. Good luck.
    Quote Quote  
  5. Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Search PM
    Thanks, but my Polish is a bit rusty

    Problem solved: To remove chapters, simply run the following command

    ffmpeg -i input.mkv -map_chapters -1 -c:v copy -c:a copy -f mp4 output.mp4

    Infos on the "-map_chapters" command.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!