Question / Help How can I get my audio & video output to synchronize?

redge

New Member
My iMac specs and log file are below.

I want to use OBS to record my computer display/windows together with system audio. The problem is that the recordings are not synchronized; the audio runs slightly ahead of the video.

This can be seen in a video that I have uploaded to YouTube: https://youtu.be/Gzv7JpgH2pE

The video shows audio software called iZotope RX playing a recording of a scooter. The audio starts before the iZotope cursor starts progressing through the recording's waveform. The problem can also be seen at the 15 second mark, where an increase in the audio volume occurs shortly before the the cursor reaches the waveform spike.

I am also trying out Screenflow and Camtasia for Mac and have not experienced a synchronization problem with either of those applications. That said, my preference is to use OBS because I do not require the editing capabilities of Screenflow/Camtasia.

I have spent a good deal of time tinkering with the video and audio settings, but without success. I am aware of the sticky saying that there are issues when recording windows, but this problem is occurring regardless of whether I record iZoptope as display/full screen or as a window. I wonder whether the problem has something to do with the following line in the log: 09:22:40.532: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds

Even if no-one has a clear solution, guidance on what I should concentrate on in settings would be greatly appreciated. I really want OBS to work for me.

Thanks

iMac Specs:
Operating system: El Capitan 10.11.3
Late 2014, 27", Retina 5K
Processor: 4 GHz Intel Core i7
Memory: 32 GB 1600 MHz DDR3
Graphics: AMD Radeon R9 M295X 4096 MB
System sound for OBS: Soundflower

Log: https://gist.github.com/anonymous/9e253e41c9f0b8147838

09:22:40.207: CPU Name: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
09:22:40.207: CPU Speed: 4000MHz
09:22:40.207: Physical Cores: 4, Logical Cores: 8
09:22:40.207: Physical Memory: 32768MB Total
09:22:40.207: OS Name: Mac OS X (NSMACHOperatingSystem)
09:22:40.208: OS Version: Version 10.11.3 (Build 15D21)
09:22:40.208: Kernel Version: 15.3.0
09:22:40.211: hotkeys-cocoa: Using layout 'com.apple.keylayout.US'
09:22:40.231: OBS 0.13.1 (mac)
09:22:40.231: ---------------------------------
09:22:40.232: ---------------------------------
09:22:40.232: audio settings reset:
09:22:40.232: samples per sec: 48000
09:22:40.232: speakers: 2
09:22:40.283: ---------------------------------
09:22:40.283: video settings reset:
09:22:40.283: base resolution: 5120x2880
09:22:40.283: output resolution: 2560x1440
09:22:40.283: fps: 30/1
09:22:40.283: format: NV12
09:22:40.284: ---------------------------------
09:22:40.285: Loading module: coreaudio-encoder.so
09:22:40.285: ---------------------------------
09:22:40.286: Loading module: image-source.so
09:22:40.286: ---------------------------------
09:22:40.287: Loading module: mac-avcapture.so
09:22:40.287: ---------------------------------
09:22:40.288: Loading module: mac-capture.so
09:22:40.289: ---------------------------------
09:22:40.290: Loading module: mac-decklink.so
09:22:40.290: No blackmagic support
09:22:40.290: Failed to start search for DeckLink devices
09:22:40.290: ---------------------------------
09:22:40.292: Loading module: mac-syphon.so
09:22:40.292: ---------------------------------
09:22:40.293: Loading module: mac-vth264.so
09:22:40.312: [VideoToolbox encoder]: Adding VideoToolbox H264 encoders
09:22:40.312: ---------------------------------
09:22:40.313: Loading module: obs-ffmpeg.so
09:22:40.313: ---------------------------------
09:22:40.314: Loading module: obs-filters.so
09:22:40.314: ---------------------------------
09:22:40.315: Loading module: obs-outputs.so
09:22:40.315: ---------------------------------
09:22:40.316: Loading module: obs-transitions.so
09:22:40.316: ---------------------------------
09:22:40.317: Loading module: obs-x264.so
09:22:40.317: ---------------------------------
09:22:40.318: Loading module: rtmp-services.so
09:22:40.318: ---------------------------------
09:22:40.319: Loading module: text-freetype2.so
09:22:40.326: =====================================================================
09:22:40.326: output 'adv_stream' (rtmp_output) created
09:22:40.326: output 'adv_file_output' (ffmpeg_muxer) created
09:22:40.326: encoder 'recording_h264' (obs_x264) created
09:22:40.326: encoder 'streaming_h264' (obs_x264) created
09:22:40.346: AAC encoder bitrate mapping:
09:22:40.346: 20 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 24 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 28 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 32 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 40 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 48 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 56 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 64 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 72 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 80 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 96 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 112 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 128 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 144 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 160 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 192 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 224 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 256 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 288 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: 320 kbit/s: 'CoreAudio AAC encoder' (CoreAudio_AAC)
09:22:40.346: encoder 'adv_aac0' (CoreAudio_AAC) created
09:22:40.346: encoder 'adv_aac1' (CoreAudio_AAC) created
09:22:40.346: encoder 'adv_aac2' (CoreAudio_AAC) created
09:22:40.346: encoder 'adv_aac3' (CoreAudio_AAC) created
09:22:40.346: service 'default_service' (rtmp_common) created
09:22:40.347: All scene data cleared
09:22:40.347: ------------------------------------------------
09:22:40.401: coreaudio: device 'Soundflower (2ch)' initialized
09:22:40.401: source 'Desktop Audio' (coreaudio_output_capture) created
09:22:40.403: source 'Display Capture' (display_capture) created
09:22:40.403: source 'YTube' (window_capture) created
09:22:40.403: source 'YT' (scene) created
09:22:40.406: source 'RX 5 new' (window_capture) created
09:22:40.407: source 'RX 5' (scene) created
09:22:40.500: == Profiler Results =============================
09:22:40.500: run_program_init: 548.188 ms
09:22:40.500: ┣OBSApp::AppInit: 2.425 ms
09:22:40.500: ┃ ┗OBSApp::InitLocale: 1.507 ms
09:22:40.500: ┗OBSApp::OBSInit: 481.468 ms
09:22:40.500: ┣obs_startup: 3.356 ms
09:22:40.500: ┗OBSBasic::OBSInit: 267.699 ms
09:22:40.500: ┣OBSBasic::InitBasicConfig: 0.144 ms
09:22:40.500: ┣OBSBasic::ResetAudio: 0.041 ms
09:22:40.500: ┣OBSBasic::ResetVideo: 51.094 ms
09:22:40.500: ┣OBSBasic::InitOBSCallbacks: 0.006 ms
09:22:40.500: ┣OBSBasic::InitHotkeys: 0.05 ms
09:22:40.500: ┣obs_load_all_modules: 42.642 ms
09:22:40.500: ┃ ┣obs_init_module(coreaudio-encoder.so): 0.004 ms
09:22:40.500: ┃ ┣obs_init_module(image-source.so): 0.002 ms
09:22:40.500: ┃ ┣obs_init_module(mac-avcapture.so): 0.003 ms
09:22:40.500: ┃ ┣obs_init_module(mac-capture.so): 0.004 ms
09:22:40.500: ┃ ┣obs_init_module(mac-decklink.so): 0.053 ms
09:22:40.500: ┃ ┣obs_init_module(mac-syphon.so): 0.003 ms
09:22:40.500: ┃ ┣obs_init_module(mac-vth264.so): 19.676 ms
09:22:40.500: ┃ ┣obs_init_module(obs-ffmpeg.so): 0.009 ms
09:22:40.500: ┃ ┣obs_init_module(obs-filters.so): 0.004 ms
09:22:40.500: ┃ ┣obs_init_module(obs-outputs.so): 0.001 ms
09:22:40.500: ┃ ┣obs_init_module(obs-transitions.so): 0.002 ms
09:22:40.500: ┃ ┣obs_init_module(obs-x264.so): 0.002 ms
09:22:40.500: ┃ ┣obs_init_module(rtmp-services.so): 0.105 ms
09:22:40.500: ┃ ┗obs_init_module(text-freetype2.so): 6.673 ms
09:22:40.500: ┣OBSBasic::ResetOutputs: 20.026 ms
09:22:40.500: ┣OBSBasic::CreateHotkeys: 0.024 ms
09:22:40.500: ┣OBSBasic::InitService: 0.526 ms
09:22:40.500: ┣OBSBasic::InitPrimitives: 0.05 ms
09:22:40.500: ┗OBSBasic::Load: 62.137 ms
09:22:40.500: =================================================
09:22:40.532: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds
10:13:30.292: ---------------------------------
10:13:30.292: [x264 encoder: 'recording_h264'] preset: veryfast
10:13:30.292: [x264 encoder: 'recording_h264'] settings:
10:13:30.292: bitrate: 8000
10:13:30.292: buffer size: 8000
10:13:30.292: crf: 20
10:13:30.292: fps_num: 30
10:13:30.292: fps_den: 1
10:13:30.292: width: 1280
10:13:30.292: height: 720
10:13:30.292: keyint: 250
10:13:30.292: vfr: on
10:13:30.292: cbr: off
10:13:30.298: [CoreAudio AAC: 'Track1']: settings:
10:13:30.298: mode: AAC
10:13:30.298: bitrate: 160
10:13:30.298: sample rate: 48000
10:13:30.298: cbr: on
10:13:30.298: output buffer: 1536
10:13:30.300: ==== Recording Start ===============================================
10:13:30.300: [ffmpeg muxer: 'adv_file_output'] Writing file '/Users/STB/Movies/2016-03-06 10-13-30.mp4'...
10:14:43.674: [ffmpeg muxer: 'adv_file_output'] Output of file '/Users/STB/Movies/2016-03-06 10-13-30.mp4' stopped
10:14:43.674: Output 'adv_file_output': stopping
10:14:43.674: Output 'adv_file_output': Total encoded frames: 2202
10:14:43.674: Output 'adv_file_output': Total drawn frames: 2201
10:14:43.674: ==== Recording Stop ================================================
 
Last edited:

redge

New Member
I'm really surprised at the lack of response to this.

It appears that the only answer is to use the mixer to create an audio offset and to figure out, in any given recording, what that offset needs to be.

Meanwhile, it is not an issue in Screenflow or Camtasia.

I'm really curious to know why it's an issue in OBS and not in these other screen capture applications.
 

Devon Morris

New Member
I am having a similar problem with my facecam. Audio is between 100ms and 300 ms off and the biggest problem is it fluctuates drastically from 1 video to the next, but I can't see if it's correct until I am done recording. I was wondering if it was because my computer may not be fast enough, but yours is better then mine.
 

redge

New Member
Hi Devon,

I'm quite sure that this problem has nothing to do with my computer. I have a fairly powerful iMac and my recording was under two minutes. I learned about the audio offset function, which is apparently necessary in some cases, from another thread.

I'm really surprised that nobody from OBS is chiming in on this. It's a pretty fundamental issue, and it would be helpful to understand it.
 

Devon Morris

New Member
Hi Devon,

I'm quite sure that this problem has nothing to do with my computer. I have a fairly powerful iMac and my recording was under two minutes. I learned about the audio offset function, which is apparently necessary in some cases, from another thread.

I'm really surprised that nobody from OBS is chiming in on this. It's a pretty fundamental issue, and it would be helpful to understand it.
I very much agree. I have somewhat figured it out as I needed to change the audio settings to 48000 mh, instead of 44000.
 

redge

New Member
Hi Devon,

If you look at the log in my first post, you'll see that I encountered the problem on a 48kHz recording. Whatever the issue is, if someone from OBS chooses to enlighten us, samples per second is apparently not it.
 
Top