Audio out of sync during Avidemux playback

Started by johnr283, March 20, 2022, 09:51:18 PM

Previous topic - Next topic

eumagga0x2a

I didn't have a chance to test whether something funny happens in the audio device on Windows yet, but I definitely cannot reproduce the behaviour you describe with Avidemux on macOS.

eumagga0x2a

I've tested with my own build on Linux as well as with my own cross-compiled build on Windows 10 – no issues with the sample whatsoever, audio and video are perfectly in sync as far as I can tell (perfectly lip-synced).

Quote from: johnr283 on March 20, 2022, 09:51:18 PMI'm trying to edit an MP4 but the video is out of sync during Avidemux playback.

You reported the sync problem with a MP4 source, but provided a MKV sample (and your logs originate also from loading and playing Matroska sources). Does it mean that you experience A/V sync issues no matter what container?

Anyway, I cannot reproduce with the sample you provided.

johnr283

#17
My mistake, the source is MKV. Yes, it happens in both the original file and after converting to MP4. From your results, does this mean it's something with my PC and not the file or Avidemux?

I also have trouble with Avidemux playback while editing 4K files. I just assumed my PC couldn't handle 4K editing. Although again, I can play 4K HDR videos fine in various media players. Maybe my question should be asked on TomsHardware forums. My PC is an i5, 12 GB RAM, NVIDIA GeForce GTX 1650, Windows 10 64 bit.

eumagga0x2a

Quote from: johnr283 on March 23, 2022, 09:42:29 PMFrom your results, does this mean it's something with my PC and not the file or Avidemux?

Yes, this is what it looks like for me at the moment.

Quote from: johnr283 on March 23, 2022, 09:42:29 PMI also have trouble with Avidemux playback while editing 4K files. I just assumed my PC couldn't handle 4K editing. Although again, I can play 4K HDR videos fine in various media players.

Have you tried a 4K video after having enabled DXVA2 video display? No wonder 4K (probably HEVC 10-bit) won't play in real time with an unaccelerated video display. Such a video won't play in real time with software decoding and HDR tone mapping enabled either because HDR tone mapping in Avidemux is performed on the CPU.

Quote from: johnr283 on March 23, 2022, 09:42:29 PMMaybe my question should be asked on TomsHardware forums.

I cannot help in case of Windows-related issues, but I don't think this is a hardware problem.

johnr283

I just tried a 4K video after having enabled DXVA2. It plays smoothly which it didn't before, but I still have the A/V sync problem.

johnr283

It just occurred to me, I'm using Bluetooth headphones, why not try my speakers. The A/V sync is fine when using my PC speakers.

eumagga0x2a

You are spot on. Using my bluetooth headphones to listen to Avidemux audio playback, I needed to advance audio by ~200 ms to achieve lip-sync. When I have more time, I'll try to figure out what VLC is doing to detect the actual device-induced latency (for sure, it uses a more up-to-date Windows interface than Avidemux).

The only platform where Avidemux is able to query the delay is currently Linux with PulseAudio. If PulseAudio is able to measure and report the correct latency, Avidemux should be able to preserve A/V sync even with high latency outputs like via Bluetooth.

johnr283