VLC, dragonplayer, gwenview not playing certain videos, raising error

Fedora 40, KDE Plasma 6

Installed vlc via Discover, also tried sudo dnf install vlc, and also tried adding rpmfusion then doing sudo dnf install vlc, but same happened on all.

Some video files play fine (H264 - MPEG-4 AVC) with both video and audio working.
Others, also (H264 - MPEG-4 AVC), don’t play video, but play audio. There is error message

main decoder error: buffer deadlock prevented

when the video doesn’t play. The media shown in the window when the video doesn’t play is the old media, not scaled to the new window. The window changes size to the new file’s video size, but it isn’t shown.

Also, the following is always given no matter whether the video works or not, and also for plain audio files.

uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu

I tried setting hardware-accelerated decoding to automatic, enabled, and disabled, but there is no difference.

On dragonplayer, I get the same

main decoder error: buffer deadlock prevented

on the files that don’t work with VLC.

Also doesn’t work in gwenview.

In Firefox, all the files work, showing both video and audio correctly.

Added video