Bug Report OBS QuickSync Audio Delay on BF4

bluesatin

New Member
I appear to be having audio delay when QuickSync is enabled when recording/streaming BF4.

Example comparison footage recorded to a file here: http://www.youtube.com/watch?v=u0MTxvGHfkk

Log file recording a QuickSync enabled (audio lag) recording followed by a standard (no audio lag) recording:

Code:
01:02:13: Open Broadcaster Software v0.584b - 32bit (´・ω・`)
01:02:13: -------------------------------
01:02:13: CPU Name: Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz
01:02:13: CPU Speed: 3400MHz
01:02:13: Physical Memory:  4095MB Total, 1605MB Free
01:02:13: stepping id: 3, model 60, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 4, total cores 4
01:02:13: monitor 1: pos={0, 0}, size={2560, 1440}
01:02:13: monitor 2: pos={2560, 0}, size={1920, 1080}
01:02:13: Windows Version: 6.1 Build 7601 S
01:02:13: Aero is Enabled
01:02:13: -------------------------------
01:02:13: OBS Modules:
01:02:13: Base Address     Module
01:02:13: 00EE0000         OBS.exe
01:02:13: 65020000         OBSApi.dll
01:02:13: 736E0000         DShowPlugin.dll
01:02:13: 73130000         GraphicsCapture.dll
01:02:13: 735B0000         NoiseGate.dll
01:02:13: 73020000         PSVPlugin.dll
01:02:13: ------------------------------------------
01:02:13: Adapter 1
01:02:13:   Video Adapter: NVIDIA GeForce GTX 560 Ti  
01:02:13:   Video Adapter Dedicated Video Memory: 1024917504
01:02:13:   Video Adapter Shared System Memory: 3221106688
01:02:13:   Video Adapter Output 1: pos={0, 0}, size={2560, 1440}, attached=true
01:02:13: ------------------------------------------
01:02:13: Adapter 2
01:02:13:   Video Adapter: Intel(R) HD Graphics 4600
01:02:13:   Video Adapter Dedicated Video Memory: 67108864
01:02:13:   Video Adapter Shared System Memory: 1711276032
01:02:13:   Video Adapter Output 1: pos={2560, 0}, size={1920, 1080}, attached=true
01:02:13: =====Stream Start: 2013-12-03, 01:02:13===============================================
01:02:13:   Multithreaded optimizations: On
01:02:13:   Base resolution: 1280x720
01:02:13:   Output resolution: 1280x720
01:02:13: ------------------------------------------
01:02:13: Loading up D3D10 on NVIDIA GeForce GTX 560 Ti...
01:02:13: ------------------------------------------
01:02:13: Audio Format: 48000hz
01:02:13: Playback device Default
01:02:13: ------------------------------------------
01:02:13: Using desktop audio input: Speakers (Realtek High Definition Audio)
01:02:13: ------------------------------------------
01:02:13: Using auxilary audio input: Rode Podcaster (Rode Podcaster)
01:02:13: ------------------------------------------
01:02:13: Audio Encoding: AAC
01:02:13:     bitrate: 128
01:02:13: Using graphics capture
01:02:13: Scene buffering time set to 400
01:02:13: Found QSV hardware support
01:02:14: ------------------------------------------
01:02:14: QSV version 1.6 using MFX_IMPL_HARDWARE_ANY | MFX_IMPL_VIA_D3D9 (actual: MFX_IMPL_HARDWARE2 | MFX_IMPL_VIA_D3D9)
01:02:14: Using 10 bitstreams and 13 frame buffers
01:02:14: ------------------------------------------
01:02:14: Video Encoding: QSV
01:02:14:     fps: 30
01:02:14:     width: 1280, height: 720
01:02:14:     target-usage: MFX_TARGETUSAGE_BEST_QUALITY
01:02:14:     CBR: yes
01:02:14:     CFR: no
01:02:14:     max bitrate: 2048
01:02:14: ------------------------------------------
01:02:14: MMDeviceAudioSource: Frequency for device 'Speakers (Realtek High Definition Audio)' is 384000, samples per sec is 48000
01:02:14: MMDeviceAudioSource: Frequency for device 'Rode Podcaster (Rode Podcaster)' is 192000, samples per sec is 48000
01:02:15: SharedTexCapture hooked
01:02:29: Total frames encoded: 443, total frames duplicated: 1 (0.23%)
01:02:29: Total frames rendered: 447, number of late frames: 0 (0.00%) (it's okay for some frames to be late)
01:02:29: 
01:02:29: Profiler time results:
01:02:29: 
01:02:29: ==============================================================
01:02:29: video thread frame - [100%] [avg time: 0.506 ms] [children: 7.51%] [unaccounted: 92.5%]
01:02:29: | scene->Preprocess - [0.198%] [avg time: 0.001 ms]
01:02:29: | GPU download and conversion - [7.31%] [avg time: 0.037 ms] [children: 5.73%] [unaccounted: 1.58%]
01:02:29: | | flush - [2.77%] [avg time: 0.014 ms]
01:02:29: | | CopyResource - [1.58%] [avg time: 0.008 ms]
01:02:29: | | conversion to 4:2:0 - [1.38%] [avg time: 0.007 ms]
01:02:29: Convert444Threads - [100%] [avg time: 0.35 ms] [children: 99.1%] [unaccounted: 0.857%]
01:02:29: | Convert444toNV12 - [99.1%] [avg time: 0.347 ms]
01:02:29: encoder thread frame - [100%] [avg time: 0.049 ms] [children: 42.9%] [unaccounted: 57.1%]
01:02:29: | ProcessEncodedFrame - [36.7%] [avg time: 0.018 ms]
01:02:29: | QueueEncodeTask - [6.12%] [avg time: 0.003 ms]
01:02:29: ==============================================================
01:02:29: 
01:02:29: 
01:02:29: Profiler CPU results:
01:02:29: 
01:02:29: ==============================================================
01:02:29: video thread frame - [cpu time: avg 0.034 ms, total 15.6 ms] [avg calls per frame: 1]
01:02:29: | scene->Preprocess - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
01:02:29: | GPU download and conversion - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
01:02:29: | | flush - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
01:02:29: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
01:02:29: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
01:02:29: Convert444Threads - [cpu time: avg 0.036 ms, total 31.2 ms] [avg calls per frame: 2]
01:02:29: | Convert444toNV12 - [cpu time: avg 0.036 ms, total 31.2 ms] [avg calls per frame: 2]
01:02:29: encoder thread frame - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
01:02:29: | ProcessEncodedFrame - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
01:02:29: | QueueEncodeTask - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
01:02:29: ==============================================================
01:02:29: 
01:02:29: =====Stream End: 2013-12-03, 01:02:29=================================================
01:02:48: =====Stream Start: 2013-12-03, 01:02:48===============================================
01:02:48:   Multithreaded optimizations: On
01:02:48:   Base resolution: 1280x720
01:02:48:   Output resolution: 1280x720
01:02:48: ------------------------------------------
01:02:48: Loading up D3D10 on NVIDIA GeForce GTX 560 Ti...
01:02:48: ------------------------------------------
01:02:48: Audio Format: 48000hz
01:02:48: Playback device Default
01:02:48: ------------------------------------------
01:02:48: Using desktop audio input: Speakers (Realtek High Definition Audio)
01:02:48: ------------------------------------------
01:02:48: Using auxilary audio input: Rode Podcaster (Rode Podcaster)
01:02:48: ------------------------------------------
01:02:48: Audio Encoding: AAC
01:02:48:     bitrate: 128
01:02:48: Using graphics capture
01:02:48: Scene buffering time set to 400
01:02:48: ------------------------------------------
01:02:48: Video Encoding: x264
01:02:48:     fps: 30
01:02:48:     width: 1280, height: 720
01:02:48:     preset: veryfast
01:02:48:     profile: high
01:02:48:     keyint: 60
01:02:48:     CBR: yes
01:02:48:     CFR: no
01:02:48:     max bitrate: 2048
01:02:48:     buffer size: 2048
01:02:48: ------------------------------------------
01:02:48: MMDeviceAudioSource: Frequency for device 'Speakers (Realtek High Definition Audio)' is 384000, samples per sec is 48000
01:02:48: MMDeviceAudioSource: Frequency for device 'Rode Podcaster (Rode Podcaster)' is 192000, samples per sec is 48000
01:02:50: SharedTexCapture hooked
01:03:07: Total frames encoded: 538, total frames duplicated: 0 (0.00%)
01:03:07: Total frames rendered: 543, number of late frames: 1 (0.18%) (it's okay for some frames to be late)
01:03:07: 
01:03:07: Profiler time results:
01:03:07: 
01:03:07: ==============================================================
01:03:07: video thread frame - [100%] [avg time: 0.511 ms] [children: 10.2%] [unaccounted: 89.8%]
01:03:07: | scene->Preprocess - [0.196%] [avg time: 0.001 ms]
01:03:07: | GPU download and conversion - [9.98%] [avg time: 0.051 ms] [children: 8.22%] [unaccounted: 1.76%]
01:03:07: | | flush - [3.33%] [avg time: 0.017 ms]
01:03:07: | | CopyResource - [1.76%] [avg time: 0.009 ms]
01:03:07: | | conversion to 4:2:0 - [3.13%] [avg time: 0.016 ms]
01:03:07: Convert444Threads - [100%] [avg time: 0.354 ms] [children: 99.2%] [unaccounted: 0.847%]
01:03:07: | Convert444toNV12 - [99.2%] [avg time: 0.351 ms]
01:03:07: encoder thread frame - [100%] [avg time: 0.767 ms]
01:03:07: ==============================================================
01:03:07: 
01:03:07: 
01:03:07: Profiler CPU results:
01:03:07: 
01:03:07: ==============================================================
01:03:07: video thread frame - [cpu time: avg 0.057 ms, total 31.2 ms] [avg calls per frame: 1]
01:03:07: | scene->Preprocess - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
01:03:07: | GPU download and conversion - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
01:03:07: | | flush - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
01:03:07: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
01:03:07: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
01:03:07: Convert444Threads - [cpu time: avg 0.029 ms, total 31.2 ms] [avg calls per frame: 2]
01:03:07: | Convert444toNV12 - [cpu time: avg 0.029 ms, total 31.2 ms] [avg calls per frame: 2]
01:03:07: encoder thread frame - [cpu time: avg 0.088 ms, total 46.8 ms] [avg calls per frame: 1]
01:03:07: ==============================================================
01:03:07: 
01:03:07: =====Stream End: 2013-12-03, 01:03:07=================================================
Also worth asking, I presume the settings under [Advanced -> Video] [x264 CPU Preset] and [x264 Encoding Profile] don't change anything if you're running with Quick Sync enabled?

Let me know if you need any more information, logs or tests done etc.


Thanks, bluesatin.
 

Floatingthru

Community Helper
I think it is normal to have such an audio delay when using quicksync compared to x264. I personally use around a 300ms delay when I do encoding with quicksync, and only a 100ms delay when I use x264. You can change the global audio offset time in Advanced. You just have to figure out the delay yourself since all machines will have different delays.

For your second question I know you can only adjust b-frames and some other setting which I can't remember now, but that is about it. Hardware encoders are much less flexible than software encoders.
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
Actually there really shouldn't be an audio delay with quicksync. It should function same as x264 in that regard. I'll point palana to it.

Is it just BF4?
 

Palana

Developer
The latest build 32 bit 64 bit should have reduced audio delay; the delay should be most noticeable on haswell due to more buffered frames for pyramidal bframe support and such
 

bluesatin

New Member
Should have clarified I hadn't got a chance to test.

I downloaded and tried both the 32-bit and 64-bit versions and I'm getting a crash when I try previewing or local file recording with QuickSync enabled.

Crash Report:
Code:
OBS has encountered an unhandled exception and has terminated. If you are able to
reproduce this crash, please submit this crash report on the forums at
http://www.obsproject.com/ - include the contents of this crash log and the
minidump .dmp file (if available) as well as your regular OBS log files and
a description of what you were doing at the time of the crash.

This crash appears to have occured in the 'c:\users\bluesatin\desktop\obs test\obs.exe' module.

**** UNHANDLED EXCEPTION: c0000094
Fault address: 000000013F269536 (c:\users\bluesatin\desktop\obs test\obs.exe)
OBS version: Open Broadcaster Software v0.584b (master/58c2ad0)
Windows version: 6.1 (Build 7601) Service Pack 1
CPU: Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz

Crashing thread stack trace:
Stack            EIP              Arg0             Arg1             Arg2             Arg3             Address
000000000C4CF750 000000013F269536 0000000000000000 0000000000000003 0000000000000000 00000000000002C0 obs.exe!`anonymous namespace'::DTSGenerator::operator()+0x46
000000000C4CF780 000000013F26BF3B 0000000000281C00 000000000C4CF930 000000000C4CF920 0000000000281C00 obs.exe!QSVEncoder::ProcessEncodedFrame+0x16b
000000000C4CF870 000000013F26CE39 000000000000000C 0000000000142300 000000000C4CF9F8 0000000000150800 obs.exe!QSVEncoder::Encode+0x109
000000000C4CF8F0 000000013F284BD9 0000000000000021 000000000000000C 000000000C4CFA59 0000000000000021 obs.exe!OBS::ProcessFrame+0xd9
000000000C4CF980 000000013F28522E 0000000000000001 0000000000000001 0000000000000000 0000000000000000 obs.exe!OBS::EncodeLoop+0x53e
000000000C4CFAC0 000000013F284179 0000000000000000 0000000000000000 0000000000000000 0000000000000000 obs.exe!OBS::EncodeThread+0x9
000000000C4CFAF0 000000007772652D 0000000000000000 0000000000000000 0000000000000000 0000000000000000 kernel32.dll!0x7772652d
000000000C4CFB20 000000007795C541 0000000000000000 0000000000000000 0000000000000000 0000000000000000 ntdll.dll!0x7795c541

A minidump was saved to C:\Users\Bluesatin\AppData\Roaming\OBS\crashDumps\OBSCrashDump2013-12-05_9.dmp.
Please include this file when posting a crash report.

List of loaded modules:
Base Address                      Module
The crash dump should be attached at the bottom.
 

Attachments

  • OBSCrashDump2013-12-05_9.dmp
    457.3 KB · Views: 38

Lain

Forum Admin
Lain
Forum Moderator
Developer
I'll probably make an official update for this after I get in a few more features.
 

bluesatin

New Member
Audio is now spot on and I'm no longer getting the crash since I updated to 62865a5.

A quick question, is there any reason to use the 64-bit version over the 32-bit?

I've had a bunch of problems with 64-bit versions of programs in the past, so I've got into the habit of just using the 32-bit versions of everything if they're available.

Thanks for all your hardwork guys, this project is absolutely amazing! :D
 

Fog

New Member
Has this been been added to the latest stable version? I just switched over to QuickSync and notice the audio delay when I stream.
 
Top