YouTube/Facebook videos fast-forwarding in Safari, not playing at all in Chrome, out of sync with sound in Firefox
For the past few weeks or so I found that on both my Macs (an iMac Late 2013 running macOS High Sierra 10.13.16 and a MacBook Air 2012 running macOS Mojave 10.14.5), Safari is often unable to play YouTube videos except in fast-forward. Sometimes reloading the video a few times helps, sometimes a reboot is needed. Just relaunching Safari never helps.
To verify whether this is YouTube, Safari or macOS, I tried on the iMac to access YouTube with current version of Google Chrome and Firefox 57.0.4. Google Chrome plays the audio but shows black for the video. Firefox plays the videos with sound but out of sync (and, it seems, with frames missing).
The same issue affects Facebook videos too.
I have ClamXAV and while it did scan a few times during that time period, it never found anything.
Any ideas as to what could be going wrong and how to troubleshoot?