[FFmpeg-user] Re-encoding mkv files from makemkv

pehache pehache.7 at gmail.com
Wed Oct 12 00:38:32 EEST 2022


Le 08/09/2022 à 00:04, James Board via ffmpeg-user a écrit :
> I'm trying to re-encode an MKV file that I originally created with makemkv from the original BluRay disc.  My ffmpeg command is:
>      ffmpeg-4.1.2-amd64-static/ffmpeg -y -i Twin_Peaks-_A_Limited_Event_Series_-_Disc_2_t01.mkv -c:a copy -c:v libx264  -preset slow -crf 20 Twin_Peaks-_A_Limited_Event_Series_-_Disc_2_t01_RECODE.mkv
> 
> The error is
>      Too many packets buffered for output stream 0:1.
>      Conversion failed!
> 
> I just want to re-encode these files to save disk space.  Does anyone know how I can resolve the above error?  The full error message is below.
> Thanks
> 
> 
> --------------------------------------------------------------------
> ffmpeg version 4.1.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers
>    built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
>    configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-gray --enable-libaom --enab!
>    libavutil     56. 22.100 / 56. 22.100
>    libavcodec     58. 35.100 / 58. 35.100
>    libavformat     58. 20.100 / 58. 20.100
>    libavdevice     58.  5.100 / 58.  5.100
>    libavfilter      7. 40.101 /  7. 40.101
>    libswscale      5.  3.100 /  5.  3.100
>    libswresample      3.  3.100 /  3.  3.100
>    libpostproc     55.  3.100 / 55.  3.100
> [matroska,webm @ 0x5bf2480] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
> Consider increasing the value for the 'analyzeduration' and 'probesize' options
> Input #0, matroska,webm, from 'Twin_Peaks-_A_Limited_Event_Series_-_Disc_2_t01.mkv':
>    Metadata:
>      title        : Twin Peaks: A Limited Event Series - Disc 2
>      encoder        : libmakemkv v1.16.4 (1.3.10/1.5.2) x86_64-linux-gnu
>      creation_time   : 2021-10-25T15:19:56.000000Z
>    Duration: 00:56:57.50, start: 0.000000, bitrate: 37009 kb/s
>      Chapter #0:0: start 0.000000, end 99.099000
>      Metadata:
>        title          : Chapter 01
>      Chapter #0:1: start 99.099000, end 571.153917
>      Metadata:
>        title          : Chapter 02
>      Chapter #0:2: start 571.153917, end 1180.512667
>      Metadata:
>        title          : Chapter 03
>      Chapter #0:3: start 1180.512667, end 2008.840167
>      Metadata:
>        title          : Chapter 04
>      Chapter #0:4: start 2008.840167, end 2526.732542
>      Metadata:
>        title          : Chapter 05
>      Chapter #0:5: start 2526.732542, end 3312.851208
>      Metadata:
>        title          : Chapter 06
>      Chapter #0:6: start 3312.851208, end 3417.497417
>      Metadata:
>        title          : Chapter 07
>      Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
>      Metadata:
>        BPS-eng          : 33970403
>        DURATION-eng    : 00:56:57.497416666
>        NUMBER_OF_FRAMES-eng: 81938
>        NUMBER_OF_BYTES-eng: 14511719069
>        SOURCE_ID-eng   : 001011
>        _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.4 linux(x64-release)
>        _STATISTICS_WRITING_DATE_UTC-eng: 2021-10-25 15:19:56
>        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
>      Stream #0:1(eng): Audio: truehd, 96000 Hz, 5.1(side), s32 (24 bit) (default)
>      Metadata:
>        title          : Surround 5.1
>        BPS-eng          : 2360136
>        DURATION-eng    : 00:56:56.955000000
>        NUMBER_OF_FRAMES-eng: 4100346
>        NUMBER_OF_BYTES-eng: 1008060054
>        SOURCE_ID-eng   : 001100
>        _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.4 linux(x64-release)
>        _STATISTICS_WRITING_DATE_UTC-eng: 2021-10-25 15:19:56
>        _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, 640 kb/s
>      Metadata:
>        title          : Surround 5.1
>        BPS-eng          : 640000
>        DURATION-eng    : 00:56:56.992000000
>        NUMBER_OF_FRAMES-eng: 106781
>        NUMBER_OF_BYTES-eng: 273359360
>        SOURCE_ID-eng   : 001100
>        _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.4 linux(x64-release)
>        _STATISTICS_WRITING_DATE_UTC-eng: 2021-10-25 15:19:56
>        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
>      Stream #0:3(eng): Subtitle: hdmv_pgs_subtitle    Metadata:
>        BPS-eng          : 26434
>        DURATION-eng    : 00:56:36.622395833
>        NUMBER_OF_FRAMES-eng: 1518
>        NUMBER_OF_BYTES-eng: 11223488
>        SOURCE_ID-eng   : 001200
>        _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.4 linux(x64-release)
>        _STATISTICS_WRITING_DATE_UTC-eng: 2021-10-25 15:19:56
>        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
> Stream mapping:
>    Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
>    Stream #0:1 -> #0:1 (copy)
> Press [q] to stop, [?] for help
> Too many packets buffered for output stream 0:1.
> Conversion failed!


A bit late, but anyway...

The stream 0:1 (the one that is responsible for the error) is the first 
audio stream, which is a 5.1 truehd 24 bits/96kHz one. It is probably 
quite big, and of a completely overkill quality. If you want to reduce 
the file size, this is a good target: you may either transcode it to AAC 
5.1 at 400kb/s, or  completely drop it to keep the 0:2 stream, which is 
the second audio track (in english too, and probably identical to the 
first one, but lighter)

Reminder : by default ffmpeg keeps only 1 video track and 1 audio track 
(so here you are implicitely dropping the second audio track and the 
subtitle track). "-map 0" means that you keep all the tracks present in 
the input file. "-map 0:0 -map 0:2 -map 0:3" means that you want to kepp 
the video track, the second audio track, and the subtitle track.



More information about the ffmpeg-user mailing list