Description
Operating System Info
Other
Other OS
Fedora 35
OBS Studio Version
Git
OBS Studio Version (Other)
28.0.0-beta2-19-g7eb46d50b
OBS Studio Log URL
OBS Studio Crash Log URL
No response
Expected Behavior
When starting to play an audio file, the audio from the beginning of the audio file appears.
Current Behavior
When starting to play an audio file, the last several frames of the audio file is first played back, then the desired audio is played back.
Steps to Reproduce
- Setup OBS profile and ensure audio sampling frequency is 48 kHz. Also set transition to
Cut. - Create three scenes named
Scene,Chirp 44k1,Chirp 48k. - In the scene
Chirp 44k1, add a media source and set a audio file whose sampling frequency is 44.1 kHz and which has a chirp starting from low frequency to high frequency. - In the scene
Chirp 48k, add a media source and set a audio file whose sampling frequency is 48 kHz and which has a chirp starting from low frequency to high frequency. - Switch to the scene
Scene. - Restart OBS
- Start recording
- Switch scene to
Chirp 48kand wait until playback ended. - Switch scene to
Chirp 44k1and wait until playback ended. - Switch scene to
Chirp 48kand wait until playback ended. - Switch scene to
Chirp 44k1and wait until playback ended. - Stop recording.
- Check recording
A waveform below is the beginning of the step 11. The very high frequency wave comes from the end of the audio file. The very low frequency wave comes from the beginning of the audio file.

Anything else we should know?
Suspecting last samples are remaining in libswscale (the sample rate converter).
I believe this bug has existed for many versions. I found this bug while editing libobs/media-io/audio-resampler-ffmpeg.c for another purpose.
Maybe we need to add an API on libobs for a source to notify there is no more audio and libobs has to flush remaining audio in the resampler.
Activity