News:

--

Main Menu

Bug: Video + Sound not in sync while playing

Started by Elmue, August 04, 2024, 06:57:26 PM

Previous topic - Next topic

Elmue

Hello

There is a severe bug in version 2.8.1

I have a WEBM video with a huge resolution (2560 pixels width) which lets my processor (3.6 GHz, 4 cores) run with a tremendous CPU load. The processor is so busy with decoding the video that the video and audio are completely out of sync. The audio runs normal but the video runs like in slow motion.

The video decoder used by Avidemux seems to be not very efficient, because I can play the same video on the same processor with VLC player without any problem.

I converted the video to 1280 pixels width using the filter swsResize and now I can play it normally in Avidemux.


eumagga0x2a

Avidemux is not a video player, it is designed to show all frames even if video decoding and display pipeline can't keep up with the audio track.

Avidemux 2.8.1 is utterly outdated despite being the last released version. Please retry with the latest 2.8.2 nightly build (from Aug 4 2024) and make sure hw decoding via DXVA2 is enabled and "DXVA2" (actually DirectX, don't mind the name) is also selected as video display. WEBM container may contain VP8, VP9 or AV1 video streams. Depending on the properties of the video stream and the capabilities of the hw video decoder in your PC, the latest Avidemux nightly may be capable of decoding VP9 and AV1 in hardware on Windows, hugely speeding up decoding.

Please make sure you never run multiple instances of Avidemux simultaneously no matter the same or different versions and also never install / extract the binaries into a non-empty directory.

Elmue

#2
Hello

Thanks for your answer.
I tested the new version.
But there is absolutely no difference.
The same problem.
Also setting twice to DXVA2 makes no difference at all.

> it is designed to show all frames even if video decoding
> and display pipeline can't keep up with the audio track.

Yes, but what if I have to cut the video at an exact location where the narrator starts to speak?
This is currently impossible.

Playing this video with VLC player occupies 17% CPU in Process Explorer.
In Avidemux the same video occupies 36% CPU.
The "System Idle Process" shows that more than 50% of the CPU is idle.

I don't understand this because there are still CPU resources left over.
Why does it not occupy 100% CPU before it fails to sync audio and video?
This is weird.

Elmü

You cannot view this attachment.

Elstar`

CPU resources in process explorer are calculated from all cores and I guess, there is no multi-core video decoding. Check the actual core usage for the process.

And on hardware accelerated VP9 decoding (this codec is default in youtube webm), it fails for me too. I guess, there is no support of it for Windows 7? MPC-HC plays VP9 with GPU decoding, but not Avidemux.

szlldm

Absolutely not a guarantee, but maybe worth a try:
Preferences / HW Accel - all off
Preferences / Threading / Multi-threading - Auto-detect
(after these settings changed, the program needs to be closed and opened again)

This might be slightly better, if there is no actual VP9 hw decoding capability.
If these settings are better, try out other display settings too (Qt, OpenGL, etc)

eumagga0x2a

"DXVA2" hw accel in Avidemux uses an old version of the interface which doesn't allow hw surface sharing between the hardware decoder and the video display device. This forces Avidemux to download uncompressed video data to the main memory and then to upload it back to the graphics card. This reduces the benefits of using a hw decoder quite a bit.

Hw decoder and libavcodec multi-threaded decoding are mutually exclusive.

Quote from: Elstar` on August 07, 2024, 05:26:41 AMAnd on hardware accelerated VP9 decoding (this codec is default in youtube webm), it fails for me too. I guess, there is no support of it for Windows 7? MPC-HC plays VP9 with GPU decoding, but not Avidemux.

Please provide admlog.txt from starting Avidemux, loading the WebM file and closing Avidemux. The log file is located in %localappdata%\avidemux directory. You may consistently anonymize paths in the log.

If I remember correctly, I was able to play VP9 video tracks in Avidemux using hw decoder on Windows 7. I don't have any Windows-7-compatible hardware anymore to try. Regarding Avidemux development, that Windows version is unsupported.

Elstar`

#6
Quote from: eumagga0x2a on August 07, 2024, 09:22:45 AM
Quote from: Elstar` on August 07, 2024, 05:26:41 AMAnd on hardware accelerated VP9 decoding (this codec is default in youtube webm), it fails for me too. I guess, there is no support of it for Windows 7? MPC-HC plays VP9 with GPU decoding, but not Avidemux.

Please provide admlog.txt from starting Avidemux, loading the WebM file and closing Avidemux. The log file is located in %localappdata%\avidemux directory. You may consistently anonymize paths in the log.

If I remember correctly, I was able to play VP9 video tracks in Avidemux using hw decoder on Windows 7. I don't have any Windows-7-compatible hardware anymore to try. Regarding Avidemux development, that Windows version is unsupported.

I have just now tested with latest cross-compiled build r240806. It indeed plays hardware accelerated VP9 when decoder is NVDEC and display is DXVA2. I guess, problems were with some older version.

eumagga0x2a

Quote from: Elstar` on August 07, 2024, 03:51:30 PMI have just now tested with latest cross-compiled build r240806. It indeed plays hardware accelerated VP9 when decoder is NVDEC

Please specify properties of the video stream. On my test system with Windows (Windows 11), Avidemux decodes 8-bit VP9 and AV1 in hardware via DXVA2 just fine. However, for 10-bit VP9 and AV1, NVDEC (NVIDIA-only with recent drivers) may be the only option.

Elstar`

#8
Quote from: eumagga0x2a on August 07, 2024, 05:13:19 PM
Quote from: Elstar` on August 07, 2024, 03:51:30 PMI have just now tested with latest cross-compiled build r240806. It indeed plays hardware accelerated VP9 when decoder is NVDEC

Please specify properties of the video stream. On my test system with Windows (Windows 11), Avidemux decodes 8-bit VP9 and AV1 in hardware via DXVA2 just fine. However, for 10-bit VP9 and AV1, NVDEC (NVIDIA-only with recent drivers) may be the only option.
It's 8-bit.

I have just now tested with DXVA2 video decoding, it works now too, video decoding is accelerated for this one.

=====================================================
Video
=====================================================
Codec 4CC:         VP9
Image Size:         3840 x 2160
Aspect Ratio:         1:1 (1:1)
Frame Rate:         29.970 fps
Average Bitrate:      16302 kbps
Total Duration:         00:01:42.268
Pixel format:         YUV 4:2:0, 8-bit
Color range:         Limited (MPEG)
Color primaries:      BT.709
Transfer characteristics:   BT.709
Color space:         BT.709

Elmue

Hello again

I have a Windows 10 on the same computer where audio and video are out of sync on Windows 7. (I mainly use Windows 7 so I did not test Windows 10 yet because I did not imagine that this is the cause.) And you are right: On Windows 10 there is no problem. Avidemux occupies up to 30% CPU, but the video runs normally in sync with the sound.

So to decode VP9 you use a Windows decoder which has been updated by Microsoft?
How does VLC player work on Windows 7? Does it bring it's own decoders?

Elmü


eumagga0x2a

Quote from: Elmue on August 10, 2024, 06:44:48 PMSo to decode VP9 you use a Windows decoder which has been updated by Microsoft?

No.