Skip to content
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

Clicking / Popping sound on videos #15775

Open
6 tasks done
PuraIgnis opened this issue Jan 30, 2025 · 20 comments
Open
6 tasks done

Clicking / Popping sound on videos #15775

PuraIgnis opened this issue Jan 30, 2025 · 20 comments

Comments

@PuraIgnis
Copy link

PuraIgnis commented Jan 30, 2025

mpv Information

mpv v0.39.0-650-g3550ec52 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
 built on Jan 26 2025 00:05:18
libplacebo version: v7.350.0 (v7.349.0-30-g056b852-dirty)
FFmpeg version: N-118354-gec4d3dc5b
FFmpeg library versions:
   libavcodec      61.31.101
   libavdevice     61.4.100
   libavfilter     10.6.101
   libavformat     61.9.106
   libavutil       59.55.100
   libswresample   5.4.100
   libswscale      8.13.100

Other Information

- Windows version: 10
- GPU model, driver and version: Nvidia GeForce GTX 1650 Ti, Game Ready Driver, Version 566.03
- Source of mpv: shinchiro
- Latest known working version: N/A
- Issue started after the following happened: N/A

Reproduction Steps

Tested the reproduction steps, and the issue still persists. This issue does not happen when I use VLC media player, only on MPV. It happens regardless of the playback device I use. I am only using these lines for my mpv.conf,
"profile=gpu-hq
vo=gpu-next
hwdec=yes
gpu-api=vulkan".

Let me know if there is anything I need to do or add as an attempt to fix this issue.

Expected Behavior

Video plays normally

Actual Behavior

Clicking / Popping sounds on certain parts of video

Log File

output.txt

Sample Files

Clipped video and full video:
https://drive.google.com/drive/folders/1S108QeTOSg1ieo7uFyoqWIYjvPIgNIeO?usp=sharing

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

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
@llyyr
Copy link
Contributor

llyyr commented Jan 30, 2025

You need to make a log file where the issue occurs, not a log file where mpv is not playing any video. The issue template tells you so.

@PuraIgnis
Copy link
Author

You need to make a log file where the issue occurs, not a log file where mpv is not playing any video. The issue template tells you so.

Sorry. I've edited and attached the log file of the video. It should be correct this time I think.

@llyyr
Copy link
Contributor

llyyr commented Jan 30, 2025

I don't see anything wrong in the log file. Does --audio-exclusive=yes improve things? Maybe also try increasing the buffer https://mpv.io/manual/master/#audio-output-drivers-wasapi-exclusive-buffer

@PuraIgnis
Copy link
Author

I don't see anything wrong in the log file. Does --audio-exclusive=yes improve things? Maybe also try increasing the buffer https://mpv.io/manual/master/#audio-output-drivers-wasapi-exclusive-buffer

Nothing changed. This is what I used
"audio-exclusive=yes
audio-exclusive-buffer=20" <I tested the buffer from 10 to 100, and the issue is still there.

I also tested the video on Windows Media Player, and the popping sound isn't there at all.

@PuraIgnis
Copy link
Author

PuraIgnis commented Jan 30, 2025

When I extracted the audio from the video using "ffmpeg -i input.mkv -vn -acodec copy output.opus" and played it on MPV, the popping/cracking sound disappeared. I hope this can help in finding a solution for this.

Edit: The popping/cracking sound disappeared when I used ffmpeg to convert .mkv to .mp4. Anyone know a fix for this without having to convert the file?

@Dudemanguy
Copy link
Member

Can't reproduce on my end so assuming this is WASAPI-specific for now.

@PuraIgnis
Copy link
Author

Can't reproduce on my end so assuming this is WASAPI-specific for now.

Could this issue happen on a badly muxed video? I downloaded the raw of the anime that I'm watching, and the issue is nonexistent. Here are 2 screenshots of the video. Main difference I guess is the audio format? MPV can support .opus right?

video WITH issue

Image

video WITHOUT issue

Image

But still it's very weird that converting it to .mp4 would fix the issue. Let me know if there's a fix for this. I could just use raws to watch, but maybe someone in the future will experience this as well so maybe it will help.

@Dudemanguy
Copy link
Member

Do you get the problem if you use --ao=openal or --ao=sdl?

@PuraIgnis
Copy link
Author

Do you get the problem if you use --ao=openal or --ao=sdl?

Yap the problem is still there, tried both.

@Dudemanguy
Copy link
Member

Hmm well removing the tag. Maybe it's device specific or something.

@llyyr
Copy link
Contributor

llyyr commented Jan 30, 2025

Can you reproduce the issue with ffplay?

@Jules-A

This comment has been minimized.

@PuraIgnis
Copy link
Author

Can you reproduce the issue with ffplay?

Yes the issue is still there. I run the video using "ffplay video.mkv", if I did it right.

@PuraIgnis
Copy link
Author

Ah so it's not just me, I was noticing it yesterday when I had a game open in the background so GPU was under heavy load with the shaders I use. Was rather infrequent, maybe once every 7mins. I'm also using an ffmpeg equalizer. Don't think I noticed it once I'd closed the game.

The issue is fixed for mine, not random. From the video I uploaded, it is very noticeable around 8:06 ~ 8:09 minute range. Honestly not sure what is wrong. Could be the audio format being incompatible with MPV or something else. You could try to download the video and see if it happens for you as well.

@Jules-A
Copy link

Jules-A commented Jan 30, 2025

You could try to download the video and see if it happens for you as well.

I can reproduce on the extracted audio playing in MPV but not in Foobar2000. I went back to a 2 week old build since I suspected it being a recent MPV/FFMPEG issue but I can still reproduce, my issue may have been source or co-incidence.
I can reproduce on an older version of FFPLAY from 25/11/2024 so this isn't an MPV issue at least.
I can also reproduce in the latest build of MPC-HC (from k-lite codec pack).

@Dudemanguy
Copy link
Member

Dudemanguy commented Jan 30, 2025

If ffplay can reproduce it, then it should be some ffmpeg issue. If someone feels like bisecting, that would be appreciated.

@Jules-A
Copy link

Jules-A commented Jan 30, 2025

If ffplay can reproduce it, then it should be some ffmpeg issue. If someone feels like bisecting, that would be appreciated.

I went to try but then realized I completely forgot to try in other containers.

.opus - Good
.ogg/.oga - Good
.mp4 - Good
.ts - Good
.mka/.mkv - Bad
.webm - Bad
.caf - Bad

I originally extracted to mka (since it was from MKV) and was testing that, it would pop going all the way back to 5.1 (Foobar is apparently using 6.0 so I assume they aren't using FFMPEG directly to play but extracting the raw opus stream then playing it which avoids the container issues?

@llyyr
Copy link
Contributor

llyyr commented Jan 30, 2025

I can reproduce the issue now, this only happens when this specific opus file and when the container is mkv specifically. If you reencode the opus before muxing to mkv, or mux to a different container (mp4), it doesn't crackle. And of course, playing back the raw opus doesn't crackle either.

This is a weird issue but not a mpv bug. Report to ffmpeg if you care. I could reproduce the issue with 7.1 and master, so I don't know how long it's been like this.

@Jules-A Please don't pollute tickets with blogs about unrelated issues.

@Jules-A

This comment has been minimized.

@PuraIgnis
Copy link
Author

Thanks guys. I will report this issue to ffmpeg and hope that they could fix it.

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

No branches or pull requests

4 participants