-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audio cuts out, Too many packets in the demuxer packet queues #10587
Comments
@KrisCris Can you please upload the full file to onedrive again? |
|
does anyone of you still have the sample file laying around somewhere? |
First two tries to upload failed, but 3rd attempt worked. This is the version of the user's original file that I cut the end off to get the size down to 400 MB.: I ran a couple quick tests with a brew installed
This is the log file from that test: |
thanks for the sample, i will keep it too if the download is unavailable again. the actual problem here is ffmpeg and/or videotoolbox. the sample can't be decoded fast enough with videotoolbox and our core code that tries to time video frames to audio just stalls or rather can't get the video frames fast enough to properly time. the crucial part in your logs is from ffmpeg (see below). it can only decode the video stream with 34fps using videotoolbox, though the video is 60fps, so it result in a decoding speed of 0.562x. we at least need a speed of >=1 to properly time and show frames.
on my system it's similar slow and i get the same problems. with software decoding, on the other hand, i get a speed of >=3. Software Decoding:akemi@Mac-Studio ~ % ffmpeg -i /Users/Akemi/Downloads/opc7.mkv -f null -
ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.1.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
libavutil 58. 29.100 / 58. 29.100
libavcodec 60. 31.102 / 60. 31.102
libavformat 60. 16.100 / 60. 16.100
libavdevice 60. 3.100 / 60. 3.100
libavfilter 9. 12.100 / 9. 12.100
libswscale 7. 5.100 / 7. 5.100
libswresample 4. 12.100 / 4. 12.100
libpostproc 57. 3.100 / 57. 3.100
Input #0, matroska,webm, from '/Users/Akemi/Downloads/opc7.mkv':
Metadata:
ENCODER : Lavf59.16.100
Duration: 00:00:02.02, bitrate: 1576973 kb/s
Stream #0:0: Video: h264 (High 4:4:4 Predictive), yuv420p(tv, bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 1k tbn (default)
Metadata:
DURATION : 00:00:02.016000000
Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp (default)
Metadata:
DURATION : 00:00:01.998000000
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
Metadata:
encoder : Lavf60.16.100
Stream #0:0: Video: wrapped_avframe, yuv420p(tv, bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 60 fps, 60 tbn (default)
Metadata:
DURATION : 00:00:02.016000000
encoder : Lavc60.31.102 wrapped_avframe
Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default)
Metadata:
DURATION : 00:00:01.998000000
encoder : Lavc60.31.102 pcm_s16le
[out#0/null @ 0x60000299ca80] video:57kB audio:380kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
frame= 121 fps=0.0 q=-0.0 Lsize=N/A time=00:00:02.00 bitrate=N/A speed=3.01x if we use a different timing mode, for example one where we don't try to time video and audio in some way ( because ffmpeg/videotoolbox is too slow we can't really handle this without any kind of problems/issues. either we get those errors, drop a lot of video/audio frames or let the playback desync. for me that is an up-/downstream problem, if it is even supposed to handle such a sample. it has quite the massive bitrate (1576973 kb/s, nearly 200MB/s?). |
I'm troubled by VLC behavior. VLC is able to play the file without any problems. I have confirmed that is because VLC is not using hardware acceleration. I also confirmed that hardware acceleration is enabled and it will use it for other files. Makes me wonder whether it is keying off something about the encoding and deciding hardware acceleration is inappropriate for this file. I'm testing with a MacBookPro18,2 with the Apple M1 Max chip running macOS Ventura 13.6.3. As shown below I see the same massive reduction in decoding speed with hardware acceleration when using FFmpeg directly. The man page for ffmpeg contains an interesting note under the
As all the Internet posts talk about how much better hardware acceleration is, I've not given much thought to the limits of the Apple "Media Engine". Not helpful that Apple does not publish any technical details about this portion of the chip. But I guess it makes sense that at some point the 10 CPUs might be able to do better than the "Media Engine". I have an 8K VP9 encoded 60 fps video that also exhibits problems. With hardware acceleration playback stutters and frames are being dropped. Desynchronization is reported, but not the "Too many packets" error. Possibly this is also running into the limits of the Media Engine. With Hardware Acceleration:
Without Hardware Acceleration:
|
yeah i can confirm the behaviour of VLC. it was the same on my end when i tried it. this is just a guess here since i am not too familiar with the VLC code. VLC is checking the profile here. the file itself is "High 4:4:4 Predictive@L5.2", but PROFILE_H264_HIGH_444_PREDICTIVE is not 'whitelisted'? closing this since it's not really a mpv problem. maybe it's worth bringing up on ffmpeg? |
also maybe it's related to https://trac.ffmpeg.org/ticket/8734#ticket which i opened. |
Important Information
Provide following Information:
No visual glitches that I noticed.
Reproduction steps
Play the linked video in the sample files section below using the option
--hwdec=videotoolbox
.Expected behavior
The video file plays without errors just as it does when hardware decoding is not specified.
Actual behavior
Audio cuts out. Errors are reported.
Using mpv 0.34.1 from stolendata:
Terminal Output:
I used mpv-build to locally build mpv from master. Xcode 13.4.1 is installed. The same errors are reported when using that mpv build:
Terminal Output:
I tried decoding the file using
ffmpeg
with hardware decoding enabled and no errors were reported:Terminal Output:
In searching for existing mpv issues I found issue #8986 which seemed like it might be the same problem. That issue was closed due to lack of information.
This issue originates from IINA issue iina/iina#3917.
Log file
mpv Log:
Sample files
I cut the end off the file that was submitted to IINA using
ffmpeg
, but it is still 400 MB and therefore won't be retained for very long.https://0x0.st/opc7.mkv
The text was updated successfully, but these errors were encountered: