mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.72k stars 2.93k forks source link

dynaudnorm causing video to freeze #15337

Open Kennybust opened 6 days ago

Kennybust commented 6 days ago

mpv Information

mpv 0.39.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Sep 28 2024 01:30:48
libplacebo version: v7.349.0 (v7.349.0-13-ga018ab0-dirty)
FFmpeg version: N-117212-g01c47dd23
FFmpeg library versions:
   libavcodec      61.20.100
   libavdevice     61.4.100
   libavfilter     10.5.100
   libavformat     61.8.100
   libavutil       59.40.100
   libswresample   5.4.100
   libswscale      8.4.100

Other Information

- Windows version: 10.0.19045.5131
- GPU model, driver and version: GT1030 561.09
- Source of mpv: Chocolatey
- Latest known working version: Have no idea
- Issue started after the following happened: I enabled dynaudnorm

Reproduction Steps

toggle dynaudnorm and watch 4K or 4K HDR content

Expected Behavior

dynaudnorm should not be causing video to freeze for a second every 10-15 seconds

Actual Behavior

dynaudnorm causing video to freeze for a second every 10-15 seconds

Log File

log.txt

Sample Files

No response

I carefully read all instruction and confirm that I did the following:

llyyr commented 6 days ago
[cplayer] Enter buffering (buffer went from 100% -> 12%) [0.128000s].
[cplayer] Still buffering (buffer went from 12% -> 0%) [0.000000s].
[cplayer] Still buffering (buffer went from 0% -> 12%) [0.128000s].
[cplayer] Still buffering (buffer went from 12% -> 0%) [0.000000s].
[cplayer] Still buffering (buffer went from 0% -> 9%) [0.096000s].
...

swresample is extremely slow here for some reason, but I can't reproduce this locally

Kennybust commented 6 days ago

Can i be of any help?

I noticed that "regular\default" dynaudnorm is causing these freezes in 4K HDR 24FPS only, in regular 4K content it's not freezing but if i give dynaudnorm parameters then it's starts to freeze there too "F2 af toggle "dynaudnorm=compress=27.0:gausssize=53""

Could it be my CPU? (AMD Athlon II X3 450) it's old, but it's only at 22% and GPU at 40% utilization when watching 4K HDR content with profile=high-quality and with or without dynaudnorm. It does show 2-3% CPU spike in task manager when these freezes are happening

kasper93 commented 5 days ago

Could it be my CPU? (AMD Athlon II X3 450) it's old, but it's only at 22% and GPU at 40% utilization when watching 4K HDR content with profile=high-quality and with or without dynaudnorm. It does show 2-3% CPU spike in task manager when these freezes are happening

It may be. It would require proper profiling to know for sure where is the bottleneck. Task manager monitoring is averaged over time, you won't see short bottlenecks just looking at the cpu usage %. WPR recording would show individual thread usage with more resolution.

Frankly I think your CPU is too slow indeed, it might mange if the audio filtering thread would be set to higher priority, but hard to tell if it is not just raw throughput issue.

You might try https://github.com/shinchiro/mpv-winbuild-cmake/releases mpv-x86_64-gcc- vs mpv-x86_64- build. Maybe gcc build would be faster for you, not sure how much of audio filtering is hand optimized in ffmpeg.

richardpl commented 4 days ago

The extreme compression for dynaudnorm use much slower algorithm (at least 20x times slower when compared with no compression), I will try to address the while loop that is mayor source of slowdown, and if I find fix will push fix to librempeg.