Question / Help Audio is behind video?

Scott Guerin

New Member
Hello,

OBS was recommended at a tech forum I saw and I figured I would give it a try. I was using YTD Downloader to get videos downloaded off Youtube but it sometimes hick-ups and just doesn't work - currently it won't update itself as I have 64 bit Windows 7 so I can't get it to work at all now.

So I can record videos no problem with OBS - using 'window capture' I can trick it out so the control bar doesn't show up and control OBS on the second monitor which is extended to the right. Full screen video no problem....however, the audio is behind the video.

I tried the log analyzer and it mentions considering cbr (but it makes no difference). I have tried audio bit rates of 128 to 256 to no avail (also mentioned by analyzer). I have 'excessive bitrate' when I tried moving that from 1200 to 2500 and 5000 but the lag is present at all of them. The audio is almost a second behind what the screen is showing (give or take).

I tried the option called 'force desktop audio to use video timestamps as a base for audio time' and things tighten up ALMOST on time - instead of say a full second of delay there is just a fraction; noticeable now simply because it was so obvious before I have my eye on it.

I don't think my machine is sub standard; I have Windows 7 Ultimate 64 bit version, core i7-4790k 4ghz processor, 16 gigs of 1860Mhz ram and a Radeon R9 video card. This should be up to the task - the cpu doesn't even move above 10% when using the program (going up from 5% when not actively encoding something). Heck, that YTD Downloader used to make essentially perfect videos tells me it isn't the computer, its either the settings or something I am missing.

I am unable to select 'quick sync' as an option - and once we start talking about messing around in the BIOS I am getting nervous as everything works just fine right now and I don't want to screw anything up. Force desktop audio to use video timestamps as a base for audio time is close but not quite.

Any ideas? I have tried cbr, no cbr, quality balance of 0, 10, max bit rates of 1200, 2500, 5000, audio encoding of 128 and 256, mp3 and aac codecs, advanced x264 settings, am 'using' cfr (whatever that is) and I even put in crf=15 as per one thread I saw (currently not using that).
 
Hello,

OBS was recommended at a tech forum I saw and I figured I would give it a try. I was using YTD Downloader to get videos downloaded off Youtube but it sometimes hick-ups and just doesn't work - currently it won't update itself as I have 64 bit Windows 7 so I can't get it to work at all now.

So I can record videos no problem with OBS - using 'window capture' I can trick it out so the control bar doesn't show up and control OBS on the second monitor which is extended to the right. Full screen video no problem....however, the audio is behind the video.

I tried the log analyzer and it mentions considering cbr (but it makes no difference). I have tried audio bit rates of 128 to 256 to no avail (also mentioned by analyzer). I have 'excessive bitrate' when I tried moving that from 1200 to 2500 and 5000 but the lag is present at all of them. The audio is almost a second behind what the screen is showing (give or take).

I tried the option called 'force desktop audio to use video timestamps as a base for audio time' and things tighten up ALMOST on time - instead of say a full second of delay there is just a fraction; noticeable now simply because it was so obvious before I have my eye on it.

I don't think my machine is sub standard; I have Windows 7 Ultimate 64 bit version, core i7-4790k 4ghz processor, 16 gigs of 1860Mhz ram and a Radeon R9 video card. This should be up to the task - the cpu doesn't even move above 10% when using the program (going up from 5% when not actively encoding something). Heck, that YTD Downloader used to make essentially perfect videos tells me it isn't the computer, its either the settings or something I am missing.

I am unable to select 'quick sync' as an option - and once we start talking about messing around in the BIOS I am getting nervous as everything works just fine right now and I don't want to screw anything up. Force desktop audio to use video timestamps as a base for audio time is close but not quite.

Any ideas? I have tried cbr, no cbr, quality balance of 0, 10, max bit rates of 1200, 2500, 5000, audio encoding of 128 and 256, mp3 and aac codecs, advanced x264 settings, am 'using' cfr (whatever that is) and I even put in crf=15 as per one thread I saw (currently not using that).
First, post your last logfile please. it can be found under the help menu. copy the link to the log here.

I dont recommend people syncing audio to video time but if it gets it close, its worth a shot. for now though, disable it.
remove all custom x264 settings i.e. crf=15, etc.

if you are recording local uncheck CBR and you really only need CFR (constant frame rate) if you are going to be using a program edit the video in.

Lastly, this method of youtube capture is not typical. its not that OBS cant do it, it just seems that there are a million programs to do this without losing A LOT of quality by transcoding with OBS.
 
Here is the log - the resulting audio is indeed not even close to the video and the log analyzer pulls up a multitude of issues. I have not disabled Aero as it makes the browsers 'ugly' and I didn't think it would impact window 'copies' (didn't make a difference in result, still audio lagged video even when I did disable it).

Here is the top bit that details the computer

23:44:29: Open Broadcaster Software v0.65b - 32bit (´・ω・`)
23:44:29: -------------------------------
23:44:29: CPU Name: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
23:44:29: CPU Speed: 3997MHz
23:44:29: Physical Memory: 4095MB Total, 4095MB Free
23:44:29: stepping id: 3, model 60, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 8, total cores 4
23:44:29: monitor 1: pos={1920, 0}, size={1920, 1200}
23:44:29: monitor 2: pos={0, 0}, size={1920, 1200}
23:44:29: Windows Version: 6.1 Build 7601 S
23:44:29: Aero is Enabled
23:44:29: -------------------------------
23:44:29: OBS Modules:
23:44:29: Base Address Module
23:44:29: 00EE0000 OBS.exe
23:44:29: 5E110000 OBSApi.dll
23:44:29: 67CE0000 DShowPlugin.dll
23:44:29: 61D30000 GraphicsCapture.dll
23:44:29: 61CA0000 NoiseGate.dll
23:44:29: 67F90000 PSVPlugin.dll
23:44:29: 67CC0000 scenesw.dll
23:44:29: ------------------------------------------
23:44:29: Adapter 1
23:44:29: Video Adapter: AMD Radeon R9 200 Series
23:44:29: Video Adapter Dedicated Video Memory: 3221225472
23:44:29: Video Adapter Shared System Memory: 1073676288
23:44:29: Video Adapter Output 1: pos={0, 0}, size={1920, 1200}, attached=true
23:44:29: Video Adapter Output 2: pos={1920, 0}, size={1920, 1200}, attached=true


Here is the cut from the run just done as you mentioned dping


00:24:25: =====Stream Start: 2015-03-17, 00:24:25===============================================
00:24:25: Multithreaded optimizations: On
00:24:25: Base resolution: 1920x1200
00:24:25: Output resolution: 1920x1200
00:24:25: ------------------------------------------
00:24:25: Loading up D3D10 on AMD Radeon R9 200 Series (Adapter 1)...
00:24:25: ------------------------------------------
00:24:25: Audio Format: 48000 Hz
00:24:25: ------------------------------------------
00:24:25: Audio Channels: 2 Ch
00:24:25: Playback device {0.0.0.00000000}.{9d3cc959-f4ff-4d58-8d04-8f9939c385fd}
00:24:25: ------------------------------------------
00:24:25: Using desktop audio input: Speakers (Realtek High Definition Audio)
00:24:25: Global Audio time adjust: 0
00:24:25: ------------------------------------------
00:24:25: Audio Encoding: AAC
00:24:25: bitrate: 256
00:24:25: Using Window Capture
00:24:25: Scene buffering time set to 700
00:24:25: ------------------------------------------
00:24:25: Video Encoding: x264
00:24:25: fps: 30
00:24:25: width: 1920, height: 1200
00:24:25: preset: veryfast
00:24:25: profile: high
00:24:25: keyint: 250
00:24:25: CBR: no
00:24:25: CFR: no
00:24:25: max bitrate: 1200
00:24:25: buffer size: 1200
00:24:25: quality: 10
00:24:25: ------------------------------------------
00:24:35: Total frames encoded: 271, total frames duplicated: 1 (0.37%)
00:24:35: Total frames rendered: 297, number of late frames: 1 (0.34%) (it's okay for some frames to be late)
00:24:35:
00:24:35: Profiler time results:
00:24:35:
00:24:35: ==============================================================
00:24:35: video thread frame - [100%] [avg time: 1.079 ms] [children: 70.2%] [unaccounted: 29.8%]
00:24:35: | scene->Preprocess - [60.9%] [avg time: 0.657 ms]
00:24:35: | GPU download and conversion - [9.27%] [avg time: 0.1 ms] [children: 8.53%] [unaccounted: 0.741%]
00:24:35: | | flush - [7.32%] [avg time: 0.079 ms]
00:24:35: | | CopyResource - [0.649%] [avg time: 0.007 ms]
00:24:35: | | conversion to 4:2:0 - [0.556%] [avg time: 0.006 ms]
00:24:35: Convert444Threads - [100%] [avg time: 0.868 ms] [children: 99.4%] [unaccounted: 0.576%]
00:24:35: | Convert444toNV12 - [99.4%] [avg time: 0.863 ms]
00:24:35: encoder thread frame - [100%] [avg time: 1.675 ms] [children: 0.597%] [unaccounted: 99.4%]
00:24:35: | sending stuff out - [0.597%] [avg time: 0.01 ms]
00:24:35: ==============================================================
00:24:35:
00:24:35:
00:24:35: Profiler CPU results:
00:24:35:
00:24:35: ==============================================================
00:24:35: video thread frame - [cpu time: avg 0.367 ms, total 109.2 ms] [avg calls per frame: 1]
00:24:35: | scene->Preprocess - [cpu time: avg 0.052 ms, total 15.6 ms] [avg calls per frame: 1]
00:24:35: | GPU download and conversion - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
00:24:35: | | flush - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
00:24:35: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
00:24:35: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
00:24:35: Convert444Threads - [cpu time: avg 0.745 ms, total 405.602 ms] [avg calls per frame: 2]
00:24:35: | Convert444toNV12 - [cpu time: avg 0.745 ms, total 405.602 ms] [avg calls per frame: 2]
00:24:35: encoder thread frame - [cpu time: avg 1.093 ms, total 296.401 ms] [avg calls per frame: 1]
00:24:35: | sending stuff out - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
00:24:35: ==============================================================
00:24:35:
00:24:35: =====Stream End: 2015-03-17, 00:24:35=================================================
 
Here is the log - the resulting audio is indeed not even close to the video and the log analyzer pulls up a multitude of issues. I have not disabled Aero as it makes the browsers 'ugly' and I didn't think it would impact window 'copies' (didn't make a difference in result, still audio lagged video even when I did disable it).

Here is the top bit that details the computer

23:44:29: Open Broadcaster Software v0.65b - 32bit (´・ω・`)
23:44:29: -------------------------------
23:44:29: CPU Name: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
23:44:29: CPU Speed: 3997MHz
23:44:29: Physical Memory: 4095MB Total, 4095MB Free
23:44:29: stepping id: 3, model 60, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 8, total cores 4
23:44:29: monitor 1: pos={1920, 0}, size={1920, 1200}
23:44:29: monitor 2: pos={0, 0}, size={1920, 1200}
23:44:29: Windows Version: 6.1 Build 7601 S
23:44:29: Aero is Enabled
23:44:29: -------------------------------
23:44:29: OBS Modules:
23:44:29: Base Address Module
23:44:29: 00EE0000 OBS.exe
23:44:29: 5E110000 OBSApi.dll
23:44:29: 67CE0000 DShowPlugin.dll
23:44:29: 61D30000 GraphicsCapture.dll
23:44:29: 61CA0000 NoiseGate.dll
23:44:29: 67F90000 PSVPlugin.dll
23:44:29: 67CC0000 scenesw.dll
23:44:29: ------------------------------------------
23:44:29: Adapter 1
23:44:29: Video Adapter: AMD Radeon R9 200 Series
23:44:29: Video Adapter Dedicated Video Memory: 3221225472
23:44:29: Video Adapter Shared System Memory: 1073676288
23:44:29: Video Adapter Output 1: pos={0, 0}, size={1920, 1200}, attached=true
23:44:29: Video Adapter Output 2: pos={1920, 0}, size={1920, 1200}, attached=true


Here is the cut from the run just done as you mentioned dping


00:24:25: =====Stream Start: 2015-03-17, 00:24:25===============================================
00:24:25: Multithreaded optimizations: On
00:24:25: Base resolution: 1920x1200
00:24:25: Output resolution: 1920x1200
00:24:25: ------------------------------------------
00:24:25: Loading up D3D10 on AMD Radeon R9 200 Series (Adapter 1)...
00:24:25: ------------------------------------------
00:24:25: Audio Format: 48000 Hz
00:24:25: ------------------------------------------
00:24:25: Audio Channels: 2 Ch
00:24:25: Playback device {0.0.0.00000000}.{9d3cc959-f4ff-4d58-8d04-8f9939c385fd}
00:24:25: ------------------------------------------
00:24:25: Using desktop audio input: Speakers (Realtek High Definition Audio)
00:24:25: Global Audio time adjust: 0
00:24:25: ------------------------------------------
00:24:25: Audio Encoding: AAC
00:24:25: bitrate: 256
00:24:25: Using Window Capture
00:24:25: Scene buffering time set to 700
00:24:25: ------------------------------------------
00:24:25: Video Encoding: x264
00:24:25: fps: 30
00:24:25: width: 1920, height: 1200
00:24:25: preset: veryfast
00:24:25: profile: high
00:24:25: keyint: 250
00:24:25: CBR: no
00:24:25: CFR: no
00:24:25: max bitrate: 1200
00:24:25: buffer size: 1200
00:24:25: quality: 10
00:24:25: ------------------------------------------
00:24:35: Total frames encoded: 271, total frames duplicated: 1 (0.37%)
00:24:35: Total frames rendered: 297, number of late frames: 1 (0.34%) (it's okay for some frames to be late)
00:24:35:
00:24:35: Profiler time results:
00:24:35:
00:24:35: ==============================================================
00:24:35: video thread frame - [100%] [avg time: 1.079 ms] [children: 70.2%] [unaccounted: 29.8%]
00:24:35: | scene->Preprocess - [60.9%] [avg time: 0.657 ms]
00:24:35: | GPU download and conversion - [9.27%] [avg time: 0.1 ms] [children: 8.53%] [unaccounted: 0.741%]
00:24:35: | | flush - [7.32%] [avg time: 0.079 ms]
00:24:35: | | CopyResource - [0.649%] [avg time: 0.007 ms]
00:24:35: | | conversion to 4:2:0 - [0.556%] [avg time: 0.006 ms]
00:24:35: Convert444Threads - [100%] [avg time: 0.868 ms] [children: 99.4%] [unaccounted: 0.576%]
00:24:35: | Convert444toNV12 - [99.4%] [avg time: 0.863 ms]
00:24:35: encoder thread frame - [100%] [avg time: 1.675 ms] [children: 0.597%] [unaccounted: 99.4%]
00:24:35: | sending stuff out - [0.597%] [avg time: 0.01 ms]
00:24:35: ==============================================================
00:24:35:
00:24:35:
00:24:35: Profiler CPU results:
00:24:35:
00:24:35: ==============================================================
00:24:35: video thread frame - [cpu time: avg 0.367 ms, total 109.2 ms] [avg calls per frame: 1]
00:24:35: | scene->Preprocess - [cpu time: avg 0.052 ms, total 15.6 ms] [avg calls per frame: 1]
00:24:35: | GPU download and conversion - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
00:24:35: | | flush - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
00:24:35: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
00:24:35: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
00:24:35: Convert444Threads - [cpu time: avg 0.745 ms, total 405.602 ms] [avg calls per frame: 2]
00:24:35: | Convert444toNV12 - [cpu time: avg 0.745 ms, total 405.602 ms] [avg calls per frame: 2]
00:24:35: encoder thread frame - [cpu time: avg 1.093 ms, total 296.401 ms] [avg calls per frame: 1]
00:24:35: | sending stuff out - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
00:24:35: ==============================================================
00:24:35:
00:24:35: =====Stream End: 2015-03-17, 00:24:35=================================================


I said copy the link not the text :P anyway,
First I would increase the scene buffering time to 1500. test AV sync and find out how far it is still off. If audio is ahead of video increase "Global Audio time adjust" under the advanced menu. if video is ahead of audio, use a negative number in the "Global Audio time adjust" but no more than -1500ms (which is the amount of your scene buffering time).

depending on the YT video resolution and OBS resolution, you will need to increase the bitrate and buffer to an amount that compliments the video quality I would guess 25,000 based on the resolution you are capturing at. If you want all out quality then set bitrate to 1000 and buffer to 0 *WARNING* the file could be very big
 
Sorry about that - the logs I didn't quite get initially and saw you would have had tons via a link. Didn't see how to delete the non relevant ones. Sorry. Think I got that sorted now.

The scene buffering went to 1500, no difference. I guessed a Global Audio time adjust of -1000 and thats very very close. As in, if I hadn't had the initial issue, I probably wouldn't be noticing anything.

Here is the log

https://gist.github.com/26054f8577da4f42003f

Should I still try altering max bitrate and buffer size (from 1200 each to higher)? The video quality is ok, not awesome. I am expecting some encoding degradation but would like to smooth out some of the jaggies (for lack of a technical term). I would have guessed more max bit rate and more buffer size, what does the 1000/0 do?
 
Sorry about that - the logs I didn't quite get initially and saw you would have had tons via a link. Didn't see how to delete the non relevant ones. Sorry. Think I got that sorted now.

The scene buffering went to 1500, no difference. I guessed a Global Audio time adjust of -1000 and thats very very close. As in, if I hadn't had the initial issue, I probably wouldn't be noticing anything.

Here is the log

https://gist.github.com/26054f8577da4f42003f

Should I still try altering max bitrate and buffer size (from 1200 each to higher)?

what does the 1000/0 do?

that is entirely up to you. you are encoding an already encoded then decoded and displayed video. there will be quality lost just by that.
for 1200p@30, I would use a minimum of 10000.

setting buffer to 0 just tells the encoder to use as much bitrate as possible for the resolution/fps. its like setting it to super variable bitrate. anyway, 10000 should do find if 2500 looks alright to you.

that all being said, I still think you could find another program to just download your videos.
 
I am having exactly the same problem since updating to 0.65 Beta I'm having to fix everything in a video editor after the fact. I tested it and the MP OBS still records at the right time. I tested the videos with VLC first, and used the audio offset feature in it. I discovered that if I set the audio offset to -1.000 in VLC it worked right, and if I cut on the force desktop audio to use video timestamps option it was +0.100.
 
Well, I moved max bitrate to 10,000 and buffer to zero, the files are large but I don't think they would be any larger than what YTD was putting out (OBS is doing about 12 meg a minute so if anything, I'd say its currently about 60% of the space YTD was using for an equivalent time).

It doesn't seem the Global Audio time will go lower than 1000, just saying.

The thing is, there are times you want to grab say a YouTube video and times you want a documentary from documentary.org; well YTD wouldn't do the later. So I figured what freeware would be out there that wasn't riddled with spyware and malware etc and OBS seemed the best choice. FRAPS might do something similar for end result, maybe, but would cost me 50 bucks or so and I am not certain it would be any better.

I also don't see how to get around the 'encoding an already encoded then decoded and displayed' issue if trying to basically get video 'screen grabs' - by the time its on my screen, that has happened.

edit - and I have been using VLC to watch my results. I don't think that causes an issue nor do I see an audio offset in the preferences.
 
Audio Offset in VLC is in the Extended Settings which can be found on the control bar. It looks like an audio mixer icon.
 
Ah, interesting, yup, got it. I guess at worst if you make an OBS video and at some point think its 'off' (having done the Global Audio Time' adjust as I did), you could just get VLC to do another one in the different direction!
 
I figured out that it was Razer Synapse messing mine up. It had actually updated just before my audio went out of sync, but I didn't remember it. I got another update for that tonight, and it fixed it as soon as the update installed.
 
Back
Top