Question / Help Video and Audio out of sync

ZeroPF

New Member
My audio and video were working fine before but today when I streamed, the audio was out of sync with the video by about 2 seconds. Here is an example of what happened http://www.twitch.tv/zeeropf/b/592704870
Code:
12:54:20: Open Broadcaster Software v0.638b - 64bit ( ^ω^)
12:54:20: -------------------------------
12:54:20: CPU Name: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
12:54:20: CPU Speed: 3400MHz
12:54:20: Physical Memory:  8079MB Total, 4816MB Free
12:54:20: stepping id: 9, model 58, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 4, total cores 4
12:54:20: monitor 1: pos={1920, 180}, size={1600, 900}
12:54:20: monitor 2: pos={0, 0}, size={1920, 1080}
12:54:20: Windows Version: 6.1 Build 7601 S
12:54:20: Aero is Enabled
12:54:20: -------------------------------
12:54:20: OBS Modules:
12:54:20: Base Address     Module
12:54:20: 000000003F220000 OBS.exe
12:54:20: 00000000D98D0000 OBSApi.dll
12:54:20: 00000000E6FA0000 DShowPlugin.dll
12:54:20: 00000000E6F60000 GraphicsCapture.dll
12:54:20: 00000000E93B0000 NoiseGate.dll
12:54:20: 00000000E9300000 PSVPlugin.dll
12:54:20: ------------------------------------------
12:54:20: Adapter 1
12:54:20:   Video Adapter: AMD Radeon R9 200 Series
12:54:20:   Video Adapter Dedicated Video Memory: 4274270208
12:54:20:   Video Adapter Shared System Memory: 3967586304
12:54:20:   Video Adapter Output 1: pos={0, 0}, size={1920, 1080}, attached=true
12:54:20:   Video Adapter Output 2: pos={1920, 180}, size={1600, 900}, attached=true
12:54:20: ------------------------------------------
12:54:20: Adapter 2
12:54:20:   Video Adapter: Intel(R) HD Graphics 4000
12:54:20:   Video Adapter Dedicated Video Memory: 67108864
12:54:20:   Video Adapter Shared System Memory: 1711276032
12:54:20: =====Stream Start: 2014-11-25, 12:54:20===============================================
12:54:20:   Multithreaded optimizations: On
12:54:20:   Base resolution: 1920x1080
12:54:20:   Output resolution: 1536x864
12:54:20: ------------------------------------------
12:54:20: Loading up D3D10 on AMD Radeon R9 200 Series (Adapter 1)...
12:54:21: ------------------------------------------
12:54:21: Audio Format: 44100 Hz
12:54:21: ------------------------------------------
12:54:21: Audio Channels: 2 Ch
12:54:21: Playback device {0.0.0.00000000}.{c7ac8ecf-5c31-4756-876d-a05e20583424}
12:54:21: ------------------------------------------
12:54:21: Using desktop audio input: Line 1 (Virtual Audio Cable)
12:54:21: Global Audio time adjust: 1000
12:54:21: ------------------------------------------
12:54:21: Using auxilary audio input: FrontMic (Realtek High Definition Audio)
12:54:21: Mic time offset: 0
12:54:21: ------------------------------------------
12:54:21: Audio Encoding: MP3
12:54:21:     bitrate: 128
12:54:21: Using graphics capture
12:54:21: Using bitmap image
12:54:21: Trying to hook process: deadrising2otr.exe
12:54:21: Scene buffering time set to 400
12:54:21: Using custom x264 settings: "crf=18"
12:54:21: x264: MB rate (311040) > level limit (245760)
12:54:21: ------------------------------------------
12:54:21: Video Encoding: x264
12:54:21:     fps: 60
12:54:21:     width: 1536, height: 864
12:54:21:     preset: veryfast
12:54:21:     profile: main
12:54:21:     keyint: 120
12:54:21:     CBR: no
12:54:21:     CFR: no
12:54:21:     max bitrate: 3500
12:54:21:     buffer size: 5000
12:54:21:     quality: 14
12:54:21: ------------------------------------------
12:54:21: Audio timestamp for device 'FrontMic (Realtek High Definition Audio)' was behind target timestamp by 6437444
12:54:22: Using RTMP service: Twitch
12:54:22:   Server selection: rtmp://live-lax.twitch.tv/app
12:54:22:   Interface: Realtek PCIe GBE Family Controller (ethernet, 1000 mbps)
12:54:22: Completed handshake with rtmp://live-lax.twitch.tv/app in 107 ms.
12:54:22: SO_SNDBUF was at 8192
12:54:22: SO_SNDBUF is now 65536
12:54:26: SharedTexCapture hooked
12:54:27: RTMPPublisher::SocketLoop: Increasing send buffer to ISB 262144 (buffer: 0 / 463872)
12:54:27: RTMPPublisher::SocketLoop: Increasing send buffer to ISB 524288 (buffer: 0 / 463872)
13:02:14: GraphicsCaptureSource::NewCapture:  eliminating old capture
13:02:14: SharedTexCapture hooked
13:02:17: GraphicsCaptureSource::NewCapture:  eliminating old capture
13:02:17: SharedTexCapture hooked
13:11:23: Exit signal received, terminating capture
13:12:04: Total frames encoded: 63763, total frames duplicated: 2470 (3.87%)
13:12:04: Total frames rendered: 63619, number of late frames: 166 (0.26%) (it's okay for some frames to be late)
13:12:04: 
13:12:04: Profiler time results:
13:12:04: 
13:12:04: ==============================================================
13:12:04: video thread frame - [100%] [avg time: 1.196 ms] [children: 38.4%] [unaccounted: 61.6%]
13:12:04: | scene->Preprocess - [0.0836%] [avg time: 0.001 ms]
13:12:04: | GPU download and conversion - [38.3%] [avg time: 0.458 ms] [children: 9.45%] [unaccounted: 28.8%]
13:12:04: | | flush - [8.7%] [avg time: 0.104 ms]
13:12:04: | | CopyResource - [0.585%] [avg time: 0.007 ms]
13:12:04: | | conversion to 4:2:0 - [0.167%] [avg time: 0.002 ms]
13:12:04: Convert444Threads - [100%] [avg time: 0.466 ms] [children: 99.4%] [unaccounted: 0.644%]
13:12:04: | Convert444toNV12 - [99.4%] [avg time: 0.463 ms]
13:12:04: encoder thread frame - [100%] [avg time: 0.934 ms] [children: 1.28%] [unaccounted: 98.7%]
13:12:04: | sending stuff out - [1.28%] [avg time: 0.012 ms]
13:12:04: ==============================================================
13:12:04: 
13:12:04: 
13:12:04: Profiler CPU results:
13:12:04: 
13:12:04: ==============================================================
13:12:04: video thread frame - [cpu time: avg 0.109 ms, total 6957.64 ms] [avg calls per frame: 1]
13:12:04: | scene->Preprocess - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
13:12:04: | GPU download and conversion - [cpu time: avg 0.025 ms, total 1622.41 ms] [avg calls per frame: 1]
13:12:04: | | flush - [cpu time: avg 0.018 ms, total 1185.61 ms] [avg calls per frame: 1]
13:12:04: | | CopyResource - [cpu time: avg 0.002 ms, total 156.001 ms] [avg calls per frame: 1]
13:12:04: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 31.202 ms] [avg calls per frame: 1]
13:12:04: Convert444Threads - [cpu time: avg 0.473 ms, total 60169.6 ms] [avg calls per frame: 2]
13:12:04: | Convert444toNV12 - [cpu time: avg 0.472 ms, total 60060.4 ms] [avg calls per frame: 2]
13:12:04: encoder thread frame - [cpu time: avg 0.562 ms, total 35849 ms] [avg calls per frame: 1]
13:12:04: | sending stuff out - [cpu time: avg 0.009 ms, total 608.402 ms] [avg calls per frame: 1]
13:12:04: ==============================================================
13:12:04: 
13:12:04: =====Stream End: 2014-11-25, 13:12:04=================================================
13:12:04: ~RTMPPublisher: Packet flush completed in 102 ms
13:12:04: ~RTMPPublisher: Send thread terminated in 0 ms
13:12:04: RTMPPublisher::SocketLoop: Graceful loop exit
13:12:04: ~RTMPPublisher: Socket thread terminated in 0 ms
13:12:14: ~RTMPPublisher: Final socket shutdown completed in 10022 ms
13:12:14: Average send payload: 6716 bytes, average send interval: 16 ms
13:12:14: Number of times waited to send: 0, Waited for a total of 0 bytes
13:12:14: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
13:12:14: Number of bytes sent: 420701701
 

Sapiens

Forum Moderator
If your audio and video are slowly going out of sync over time please put your Settings > Advanced > Scene Buffering Time value back to the default of 700ms. 400ms is an old value and can cause this type of issue.
 

ZeroPF

New Member
If your audio and video are slowly going out of sync over time please put your Settings > Advanced > Scene Buffering Time value back to the default of 700ms. 400ms is an old value and can cause this type of issue.
I just tested it with my setting at 700ms but the stream is actually out of sync as soon as I start streaming, not after a certain amount of time. How would I go about fixing that?
 

Sapiens

Forum Moderator
You've already configured a 1 second global audio offset, can you not adjust that further until things are in sync?
 
Top