Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

Too many packets buffered for output stream. #91

Closed
skarekrow opened this issue Mar 31, 2017 · 19 comments
Closed

Too many packets buffered for output stream. #91

skarekrow opened this issue Mar 31, 2017 · 19 comments

Comments

@skarekrow
Copy link
Contributor

Hello!

Using latest version in npm (h265ize 0.4.3-r2) I seem to get this on some movies:

[h265ize]: [debug] Running Query: ffmpeg -n 10 /root/bin/ffmpeg -i Monsters, Inc. (2001)/Monsters, Inc..mkv -y -acodec copy -vcodec libx265 -filte$
:v crop=1920:1024:0:30 -c:s copy -pix_fmt yuv420p -map 0:0 -map 0:1 -map 0:2 -map 0:3 -metadata:s:0:3 title=English -metadata:s:0:3 DISPOSITION:de$
ault=0 -map 0:4 -metadata:s:0:4 title=English -metadata:s:0:4 DISPOSITION:default=0 -map 0:5 -metadata:s:0:5 title=English -metadata:s:0:5 DISPOSI$
ION:default=0 -map 0:6 -metadata:s:0:6 title=English -metadata:s:0:6 DISPOSITION:default=0 -preset medium -x265-params crf=23: /tmp/h265ize/Monste$
s, Inc..encoding-in-progress.mkv
[h265ize]: [debug] Error: ffmpeg exited with code 1: Press [q] to stop, [?] for help
Too many packets buffered for output stream 0:1.
Conversion failed!

    at ChildProcess.<anonymous> (/root/n/lib/node_modules/h265ize/node_modules/fluent-ffmpeg/lib/processor.js:177:22)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:192:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
[h265ize]: ffmpeg exited with code 1: Press [q] to stop, [?] for help
Too many packets buffered for output stream 0:1.
Conversion failed!

It will consistently do this for the movie in question, but I'm unable to figure out why.

Thanks!

@skarekrow
Copy link
Contributor Author

It seems to be related to TrueHD perhaps?

General
Unique ID                                : 157370000480480430348844042495591487098 (0x76645C1089E20FD80977B3C5E1C0967A)
Complete name                            : /mnt/NAS/nas/purchased/movies/Monsters, Inc. (2001)/Monsters, Inc..mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 19.7 GiB
Duration                                 : 1 h 32 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 30.6 Mb/s
Movie name                               : Monsters, Inc. (Disc 1)
Encoded date                             : UTC 2016-04-16 21:31:29
Writing application                      : MakeMKV v1.9.10 win(x64-release)
Writing library                          : libmakemkv v1.9.10 (1.3.3/1.4.4) win(x64-release)
Original source medium                   : Blu-ray

Video
ID                                       : 1
ID in the original source medium         : 4113 (0x1011)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 1 h 32 min
Bit rate mode                            : Variable
Bit rate                                 : 23.5 Mb/s
Maximum bit rate                         : 31.5 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.473
Stream size                              : 15.1 GiB (77%)
Language                                 : English
Default                                  : No
Forced                                   : No

Audio #1
ID                                       : 2
ID in the original source medium         : 4352 (0x1100)
Format                                   : TrueHD
Codec ID                                 : A_TRUEHD
Duration                                 : 1 h 32 min
Bit rate mode                            : Variable
Bit rate                                 : 6 179 kb/s
Maximum bit rate                         : 7 290 kb/s
Channel(s)                               : 8 channels
Channel positions                        : Front: L C R, Side: L R, Back: L R, LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 1 200.000 FPS (40 spf)
Bit depth                                : 24 bits
Compression mode                         : Lossless
Stream size                              : 3.98 GiB (20%)
Title                                    : Surround 7.1
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio #2
ID                                       : 3
ID in the original source medium         : 4352 (0x1100)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Format settings, Endianness              : Big
Codec ID                                 : A_AC3
Duration                                 : 1 h 32 min
Bit rate mode                            : Constant
Bit rate                                 : 640 kb/s
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 spf)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 422 MiB (2%)
Title                                    : Surround 5.1
Language                                 : English
Service kind                             : Complete Main
Default                                  : No
Forced                                   : No

Text #1
ID                                       : 4
ID in the original source medium         : 4608 (0x1200)
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 1 h 31 min
Bit rate                                 : 35.0 kb/s
Count of elements                        : 2182
Stream size                              : 23.0 MiB (0%)
Language                                 : English
Default                                  : No
Forced                                   : No

Text #2
ID                                       : 6
ID in the original source medium         : 4609 (0x1201)
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 1 h 31 min
Bit rate                                 : 40.3 kb/s
Count of elements                        : 2654
Stream size                              : 26.4 MiB (0%)
Language                                 : English
Default                                  : No
Forced                                   : No

Text #3
ID                                       : 8
ID in the original source medium         : 4612 (0x1204)
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 1 h 31 min
Bit rate                                 : 79.1 kb/s
Count of elements                        : 3466
Stream size                              : 52.1 MiB (0%)
Language                                 : English
Default                                  : No
Forced                                   : No

Text #4
ID                                       : 10
ID in the original source medium         : 4613 (0x1205)
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 1 h 31 min
Bit rate                                 : 84.0 kb/s
Count of elements                        : 3638
Stream size                              : 55.2 MiB (0%)
Language                                 : English
Default                                  : No
Forced                                   : No

Menu
00:00:00.000                             : en:Chapter 01
00:01:32.801                             : en:Chapter 02
00:03:07.604                             : en:Chapter 03
00:04:51.124                             : en:Chapter 04
00:07:16.936                             : en:Chapter 05
00:09:11.509                             : en:Chapter 06
00:10:43.601                             : en:Chapter 07
00:11:53.796                             : en:Chapter 08
00:17:25.794                             : en:Chapter 09
00:20:06.079                             : en:Chapter 10
00:22:03.780                             : en:Chapter 11
00:25:48.421                             : en:Chapter 12
00:28:34.963                             : en:Chapter 13
00:31:06.489                             : en:Chapter 14
00:34:49.962                             : en:Chapter 15
00:36:55.630                             : en:Chapter 16
00:38:50.286                             : en:Chapter 17
00:40:27.883                             : en:Chapter 18
00:43:34.278                             : en:Chapter 19
00:45:29.727                             : en:Chapter 20
00:48:07.426                             : en:Chapter 21
00:50:37.159                             : en:Chapter 22
00:54:41.278                             : en:Chapter 23
00:57:29.446                             : en:Chapter 24
01:03:42.026                             : en:Chapter 25
01:06:25.022                             : en:Chapter 26
01:07:26.375                             : en:Chapter 27
01:13:52.136                             : en:Chapter 28
01:17:49.581                             : en:Chapter 29
01:21:24.921                             : en:Chapter 30
01:24:07.959                             : en:Chapter 31
01:25:10.271                             : en:Chapter 32

@FallingSnow
Copy link
Owner

FallingSnow commented Mar 31, 2017

You're right. Try using git version. Report back if that doesn't work.

@skarekrow
Copy link
Contributor Author

Hmm same result, different error:

[h265ize]: [alert] Output will be cropped to 1920x816. Originally 1920x1080
    at endCB (/root/n/lib/node_modules/h265ize/node_modules/fluent-ffmpeg/lib/processor.js:541:13)
    at handleExit (/root/n/lib/node_modules/h265ize/node_modules/fluent-ffmpeg/lib/processor.js:165:11)
    at ChildProcess.<anonymous> (/root/n/lib/node_modules/h265ize/node_modules/fluent-ffmpeg/lib/processor.js:177:11)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:192:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
From previous event:
    at Video.encode (/root/n/lib/node_modules/h265ize/lib/classes/video.js:824:16)
    at /root/n/lib/node_modules/h265ize/lib/classes/video.js:1171:34
    at runCallback (timers.js:651:20)
    at tryOnImmediate (timers.js:624:5)
    at processImmediate [as _immediateCallback] (timers.js:596:5)
From previous event:
    at Video.start (/root/n/lib/node_modules/h265ize/lib/classes/video.js:1164:37)
    at Encoder.loop (/root/n/lib/node_modules/h265ize/lib/classes/encoder.js:151:15)
    at Encoder.start (/root/n/lib/node_modules/h265ize/lib/classes/encoder.js:73:18)
    at /root/n/lib/node_modules/h265ize/h265ize:255:25
[h265ize]: [verbose] Folder encoding finished at Friday, March 31st 2017, 12:30:10 AM
---------------------------------------------------------------------------------------------------------------------------------------------------
[h265ize]: [alert] The following videos (1) were not encoded:
        - 0: Monsters, Inc..mkv: Error: ffmpeg exited with an error.
[h265ize]: Flushing log to disk...
[h265ize]: Process ended.

@FallingSnow
Copy link
Owner

Please run in debug and provide query as you did previously.

@skarekrow
Copy link
Contributor Author

Whoops forgot the query!

Anyways, I'll post the entire log instead: here

@FallingSnow
Copy link
Owner

Seems like a ffmpeg issue. You might take it up with ffmpeg devs and tell them you are trying to run:

ffmpeg -i Monsters, Inc..mkv -y -acodec copy -vcodec libx265 -filter:v crop=1920:1038:0:22 -c:s copy -c:d copy -pix_fmt yuv420p -map 0:0 -map 0:1 -map 0:2 -map 0:3 -metadata:s:0:3 title=English -metadata:s:0:3 DISPOSITION:default=0 -map 0:4 -metadata:s:0:4 title=English -metadata:s:0:4 DISPOSITION:default=0 -map 0:5 -metadata:s:0:5 title=English -metadata:s:0:5 DISPOSITION:default=0 -map 0:6 -metadata:s:0:6 title=English -metadata:s:0:6 DISPOSITION:default=0 -crf 23 -preset medium /mnt/nas/purchased/movies/Monsters, Inc. (2001)/h265/Monsters, Inc..mkv

Otherwise I suggest 2 alternatives. Run h265ize with --he-audio --downmix-he-audio or run the ffmpeg command above with your own audio settings.

@skarekrow
Copy link
Contributor Author

Yeah I think this squarely falls in their camp. I'll just demux the video and audio separately or something. Thanks for looking into this :)

@skarekrow
Copy link
Contributor Author

Thought I'd update here:
ffmpeg -i TRUEHD.mkv -map 0 -vcodec copy -scodec copy -acodec copy test.mkv works.

TRUEHD.mkv being the same Monsters mkv just copied to a different directory. So it must be one of those options supplied to fmpeg but FML trying to find out which one.

@skarekrow
Copy link
Contributor Author

skarekrow commented Mar 31, 2017

Posting for time travelers from Google.

So /root/bin/ffmpeg -i ./TRUEHD.mkv -y -acodec copy -vcodec libx265 -c:s copy -t 30 -preset medium -x265-params crf=23 test.mkv also fails.

That's about as simple as it gets. I'm going path of least resistance on this one and demuxing as I said above :D

EDIT: /root/bin/ffmpeg -i ./TRUEHD.mkv -y -acodec ac3 -b:a 640K -vcodec libx265 -c:s copy -t 30 -preset medium -x265-params crf=23 test.mkv works as expected, since it no longer has TrueHD.

@FallingSnow
Copy link
Owner

Are you using the latest ffmpeg?

@skarekrow
Copy link
Contributor Author

Yeah I custom compiled the latest version.

@FallingSnow
Copy link
Owner

:(

@skarekrow
Copy link
Contributor Author

You're telling me lol.

For posterity:

ffmpeg version N-84660-gd92ad42 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libavutil      55. 51.100 / 55. 51.100
libavcodec     57. 86.103 / 57. 86.103
libavformat    57. 67.100 / 57. 67.100
libavdevice    57.  3.101 / 57.  3.101
libavfilter     6. 78.100 /  6. 78.100
libswscale      4.  3.101 /  4.  3.101
libswresample   2.  4.100 /  2.  4.100
libpostproc    54.  2.100 / 54.  2.100

@skarekrow
Copy link
Contributor Author

Interesting, it may be a regression. I recompiled and had the same issue, but the default ubuntu-16.04 old ass ffmpeg works!

ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
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

@skarekrow
Copy link
Contributor Author

Hopefully final update!

This also works in the latest stable release:

ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libavutil      55. 34.101 / 55. 34.101
libavcodec     57. 64.101 / 57. 64.101
libavformat    57. 56.101 / 57. 56.101
libavdevice    57.  1.100 / 57.  1.100
libavfilter     6. 65.100 /  6. 65.100
libswscale      4.  2.100 /  4.  2.100
libswresample   2.  3.100 /  2.  3.100
libpostproc    54.  1.100 / 54.  1.100

So indeed a regression.

@FallingSnow
Copy link
Owner

Good to know. At least it doesn't happen in stable.

@skarekrow
Copy link
Contributor Author

Yeah, the git log on their stuff is irritating to go through, so I'm not sure if it's a known regression or what. Since it is the devel. As long as stable works, I think it's fine to not scream "BROKEN!" quite yet :D

@FallingSnow
Copy link
Owner

Haha, agreed.

@invisiblek
Copy link

For anyone running across this issue, I've been having this problem on various files with
ffmpeg version n4.1 Copyright (c) 2000-2018 the FFmpeg developers
(latest Archlinux version 1:4.1-1)

Per this post on stackoverflow, #128 and setting the value to 1024 seems to fix it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants