Bug Report Massive Sound issue.........

Abdo

Member
I Spent hours trying to fix this , the popularity of this software is what forced me to keep trying , till I finally found out what caused an unfixable sound de-sync.
I use game capture to record my game , I use hotkey with it instead of alt-tapping and choose the game from a list.
anyway , when I press F9 (The Hotkey for recording) and quickly press F10 (The Hotkey for game capture) , game footage plays just at the beginning of the outputted video , although it should be a little bit delayed because of OBS initializing game capture , and the audio is out of sync , after hours of testing , I found that if I press F9 and waited for some time then pressed F10 , the video will be synced with audio , and of course at the beginning of the video there is black screen , then the game footage shows up synced with audio.

I then realized what happened , when I quickly press F10 after F9 , OBS skips the black footage and goes straight to the moment after game capture initialized , however , it leaves the audio untouched , causing the audio to be out of sync.

the fix is simple , either from user side or from developer side , but detection is sooo hard , over 3 hourse of testing , never though the api would be ....... that it skips black footage and doesn't skip the audio that was recorded then.

please fix this bug , at least force an audio resync after 5 secs of the video start .
 

Osiris

Active Member
Game capture and audio capture are unrelated. Game capture gets the frames in real-time from the GPU, so a desync cannot be possible because of the initialization of game capture.

Please post a log.
 

Abdo

Member
Triggered Bug Here

Code:
23:29:13: Open Broadcaster Software v0.655b - 64bit ( ^ω^)
23:29:13: -------------------------------
23:29:13: CPU Name: Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
23:29:13: CPU Speed: 2295MHz
23:29:13: Physical Memory:  6026MB Total, 3984MB Free
23:29:13: stepping id: 1, model 69, family 6, type 0, extmodel 2, extfamily 0, HTT 1, logical cores 4, total cores 2
23:29:13: monitor 1: pos={0, 0}, size={1366, 768}
23:29:13: Windows Version: 10.0 Build 10240 (revision 16384)
23:29:13: Aero is Enabled
23:29:13: -------------------------------
23:29:13: OBS Modules:
23:29:13: Base Address     Module
23:29:13: 0000000073430000 OBS.exe
23:29:13: 0000000046FF0000 OBSApi.dll
23:29:13: 0000000059BE0000 DShowPlugin.dll
23:29:13: 0000000046FB0000 GraphicsCapture.dll
23:29:13: 00000000604F0000 NoiseGate.dll
23:29:13: 00000000474F0000 PSVPlugin.dll
23:29:13: 0000000046F80000 scenesw.dll
23:29:13: ------------------------------------------
23:29:13: Adapter 1
23:29:13:   Video Adapter: NVIDIA GeForce 820M 
23:29:13:   Video Adapter Dedicated Video Memory: 2093608960
23:29:13:   Video Adapter Shared System Memory: 2147168256
23:29:13:   Video Adapter Output 1: pos={0, 0}, size={1366, 768}, attached=true
23:29:13: ------------------------------------------
23:29:13: Adapter 2
23:29:13:   Video Adapter: Intel(R) HD Graphics Family
23:29:13:   Video Adapter Dedicated Video Memory: 117964800
23:29:13:   Video Adapter Shared System Memory: 3159552000
23:29:13: =====Stream Start: 2015-09-18, 23:29:13===============================================
23:29:13:   Multithreaded optimizations: Off
23:29:13:   Base resolution: 1360x768
23:29:13:   Output resolution: 1360x768
23:29:13: ------------------------------------------
23:29:13: Loading up D3D10 on NVIDIA GeForce 820M (Adapter 1)...
23:29:13: ------------------------------------------
23:29:13: Audio Format: 48000 Hz
23:29:13: ------------------------------------------
23:29:13: Audio Channels: 2 Ch
23:29:13: Playback device {0.0.0.00000000}.{f44ddbdd-5c97-451d-9701-35ae8eea3563}
23:29:13: ------------------------------------------
23:29:13: Using desktop audio input: Speakers (Realtek High Definition Audio)
23:29:13: Global Audio time adjust: 200
23:29:13: ------------------------------------------
23:29:13: Using auxilary audio input: Microphone (Realtek High Definition Audio)
23:29:13: Mic time offset: 250
23:29:13: ------------------------------------------
23:29:13: Audio Encoding: AAC
23:29:13:     bitrate: 128
23:29:13: Using graphics capture
23:29:13: Scene buffering time set to 60
23:29:14: Found QSV hardware support
23:29:16: ------------------------------------------
23:29:16: QSV version 1.8 using MFX_IMPL_HARDWARE_ANY | MFX_IMPL_VIA_D3D11 (actual: MFX_IMPL_HARDWARE2 | MFX_IMPL_VIA_D3D11)
23:29:16: Using 14 bitstreams and 14 frame buffers
23:29:16: ------------------------------------------
23:29:16: Video Encoding: QSV
23:29:16:     fps: 60
23:29:16:     width: 1360, height: 768
23:29:16:     target-usage: MFX_TARGETUSAGE_4_BALANCED
23:29:16:     profile: MFX_PROFILE_AVC_HIGH
23:29:16:     CBR: no
23:29:16:     CFR: no
23:29:16:     max bitrate: 20000
23:29:16:     buffer size: 20000
23:29:16:     rate control: VBR
23:29:16: ------------------------------------------
23:29:16: Syncing audio to video time (WARNING: you should not be doing this if you are just having webcam desync, that's a separate issue)
23:29:16: Trying to hook process: NitronicRush.exe
23:29:18: Recalculated bframe_delay: 3, init_pts.Num: 3
Warning -- bframe_delay=3 >= init_pts.Num=3
23:29:19: SharedTexCapture hooked
23:29:33: Total frames encoded: 960, total frames duplicated: 48 (5.00%)
23:29:33: Total frames rendered: 920, number of late frames: 42 (4.57%) (it's okay for some frames to be late)
23:29:34:
23:29:34: Profiler time results:
23:29:34:
23:29:34: ==============================================================
23:29:34: video thread frame - [100%] [avg time: 7.302 ms] [children: 75.6%] [unaccounted: 24.4%]
23:29:34: | scene->Preprocess - [0.0274%] [avg time: 0.002 ms]
23:29:34: | GPU download and conversion - [75.5%] [avg time: 5.516 ms] [children: 21.8%] [unaccounted: 53.8%]
23:29:34: | | flush - [2.67%] [avg time: 0.195 ms]
23:29:34: | | CopyResource - [0.0274%] [avg time: 0.002 ms]
23:29:34: | | conversion to 4:2:0 - [19.1%] [avg time: 1.393 ms] [children: 18.7%] [unaccounted: 0.342%]
23:29:34: | | | Convert444toNV12 - [18.7%] [avg time: 1.368 ms]
23:29:34: encoder thread frame - [100%] [avg time: 0.295 ms] [children: 87.8%] [unaccounted: 12.2%]
23:29:34: | QueueEncodeTask - [16.6%] [avg time: 0.049 ms]
23:29:34: | ProcessEncodedFrame - [42.4%] [avg time: 0.125 ms]
23:29:34: | sending stuff out - [28.8%] [avg time: 0.085 ms]
23:29:34: ==============================================================
23:29:34:
23:29:34:
23:29:34: Profiler CPU results:
23:29:34:
23:29:34: ==============================================================
23:29:34: video thread frame - [cpu time: avg 1.222 ms, total 1125 ms] [avg calls per frame: 1]
23:29:34: | scene->Preprocess - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
23:29:34: | GPU download and conversion - [cpu time: avg 1.188 ms, total 1093.75 ms] [avg calls per frame: 1]
23:29:34: | | flush - [cpu time: avg 0.152 ms, total 140.625 ms] [avg calls per frame: 1]
23:29:34: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
23:29:34: | | conversion to 4:2:0 - [cpu time: avg 1.004 ms, total 921.875 ms] [avg calls per frame: 1]
23:29:34: | | | Convert444toNV12 - [cpu time: avg 1.004 ms, total 921.875 ms] [avg calls per frame: 1]
 

Abdo

Member
Avoiding Bug (By Waiting Before Pressing Hotkey)

Code:
23:33:20: Open Broadcaster Software v0.655b - 64bit ( ^ω^)
23:33:20: -------------------------------
23:33:20: CPU Name: Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
23:33:20: CPU Speed: 2295MHz
23:33:20: Physical Memory:  6026MB Total, 3978MB Free
23:33:20: stepping id: 1, model 69, family 6, type 0, extmodel 2, extfamily 0, HTT 1, logical cores 4, total cores 2
23:33:20: monitor 1: pos={0, 0}, size={1366, 768}
23:33:20: Windows Version: 10.0 Build 10240 (revision 16384)
23:33:20: Aero is Enabled
23:33:20: -------------------------------
23:33:20: OBS Modules:
23:33:20: Base Address     Module
23:33:20: 0000000073430000 OBS.exe
23:33:20: 0000000046FF0000 OBSApi.dll
23:33:20: 0000000059BE0000 DShowPlugin.dll
23:33:20: 0000000046FB0000 GraphicsCapture.dll
23:33:20: 00000000604F0000 NoiseGate.dll
23:33:20: 00000000474F0000 PSVPlugin.dll
23:33:20: 0000000046F80000 scenesw.dll
23:33:20: ------------------------------------------
23:33:20: Adapter 1
23:33:20:   Video Adapter: NVIDIA GeForce 820M 
23:33:20:   Video Adapter Dedicated Video Memory: 2093608960
23:33:20:   Video Adapter Shared System Memory: 2147168256
23:33:20:   Video Adapter Output 1: pos={0, 0}, size={1366, 768}, attached=true
23:33:20: ------------------------------------------
23:33:20: Adapter 2
23:33:20:   Video Adapter: Intel(R) HD Graphics Family
23:33:20:   Video Adapter Dedicated Video Memory: 117964800
23:33:20:   Video Adapter Shared System Memory: 3159552000
23:33:20: =====Stream Start: 2015-09-18, 23:33:20===============================================
23:33:20:   Multithreaded optimizations: Off
23:33:20:   Base resolution: 1360x768
23:33:20:   Output resolution: 1360x768
23:33:20: ------------------------------------------
23:33:20: Loading up D3D10 on NVIDIA GeForce 820M (Adapter 1)...
23:33:20: ------------------------------------------
23:33:20: Audio Format: 48000 Hz
23:33:20: ------------------------------------------
23:33:20: Audio Channels: 2 Ch
23:33:21: Playback device {0.0.0.00000000}.{f44ddbdd-5c97-451d-9701-35ae8eea3563}
23:33:21: ------------------------------------------
23:33:21: Using desktop audio input: Speakers (Realtek High Definition Audio)
23:33:21: Global Audio time adjust: 200
23:33:21: ------------------------------------------
23:33:21: Using auxilary audio input: Microphone (Realtek High Definition Audio)
23:33:21: Mic time offset: 250
23:33:21: ------------------------------------------
23:33:21: Audio Encoding: AAC
23:33:21:     bitrate: 128
23:33:21: Using graphics capture
23:33:21: Scene buffering time set to 60
23:33:22: Found QSV hardware support
23:33:24: ------------------------------------------
23:33:24: QSV version 1.8 using MFX_IMPL_HARDWARE_ANY | MFX_IMPL_VIA_D3D11 (actual: MFX_IMPL_HARDWARE2 | MFX_IMPL_VIA_D3D11)
23:33:24: Using 14 bitstreams and 14 frame buffers
23:33:24: ------------------------------------------
23:33:24: Video Encoding: QSV
23:33:24:     fps: 60
23:33:24:     width: 1360, height: 768
23:33:24:     target-usage: MFX_TARGETUSAGE_4_BALANCED
23:33:24:     profile: MFX_PROFILE_AVC_HIGH
23:33:24:     CBR: no
23:33:24:     CFR: no
23:33:24:     max bitrate: 20000
23:33:24:     buffer size: 20000
23:33:24:     rate control: VBR
23:33:24: ------------------------------------------
23:33:24: Syncing audio to video time (WARNING: you should not be doing this if you are just having webcam desync, that's a separate issue)
23:33:24: Recalculated bframe_delay: 3, init_pts.Num: 3
Warning -- bframe_delay=3 >= init_pts.Num=3
23:33:34: Trying to hook process: NitronicRush.exe
23:33:36: SharedTexCapture hooked
23:33:57: Total frames encoded: 1992, total frames duplicated: 143 (7.18%)
23:33:57: Total frames rendered: 1867, number of late frames: 40 (2.14%) (it's okay for some frames to be late)
23:33:57:
23:33:57: Profiler time results:
23:33:57:
23:33:57: ==============================================================
23:33:57: video thread frame - [100%] [avg time: 4.279 ms] [children: 77.7%] [unaccounted: 22.3%]
23:33:57: | scene->Preprocess - [0.0467%] [avg time: 0.002 ms]
23:33:57: | GPU download and conversion - [77.6%] [avg time: 3.322 ms] [children: 34.8%] [unaccounted: 42.8%]
23:33:57: | | flush - [4.84%] [avg time: 0.207 ms]
23:33:57: | | CopyResource - [0.0467%] [avg time: 0.002 ms]
23:33:57: | | conversion to 4:2:0 - [29.9%] [avg time: 1.28 ms] [children: 29.4%] [unaccounted: 0.467%]
23:33:57: | | | Convert444toNV12 - [29.4%] [avg time: 1.26 ms]
23:33:57: encoder thread frame - [100%] [avg time: 0.207 ms] [children: 83.1%] [unaccounted: 16.9%]
23:33:57: | QueueEncodeTask - [23.2%] [avg time: 0.048 ms]
23:33:57: | ProcessEncodedFrame - [35.3%] [avg time: 0.073 ms]
23:33:57: | sending stuff out - [24.6%] [avg time: 0.051 ms]
23:33:57: ==============================================================
23:33:57:
23:33:57:
23:33:57: Profiler CPU results:
23:33:57:
23:33:57: ==============================================================
23:33:57: video thread frame - [cpu time: avg 1.297 ms, total 2421.88 ms] [avg calls per frame: 1]
23:33:57: | scene->Preprocess - [cpu time: avg 0.008 ms, total 15.625 ms] [avg calls per frame: 1]
23:33:57: | GPU download and conversion - [cpu time: avg 1.28 ms, total 2390.63 ms] [avg calls per frame: 1]
23:33:57: | | flush - [cpu time: avg 0.2 ms, total 375 ms] [avg calls per frame: 1]
23:33:57: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
23:33:57: | | conversion to 4:2:0 - [cpu time: avg 1.068 ms, total 1984.38 ms] [avg calls per frame: 1]
23:33:57: | | | Convert444toNV12 - [cpu time: avg 1.034 ms, total 1921.88 ms] [avg calls per frame: 1]
23:33:57: encoder thread frame - [cpu time: avg 0.031 ms, total 62.5 ms] [avg calls per frame: 1]
23:33:57: | QueueEncodeTask - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
23:33:57: | ProcessEncodedFrame - [cpu time: avg 0.015 ms, total 31.25 ms] [avg calls per frame: 1]
23:33:57: | sending stuff out - [cpu time: avg 0.007 ms, total 15.625 ms] [avg calls per frame: 1]
23:33:57: ==============================================================
23:33:57:
23:33:57: =====Stream End: 2015-09-18, 23:33:57=================================================

In Both Cases , I Haven't Made Any Changes In The Settings , I Tested Them On The Same Game , Checked The Outputted Videos (First Was Un-Synced , Second Was Synced)
 

Abdo

Member
Game capture and audio capture are unrelated. Game capture gets the frames in real-time from the GPU, so a desync cannot be possible because of the initialization of game capture.

Please post a log.

That is actually the main reason , they are separated , so when OBS skips the part of The video when game capture was initializing , it doesn't do anything to audio , its like jumping five seconds forward in video and leaving audio behind, causes an audio delay.

I am ready to upload videos if necessary so u can understand the issue
 
Last edited:

Abdo

Member

Osiris

Active Member
Set the scene buffering time to the default of 700, that's most likely the cause of your problem.

That is actually the main reason , they are separated , so when OBS skips the part of The video when game capture was initializing , it doesn't do anything to audio , its like jumping five seconds forward in video and leaving audio behind, causes an audio delay.

I am ready to upload videos if necessary so u can understand the issue

Game capture displays the frames in real-time basically, so if it takes 5 seconds (for example) to initialize it won't show the frames from 5 seconds in the past, it will show the frames currently on the GPU.
 
Top