mpv icon indicating copy to clipboard operation
mpv copied to clipboard

MPV video stutters when certain audio filter enabled

Open f35f22fan opened this issue 4 years ago • 6 comments

Important Information

Provide following Information:

  • mpv version:

  • mpv 0.33.1 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects built on UNKNOWN FFmpeg library versions: libavutil 56.70.100 libavcodec 58.134.100 libavformat 58.76.100 libswscale 5.9.100 libavfilter 7.110.100 libswresample 3.9.100 FFmpeg version: 4.4-6ubuntu5

  • Linux Distribution and Version:

  • Ubuntu 21.10 amd64

  • Source of the mpv binary

  • From standard repo (sudo apt-get install mpv)

  • If known which version of mpv introduced the problem:

  • I don't know

  • Window Manager and version:

  • KDE Plasma 5.23.4 (KDE Frameworks 5.88.0)

  • GPU driver and version:

  • Radeon RX 570, Mesa 21.3.1 - kisak-mesa PPA (Ubuntu's mesa has the same issue)

  • Possible screenshot or video of visual glitches https://www.youtube.com/watch?v=e2rap2x8K20

Reproduction steps

Add this to mpv.conf "af=lavfi=[loudnorm=I=-16:TP=-3:LRA=4]" and play a video file at speed > 1

Expected behavior

Video shouldn't stutter

Actual behavior

Video stutters, switching audio (language) channels takes quite some time.

Log file

https://0x0.st/-FWy.txt

Sample files

Not needed, works with random video files.

f35f22fan avatar Dec 12 '21 16:12 f35f22fan

I can reproduce that switching audio channels makes the video playback lag temporarily in a really odd way, in version 0.34.0-68-g21cdc713bc

CounterPillow avatar Dec 12 '21 16:12 CounterPillow

Same issue:

mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects built on UNKNOWN ffmpeg library versions: libavutil 56.31.100 libavcodec 58.54.100 libavformat 58.29.100 libswscale 5.5.100 libavfilter 7.57.100 libswresample 3.5.100 ffmpeg version: 4.2.4-1ubuntu0.1

Linux Distribution and Version: Ubuntu 20.04.3 LTS

Source of the mpv binary From standard repo (sudo apt-get install mpv)

Window Manager and version: GNOME 3.36.8

GPU driver and version: Mesa Intel® UHD Graphics (CML GT2)

ddemydenko avatar Jan 13 '22 22:01 ddemydenko

Can be reproduced on Windows(10/11). Created a script to temporarily fix the issue: fix-avsync.lua.

dyphire avatar May 14 '22 13:05 dyphire

Thanks @dyphire, though I placed it into the mpv config dir into the scripts subdir and it "worked" by turning off my audio filter "af=lavfi=[loudnorm=I=-16:TP=-3:LRA=4]" which obviously defeats the purpose. I noticed this by launching a video and the non-voice sounds being really loud and the voice quiet, I checked mpv conf and the audio filter was there, so I thought it could be your lua script the culprit, and surely enough, after I removed the lua script and relaunched the video the audio filter started working fine as usual. Tested on Ubuntu 22.04.

f35f22fan avatar Jun 02 '22 00:06 f35f22fan

@f35f22fan Yes, that's how this script works. This is only a temporary solution. We can only wait for this issue to be fixed.

dyphire avatar Jun 03 '22 10:06 dyphire

ad-lavc-downmix=yes audio-channels=stereo I use 2.1 channel speakers myself After testing, you can use the above command to force downmix stereo to solve most problems Sadly not all formats support downmix stereo Especially Bluray film source, almost all do not support But fortunately, most of the film sources are now WEB-DL and the like, which is enough for now. machine translation Poor English

906018080 avatar Sep 21 '22 13:09 906018080

Can anyone still reproduce this? I tried that filter on a video with multiple audio channels with a high playback speed (like >2) and it was fine when switching. Nothing like OP's example video.

Dudemanguy avatar Jan 09 '23 05:01 Dudemanguy

The issue seems to be gone for me (Ubuntu 22.10, plasma 5). Didn't notice when it happened.

Well.. the video still stutters for a second or less when I switch audio tracks which in theory shouldn't cause video stutters, but this issue is peanuts because the video used to stutter forever which made movies unwatchable.

So it seems to me the issue is solved.

f35f22fan avatar Jan 14 '23 18:01 f35f22fan

Great.

Dudemanguy avatar Jan 14 '23 18:01 Dudemanguy