Question / Help Webcam with game and audio delays

Spyrunite

New Member
So, to get my game and audio properly together, I need to delay the audio by -27. My problem is I can't delay the webcam by a negative number. I also can't change the delay on the game. I'm hoping i'm just missing something obvious, so any help?

Also, unrelated question: Is there a way to record locally from OBS and livestream to twitch at the same time?
 

Spyrunite

New Member
Oh wow I worded that badly, let me try again

When I am streaming, my game is behind my audio and webcam. So when I am streaming My audio and webcam happen .27 seconds after it actually happens. I can adjust the audio offset by -27 to fix the audio, but I can't do that to the webcam.
 

Spyrunite

New Member
Ok sure, I thought this would be something that wouldn't need the log and be just missing a button or something. But if this helps then sure.

Code:
18:18:41: Open Broadcaster Software v0.56.03 MADNESS - 64bit ( ^ω^)
18:18:41: -------------------------------
18:18:41: CPU Name: AMD FX(tm)-6100 Six-Core Processor
18:18:41: CPU Speed: 3315MHz
18:18:41: Physical Memory:  8190MB Total, 4478MB Free
18:18:41: stepping id: 2, model 1, family 15, type 0, extmodel 0, extfamily 3, HTT 1, logical cores 6, total cores 3
18:18:41: monitor 1: pos={1920, 0}, size={1280, 1024}
18:18:41: monitor 2: pos={0, 0}, size={1920, 1080}
18:18:41: Windows Version: 6.1 Build 7601 S
18:18:41: Aero is Disabled
18:18:41: -------------------------------
18:18:41: OBS Modules:
18:18:41: Base Address     Module
18:18:41: 000000003F560000 OBS.exe
18:18:41: 00000000E5230000 OBSApi.dll
18:18:41: 00000000FA460000 DShowPlugin.dll
18:18:41: 00000000FA430000 GraphicsCapture.dll
18:18:41: 00000000FA160000 NoiseGate.dll
18:18:41: 00000000FA140000 PSVPlugin.dll
18:18:41: ------------------------------------------
18:18:41: Adapter 1
18:18:41:   Video Adapter: NVIDIA GeForce GTX 560 
18:18:41:   Video Adapter Dedicated Video Memory: 2096562176
18:18:41:   Video Adapter Shared System Memory: 2147364864
18:18:41: =====Stream Start: 2013-09-11, 18:18:41===============================================
18:18:41:   Multithreaded optimizations: On
18:18:41:   Base resolution: 1920x1080
18:18:41:   Output resolution: 960x540
18:18:41: ------------------------------------------
18:18:41: Loading up D3D10 on NVIDIA GeForce GTX 560...
18:18:42: ------------------------------------------
18:18:42: Audio Format: 48000hz
18:18:42: Playback device Default
18:18:42: ------------------------------------------
18:18:42: Using desktop audio input: Speakers (Realtek High Definition Audio)
18:18:42: ------------------------------------------
18:18:42: Using auxilary audio input: Microphone (4- ATR USB microphone )
18:18:42: ------------------------------------------
18:18:42: Audio Encoding: AAC
18:18:42:     bitrate: 160
18:18:42: Using graphics capture
18:18:42: Using Window Capture
18:18:43: ------------------------------------------
18:18:43:     device: Logitech HD Webcam C525,
18:18:43:     device id \\?\usb#vid_046d&pid_0826&mi_02#6&1afb5b45&0&0002#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{bbefb6c7-2fc4-4139-bb8b-a58bba724083},
18:18:43:     chosen type: I420, usingFourCC: false, res: 1600x896 - 1600x896, frameIntervals: 333333-2000000, fourCC: 'I420'
18:18:43:     audio device: Disable,
18:18:43:     audio device id Disabled,
18:18:43: 
18:18:43: Using directshow input
18:18:44: ------------------------------------------
18:18:44: Video Encoding: x264
18:18:44:     fps: 30
18:18:44:     width: 960, height: 540
18:18:44:     preset: veryfast
18:18:44:     CBR: yes
18:18:44:     CFR: no
18:18:44:     max bitrate: 1900
18:18:44:     buffer size: 1900
18:18:44: ------------------------------------------
18:18:44: MMDeviceAudioSource: Frequency for device 'Speakers (Realtek High Definition Audio)' is 384000, samples per sec is 48000
18:18:44: MMDeviceAudioSource: Frequency for device 'Microphone (4- ATR USB microphone )' is 352800, samples per sec is 44100
18:18:44: SharedTexCapture hooked
18:18:44: 
18:18:44: Profiler result for the last frame:
18:18:44: ==============================================================
18:18:44: video thread frame - [time: 71.901 ms (cpu time: 62.4 ms)]
18:18:44: | frame preprocessing and rendering - [time: 62.101 ms (cpu time: 62.4 ms)]
18:18:44: | | scene->Preprocess - [time: 4.985 ms (cpu time: 15.6 ms)]
18:18:44: | GPU download and color conversion - [time: 9.798 ms (cpu time: 0 ms)]
18:18:44: | | flush - [time: 9.791 ms (cpu time: 0 ms)]
18:18:44: ==============================================================
18:18:44: 
18:18:44: 
18:18:44: Profiler result for the last frame:
18:18:44: ==============================================================
18:18:44: video thread frame - [time: 5.241 ms (cpu time: 0 ms)]
18:18:44: | frame preprocessing and rendering - [time: 4.778 ms (cpu time: 0 ms)]
18:18:44: | | scene->Preprocess - [time: 4.105 ms (cpu time: 0 ms)]
18:18:44: | GPU download and color conversion - [time: 0.461 ms (cpu time: 0 ms)]
18:18:44: | | flush - [time: 0.456 ms (cpu time: 0 ms)]
18:18:44: ==============================================================
18:18:44: 
18:18:44: Audio timestamp for device 'Microphone (4- ATR USB microphone )' was behind target timestamp by 17!  Had to delete audio segment.
18:18:44: 
18:18:44: Audio timestamp for device 'Microphone (4- ATR USB microphone )' was behind target timestamp by 7!  Had to delete audio segment.
18:18:44: 
18:18:46: Using RTMP service: Twitch / Justin.tv
18:18:46:   Server selection: rtmp://live-ord.justin.tv/app
18:18:46:   Interface: NVIDIA nForce 10/100/1000 Mbps Ethernet  (ethernet, 100 mbps)
18:18:47: SO_SNDBUF was at 8192
18:18:47: SO_SNDBUF is now 65536
18:27:03: RTMPPublisher::Socketloop: Increasing send buffer to ISB 131072 (buffer: 8783 / 263168)
18:33:54: RTMPPublisher::Socketloop: Increasing send buffer to ISB 262144 (buffer: 0 / 263168)
19:28:32: GraphicsCaptureSource::NewCapture:  eliminating old capture
19:28:32: SharedTexCapture hooked
19:29:20: GraphicsCaptureSource::NewCapture:  eliminating old capture
19:29:20: SharedTexCapture hooked
19:29:35: GraphicsCaptureSource::NewCapture:  eliminating old capture
19:29:35: SharedTexCapture hooked
19:44:16: GraphicsCaptureSource::NewCapture:  eliminating old capture
19:44:16: SharedTexCapture hooked
19:47:09: GraphicsCaptureSource::NewCapture:  eliminating old capture
19:47:09: SharedTexCapture hooked
19:47:16: GraphicsCaptureSource::NewCapture:  eliminating old capture
19:47:16: SharedTexCapture hooked
20:06:15: RTMPPublisher::Socketloop: Increasing send buffer to ISB 524288 (buffer: 0 / 263168)
20:17:00: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
20:17:00:   New Scene
20:17:00: Using bitmap image
20:17:01: PERFORMANCE WARNING: Scene change took 810 ms, maybe some sources should be global sources?
20:17:02: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
20:17:02:   New Scene
20:17:03: Using graphics capture
20:17:03: SharedTexCapture hooked
20:17:05: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
20:17:05:   New Scene
20:17:05: Using bitmap image
20:17:06: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
20:17:06:   New Scene
20:17:06: Using graphics capture
20:17:06: SharedTexCapture hooked
20:17:08: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
20:17:08:   New Scene
20:17:08: Using bitmap image
20:17:08: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
20:17:08:   New Scene
20:17:08: Using graphics capture
20:17:09: SharedTexCapture hooked
20:17:09: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
20:17:09:   New Scene
20:17:09: Using bitmap image
20:17:10: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
20:17:10:   New Scene
20:17:10: Using graphics capture
20:17:10: SharedTexCapture hooked
20:17:14: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
20:17:14:   New Scene
20:17:14: Using graphics capture
20:17:14: Using Window Capture
20:17:14: ------------------------------------------
20:17:14:     device: Logitech HD Webcam C525,
20:17:14:     device id \\?\usb#vid_046d&pid_0826&mi_02#6&1afb5b45&0&0002#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{bbefb6c7-2fc4-4139-bb8b-a58bba724083},
20:17:14:     chosen type: I420, usingFourCC: false, res: 1600x896 - 1600x896, frameIntervals: 333333-2000000, fourCC: 'I420'
20:17:14:     audio device: Disable,
20:17:14:     audio device id Disabled,
20:17:14: 
20:17:14: Using directshow input
20:17:15: PERFORMANCE WARNING: Scene change took 1040 ms, maybe some sources should be global sources?
20:17:15: SharedTexCapture hooked
21:13:16: Capture window 0x003A2DD2 invalid or changing, terminating capture
21:14:35: SharedTexCapture hooked
21:18:52: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
21:18:52:   New Scene
21:18:52: Using bitmap image
21:18:53: PERFORMANCE WARNING: Scene change took 539 ms, maybe some sources should be global sources?
21:19:47: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
21:19:47:   New Scene
21:19:47: Using graphics capture
21:19:47: SharedTexCapture hooked
21:19:47: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
21:19:47:   New Scene
21:19:47: Using graphics capture
21:19:48: Using Window Capture
21:19:48: ------------------------------------------
21:19:48:     device: Logitech HD Webcam C525,
21:19:48:     device id \\?\usb#vid_046d&pid_0826&mi_02#6&1afb5b45&0&0002#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{bbefb6c7-2fc4-4139-bb8b-a58bba724083},
21:19:48:     chosen type: I420, usingFourCC: false, res: 1600x896 - 1600x896, frameIntervals: 333333-2000000, fourCC: 'I420'
21:19:48:     audio device: Disable,
21:19:48:     audio device id Disabled,
21:19:48: 
21:19:48: Using directshow input
21:19:48: PERFORMANCE WARNING: Scene change took 675 ms, maybe some sources should be global sources?
21:19:48: SharedTexCapture hooked
21:32:40: Total frames encoded: 349049, total frames duplicated 298 (0.09%)
21:32:40: Total frames rendered: 348813, number of late frames: 42 (0.01%) (it's okay for some frames to be late)
21:32:40: RTMPPublisher::SocketLoop: Graceful loop exit
21:32:40: Number of times waited to send: 73, Waited for a total of 278543 bytes
21:32:40: Number of b-frames dropped: 20 (0.0057%), Number of p-frames dropped: 43 (0.012%), Total 63 (0.018%)
21:32:40: 
21:32:40: Profiler results:
21:32:40: 
21:32:40: ==============================================================
21:32:40: video thread frame - [100%] [avg time: 3.678 ms (cpu time: avg 3.353 ms, total 1.16984e+006 ms)] [avg calls per frame: 1] [children: 99.9%] [unaccounted: 0.109%]
21:32:40: | frame preprocessing and rendering - [96.8%] [avg time: 3.562 ms (cpu time: avg 3.284 ms, total 1.14562e+006 ms)] [avg calls per frame: 1] [children: 74.6%] [unaccounted: 22.2%]
21:32:40: | | scene->Preprocess - [74.6%] [avg time: 2.745 ms (cpu time: avg 2.67 ms, total 931420 ms)] [avg calls per frame: 1]
21:32:40: | GPU download and color conversion - [3.05%] [avg time: 0.112 ms (cpu time: avg 0.065 ms, total 22807.3 ms)] [avg calls per frame: 1] [children: 2.34%] [unaccounted: 0.707%]
21:32:40: | | flush - [1.58%] [avg time: 0.058 ms (cpu time: avg 0.035 ms, total 12370.9 ms)] [avg calls per frame: 1]
21:32:40: | | CopyResource - [0.625%] [avg time: 0.023 ms (cpu time: avg 0.015 ms, total 5553.63 ms)] [avg calls per frame: 1]
21:32:40: | | conversion to 4:2:0 - [0.136%] [avg time: 0.005 ms (cpu time: avg 0.005 ms, total 1918.81 ms)] [avg calls per frame: 1]
21:32:40: | Convert444Threads - [907%] [avg time: 33.355 ms (cpu time: avg 0.936 ms, total 326541 ms)] [avg calls per frame: 1]
21:32:40: encoder thread frame - [100%] [avg time: 1.019 ms (cpu time: avg 0.286 ms, total 99856.2 ms)] [avg calls per frame: 1]
21:32:40: ==============================================================
21:32:40: 
21:32:40: =====Stream End: 2013-09-11, 21:32:40=================================================
21:34:00: =====Stream Start: 2013-09-11, 21:34:00===============================================
21:34:00:   Multithreaded optimizations: On
21:34:00:   Base resolution: 1920x1080
21:34:00:   Output resolution: 960x540
21:34:00: ------------------------------------------
21:34:00: Loading up D3D10 on NVIDIA GeForce GTX 560...
21:34:01: ------------------------------------------
21:34:01: Audio Format: 48000hz
21:34:01: Playback device Default
21:34:01: ------------------------------------------
21:34:01: Using desktop audio input: Speakers (Realtek High Definition Audio)
21:34:01: ------------------------------------------
21:34:01: Using auxilary audio input: Microphone (4- ATR USB microphone )
21:34:01: ------------------------------------------
21:34:01: Audio Encoding: AAC
21:34:01:     bitrate: 160
21:34:01: Using graphics capture
21:34:01: Using Window Capture
21:34:01: ------------------------------------------
21:34:01:     device: Logitech HD Webcam C525,
21:34:01:     device id \\?\usb#vid_046d&pid_0826&mi_02#6&1afb5b45&0&0002#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{bbefb6c7-2fc4-4139-bb8b-a58bba724083},
21:34:01:     chosen type: I420, usingFourCC: false, res: 1600x896 - 1600x896, frameIntervals: 333333-2000000, fourCC: 'I420'
21:34:01:     audio device: Disable,
21:34:01:     audio device id Disabled,
21:34:01: 
21:34:01: Using directshow input
21:34:02: ------------------------------------------
21:34:02: Video Encoding: x264
21:34:02:     fps: 30
21:34:02:     width: 960, height: 540
21:34:02:     preset: veryfast
21:34:02:     CBR: yes
21:34:02:     CFR: no
21:34:02:     max bitrate: 1900
21:34:02:     buffer size: 1900
21:34:02: ------------------------------------------
21:34:02: MMDeviceAudioSource: Frequency for device 'Speakers (Realtek High Definition Audio)' is 384000, samples per sec is 48000
21:34:02: MMDeviceAudioSource: Frequency for device 'Microphone (4- ATR USB microphone )' is 352800, samples per sec is 44100
21:34:02: SharedTexCapture hooked
21:34:02: Audio timestamp for device 'Microphone (4- ATR USB microphone )' was behind target timestamp by 27!  Had to delete audio segment.
21:34:02: 
21:34:02: Audio timestamp for device 'Microphone (4- ATR USB microphone )' was behind target timestamp by 17!  Had to delete audio segment.
21:34:02: 
21:34:02: Audio timestamp for device 'Microphone (4- ATR USB microphone )' was behind target timestamp by 7!  Had to delete audio segment.
21:34:02: 
21:34:05: Total frames encoded: 75, total frames duplicated 0 (0.00%)
21:34:05: Total frames rendered: 81, number of late frames: 0 (0.00%) (it's okay for some frames to be late)
21:34:05: 
21:34:05: Profiler results:
21:34:05: 
21:34:05: ==============================================================
21:34:05: video thread frame - [100%] [avg time: 4.763 ms (cpu time: avg 4.237 ms, total 343.202 ms)] [avg calls per frame: 1] [children: 99.9%] [unaccounted: 0.063%]
21:34:05: | frame preprocessing and rendering - [97.9%] [avg time: 4.662 ms (cpu time: avg 4.237 ms, total 343.202 ms)] [avg calls per frame: 1] [children: 53.7%] [unaccounted: 44.2%]
21:34:05: | | scene->Preprocess - [53.7%] [avg time: 2.559 ms (cpu time: avg 2.503 ms, total 202.801 ms)] [avg calls per frame: 1]
21:34:05: | GPU download and color conversion - [2.06%] [avg time: 0.098 ms (cpu time: avg 0 ms, total 0 ms)] [avg calls per frame: 1] [children: 1.89%] [unaccounted: 0.168%]
21:34:05: | | flush - [1.45%] [avg time: 0.069 ms (cpu time: avg 0 ms, total 0 ms)] [avg calls per frame: 1]
21:34:05: | | CopyResource - [0.357%] [avg time: 0.017 ms (cpu time: avg 0 ms, total 0 ms)] [avg calls per frame: 1]
21:34:05: | | conversion to 4:2:0 - [0.084%] [avg time: 0.004 ms (cpu time: avg 0 ms, total 0 ms)] [avg calls per frame: 1]
21:34:05: | Convert444Threads - [648%] [avg time: 30.851 ms (cpu time: avg 0.77 ms, total 62.4 ms)] [avg calls per frame: 1]
21:34:05: encoder thread frame - [100%] [avg time: 1.195 ms (cpu time: avg 0.495 ms, total 31.2 ms)] [avg calls per frame: 1]
21:34:05: ==============================================================
21:34:05: 
21:34:05: =====Stream End: 2013-09-11, 21:34:05=================================================


Last game capture log:
2013-09-11, 21:14:33: we're booting up: 
21:14:33: D3D9 Present
21:14:33: (half life scientist) everything..  seems to be in order
21:14:35: D3D9EndScene called
21:14:35: D3DPRESENT_PARAMETERS {
21:14:35: 	BackBufferWidth: 1920
21:14:35: 	BackBufferHeight: 1080
21:14:35: 	BackBufferFormat: D3DFMT_A8R8G8B8
21:14:35: 	BackBufferCount: 1
21:14:35: 	MultiSampleType: D3DMULTISAMPLE_NONE
21:14:35: 	MultiSampleQuality: 0
21:14:35: 	SwapEffect: D3DSWAPEFFECT_DISCARD
21:14:35: 	hDeviceWindow: 1190596
21:14:35: 	Windowed: true
21:14:35: 	EnableAutoDepthStencil: true
21:14:35: 	AutoDepthStencilFormat: D3DFMT_D24S8
21:14:35: 	Flags: None
21:14:35: 	FullScreen_RefreshRateInHz: 0
21:14:35: 	PresentationInterval: 2147483648
21:14:35: };
21:14:35: successfully set up d3d9 hooks
21:14:35: D3D9Present called
21:14:35: DoD3D9GPUHook: success
21:14:35: D3DSURFACE_DESC {
21:14:35: 	Format: D3DFMT_A8R8G8B8
21:14:35: 	Type: D3DRTYPE_SURFACE
21:14:35: 	Usage: D3DUSAGE_RENDERTARGET 
21:14:35: 	Pool: D3DPOOL_DEFAULT
21:14:35: 	MultiSampleType: D3DMULTISAMPLE_NONE
21:14:35: 	MultiSampleQuality: 0
21:14:35: 	Width: 1920
21:14:35: 	Height: 1080
21:14:35: };
21:14:35: successfully capturing d3d9 frames via GPU
21:18:52: ---------------------- Cleared D3D9 Capture ----------------------
21:18:52: received restart event, capturing
21:18:52: DoD3D9GPUHook: success
21:18:52: D3D9EndScene called
21:18:52: D3D9Present called
21:19:47: D3DSURFACE_DESC {
21:19:47: 	Format: D3DFMT_A8R8G8B8
21:19:47: 	Type: D3DRTYPE_SURFACE
21:19:47: 	Usage: D3DUSAGE_RENDERTARGET 
21:19:47: 	Pool: D3DPOOL_DEFAULT
21:19:47: 	MultiSampleType: D3DMULTISAMPLE_NONE
21:19:47: 	MultiSampleQuality: 0
21:19:47: 	Width: 1920
21:19:47: 	Height: 1080
21:19:47: };
21:19:47: successfully capturing d3d9 frames via GPU
21:19:48: ---------------------- Cleared D3D9 Capture ----------------------
21:19:48: received restart event, capturing
21:19:48: DoD3D9GPUHook: success
21:19:48: D3D9EndScene called
21:19:48: D3D9Present called
21:19:48: D3DSURFACE_DESC {
21:19:48: 	Format: D3DFMT_A8R8G8B8
21:19:48: 	Type: D3DRTYPE_SURFACE
21:19:48: 	Usage: D3DUSAGE_RENDERTARGET 
21:19:48: 	Pool: D3DPOOL_DEFAULT
21:19:48: 	MultiSampleType: D3DMULTISAMPLE_NONE
21:19:48: 	MultiSampleQuality: 0
21:19:48: 	Width: 1920
21:19:48: 	Height: 1080
21:19:48: };
21:19:48: successfully capturing d3d9 frames via GPU
21:32:40: ---------------------- Cleared D3D9 Capture ----------------------
21:32:40: received restart event, capturing
21:32:40: DoD3D9GPUHook: success
21:32:40: D3D9EndScene called
21:32:40: D3D9Present called
21:34:02: D3DSURFACE_DESC {
21:34:02: 	Format: D3DFMT_A8R8G8B8
21:34:02: 	Type: D3DRTYPE_SURFACE
21:34:02: 	Usage: D3DUSAGE_RENDERTARGET 
21:34:02: 	Pool: D3DPOOL_DEFAULT
21:34:02: 	MultiSampleType: D3DMULTISAMPLE_NONE
21:34:02: 	MultiSampleQuality: 0
21:34:02: 	Width: 1920
21:34:02: 	Height: 1080
21:34:02: };
21:34:02: successfully capturing d3d9 frames via GPU
21:34:05: ---------------------- Cleared D3D9 Capture ----------------------
21:34:05: received restart event, capturing
21:34:05: DoD3D9GPUHook: success
21:34:05: D3D9EndScene called
21:34:05: D3D9Present called
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
Video cannot be delayed in reverse, only audio can. What I think is happening here is not that your game is earlier, but that your webcam audio/video is later. This can often be fixed by just simply plugging in your webcam to a USB 3.0 port, or by updating drivers. You're using a good output format for it as well. Also, could you turn off "Use multithreaded optimizations" in advanced? It should make your webcam play 33 milliseconds faster as well, but those are the only good suggestions I can give to you for the time being.
 
Top