Garbled capture audio on hybrid MP4 but not regular MP4

bvibber

New Member
Hi all, I'm migrating a retro computer capture setup from Windows to Linux, and noticed while fiddling with output settings that if I tell it to save as a "Hybrid .mp4" instead of regular .mp4, the audio comes out heavily garbled in the output, despite sounding perfect while monitoring the capture, or if saved to a regular .mp4.

I don't remember for sure if I tested this output mode on the Windows side, but definitely noticing it here on Linux. :)

I'm running OBS 32.0.1 from the flatpak on Debian 13, using an AMD Radeon card to accelerate h.264 video compression via VAAPI and software fdk-aac for the audio track. Capture is from an i-o data GV-USB2 using a patched out-of-tree driver from https://github.com/LeetLeaf/GV-USB2-Driver manually compiled and loaded. All the capture seems fine, and it doesn't seem to matter whether I pick 48 kHz or 44.1 kHz or stereo or mono for the audio.

Canvas is 640x480 at 59.94 fps.

I've tested playback in both the GNOME Videos app and in browsers (Firefox and Chrome). Any ideas on what I might be doing wrong, or if there's a bug or other problem? Thanks!

Examples:
* good audio (regular MP4): https://brooke.vibber.net/media/atari/pole-position-good.mp4
* bad audio (hybrid MP4): https://brooke.vibber.net/media/atari/pole-position-bad.mp4
 

bvibber

New Member
Hm, now it's failing consistently on non-hybrid MP4 too so it might be something else. No idea what's wrong. Perfect audio on monitor output, garbage in the output file.

Audio captures are via... PulseAudio, via ALSA on the inside I presume.
 

bvibber

New Member
After some more testing I realized that it was not the hybrid .mp4 setting that was different between the good and bad files, but that the good file *hadn't opened the microphone device* and the bad file *had*. If I include the microphone in the mix, the recording gets garbled for the _capture_'s audio, but the _mic's_ audio is fine. Then to add to the confusion it seems to stay in this state until I close OBS and restart it.

So:
* I *can* get good audio capture recordings if I don't use my microphone
* if I add the microphone into the audio mix, it starts garbling my _capture_ while the speech from the mic sounds fine

Very weird. :)
 
Oof I can see what you mean.

I have been recently looking into how OBS handles timestamps with things like audio and video to synchronise everything ... and it's really archaic. I'm not surprised that more and more people are having issues.
  • In some cases, switching to using the Pipewire audio plugin solves the problem, so maybe give that a crack (if your system is using PipeWire): https://obsproject.com/forum/resources/pipewire-audio-capture.1458/
  • Check that you haven't got "Low Latency" enabled within the Settings -> Audio, as that can cause issues.
  • Some issues with stuttering can be resolved with different values of PIPEWIRE_LATENCY (e.g. I run OBS via PIPEWIRE_LATENCY=512/4800 obs), or if you're stuck with PulseAudio sources, try running OBS via PULSE_MSEC_LATENCY=60 obs or other values.
 

bvibber

New Member
Well the weird thing is that my microphone audio is pristine and perfect. So I don't know why the capture audio is getting garbled ONLY when mixed, and NOT when recorded alone or monitored alone. :(

Quick test with ALSA on the Debian 13 packaged version of OBS and OBS is hanging when I try to add the second device, so I'm having no luck there.

Quick test with the flatpak version plus PipeWire audio plugin -- switching from PulseAudio to PIpeWire gives me the same results: garbled capture audio when mixing, while the mic audio remains pristine in the recording and the capture audio remains pristine on the monitor audio during recording.

PULSE_MSEC_LATENCY=60 or =120 doesn't seem to help reliably either, though it does desynchronize my audio from my video.

Low latency is not enabled.
 
Well the weird thing is that my microphone audio is pristine and perfect. So I don't know why the capture audio is getting garbled ONLY when mixed, and NOT when recorded alone or monitored alone. :(

Quick test with ALSA on the Debian 13 packaged version of OBS and OBS is hanging when I try to add the second device, so I'm having no luck there.

Quick test with the flatpak version plus PipeWire audio plugin -- switching from PulseAudio to PIpeWire gives me the same results: garbled capture audio when mixing, while the mic audio remains pristine in the recording and the capture audio remains pristine on the monitor audio during recording.

PULSE_MSEC_LATENCY=60 or =120 doesn't seem to help reliably either, though it does desynchronize my audio from my video.

Low latency is not enabled.
Hrm; if the PipeWire plugin was no different, then maybe there's something deeper (i.e. in the ALSA layer - a.k.a. the kernel) or OBS has a new bug. Just to confirm - you did replace the sources in your scene with Pipewire sources when you tried the plugin?

What mic are you using?
 
Top