Question / Help Audio drifts out of sync with video :(

I'm having audio/video sync problems. It starts out perfect/flawless but drifts/gets more out of sync the longer the stream runs :(

Some notes on my config in case it's relevant:
Stream computer is i7 2600 @ 3.4GHz, 32GB ram, Win 7 Ultimate x64, nVidia 560Ti
Black Magic Intensity Pro (internal pci express)
Video comes in by HDMI (stripped HDCP) 720p 59.94fps
OBS version v0.584b 64bit
Video device: Decklink Video Capture, HD 720p 59.94 - 8 bit 4:2:2 YUV, Timecode: VITC (SMPTE 12M)
Audio device: Decklink Audio Capture, 2 channels, 48kHz, 16-bit

Log: http://pastebin.com/Qpa0A9ve (I coped the live log file with shadowcopy, it wasn't convenient for me to shut down my stream at the time, to grab the log file)

In the settings you'll see the RTMP target is 192.168.1.138, that's a RaspberryPi "B" running Raspbian Wheezy 2013-09-25 with nginx rtmp edition 1.5.7 setup using this amazing guide.

I play the RTMP stream on both the streaming PC using SMPlayer to pull it from the Pi, as well as live on the web, using JW player. The audio sync problem happens in both places. It doesn't matter if I close and re-open SMPlayer, the audio sync will still be off.

The ONLY way to fix it (temporarily), is to right click in the main window in OBS, click Properties, adjust the audio sync time offset then put it back to 0, click OK. A few seconds later I'll hear the audio in the stream cut out for a split second then voila, the audio/video sync is perfect, then starts to drift to the point it's not watchable after 12 hours or so.

Any ideas??? :(

And slightly unrelated, why is there no "mono" option for the sound encoding?? And how do I boost the volume of the stream? I have the input at 100% (in the decklink audio device), my player is at 100%, but the volume is only about 20% as loud as it is when I use amarectv.

-Jamie M.
EDIT: My internet speed, not that it's important because I'm primarily streaming over wired LAN
3001260636.png
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
Are you just streaming your decklink? What specifically is out of sync with what? How much is it out of sync? With certain devices, you must enable "Use Buffering" in the source properties for the device to ensure sync (which is currently an oversight in the code and will be fixed in future versions)
 
Jim said:
Are you just streaming your decklink?
I'm not sure what your question is :( Did you look at my log file? I have only one "Scene", the only thing on the "scene" is my decklink. It's the same resolution as my "scene" (both 1280x720).

Jim said:
What specifically is out of sync with what?
The audio is out of sync with the video? I don't know how else to explain it :( The video and audio come into my blackmagic card over a single HDMI cable.

Jim said:
How much is it out of sync?
It depends on how long the stream has been running. After 12 hours I would estimate it's approx 250ms out of sync. After 24 hours, 500ms, etc. etc. etc. I suppose I could record the stream then dump it in Adobe Premiere and measure exactly how far out of sync it gets, but I don't think that's super important.

Jim said:
With certain devices, you must enable "Use Buffering" in the source properties for the device to ensure sync (which is currently an oversight in the code and will be fixed in future versions)
I see. So you're saying this isn't currently an option I can enable?

Thanks for your quick reply, this is causing a lot of issues for my customer :( Right now, every hour on the hour I manually reset the audio sync (explained in my previous post), keeps everything nice and pretty, but obviously, a permanent solution is needed.

-Jamie M.
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
I think we had a major communication breakdown there. I admittedly didn't see your log at first because I was expecting it to be a forum paste. You are indeed streaming your capture device (decklink).

And as for the second question, terribly sorry for being vague -- when I asked you what's out of sync with what, I just meant "my capture device's video is out of sync with its audio", or "my mic is out of sync with my webcam".

The "Use Buffering" option is in the device's source properties, right click on the source for your device in the scene, go to "properties", and the option will be in there. Enable it, leaving the value at 0, and try it out.
 

paibox

heros in an halfshel
This most likely does not have to do with the "Use buffering" option, but rather the fact that you are capturing at an NTSC frame rate and the DirectSound output's inability to deal with it. Please try this custom build and test it for an extended period of time (if possible) and post if it fixes the problem: http://www.apehead.se/OBS-bibbers.zip

Edit: My fiber decided to go down, which means that my web server is also offline. If you drop by the IRC channel, I can provide you with the zip file in some other way. Back up again, woo!
 
paibox said:
This most likely does not have to do with the "Use buffering" option, but rather the fact that you are capturing at an NTSC frame rate and the DirectSound output's inability to deal with it. Please try this custom build and test it for an extended period of time (if possible) and post if it fixes the problem: http://www.apehead.se/OBS-bibbers.zip

Edit: My fiber decided to go down, which means that my web server is also offline. If you drop by the IRC channel, I can provide you with the zip file in some other way. Back up again, woo!
I download that. When it was opened it asked if I wanted to update a whole bunch of modules, which I said no to, which you said was the correct choice.

I started the streaming, immediately I noticed the A/V sync was a hair off. I set the audio sync to +50ms and it looks flawless.

The super nice thing about this version is when I change the audio sync the video feed doesn't blank out for as split second when it changes the sync :)

I'll leave it streaming overnight and check it in the morning and let you know how it goes :)

I haven't looked for the buffer option yet.

Thanks again guys, for the quick support.

-Jamie M.
 
The audio/video drifted out of sync again :(

This is what it looks like after exactly 12 hours: http://www.youtube.com/watch?v=TSbBsjWDR_0

Also, a weird issue with the bibbers version: with the normal OBS I would just right click on the preview window, properties, adjust the audio sync to 1, back to 0, hit OK, then boom, would fix the audio sync. I tried this with the bibbers version but when I adjust the audio sync it doesn't reset the sync in the stream, it seems to do just that, adjust the sync. I set it to -500ms and the sync looks pretty close now. I'm sure in another 12 hours I'll have it set to -1000ms :(

Also, I tried to find the buffering option, to give it a try, no luck :(

Decklink video device properties:
2iha1oy.jpg


Decklink audio device properties:
2u8ysdf.jpg


20f9ik1.jpg


Where is it hiding? lol.

-Jamie M.
(P.S. In the meantime I've set my encoder to encode the audio at 48khz, seeing as my input is also 48khz)
 

hobbit2513

New Member
@toysareforboys

The use buffering setting is within OBS. Right click your source and click on properties, it should be under Video.
 
hobbit2513 said:
@toysareforboys

The use buffering setting is within OBS. Right click your source and click on properties, it should be under Video.
Ahhhh. Sweet. Found the setting, turned it on. Will give that a try, thanks!

157iq79.jpg


-Jamie M.
 
WOOT WOOT! ALL FIXED!!! :D

I'm not sure if it was changing the audio encoding to 48khz (to match the input), or enabling buffering! lol.

Working damn sweet now though, thanks. Got it streaming on my Samsung S4 using MX Player app too!

288z39z.jpg


-Jamie M.
 
Top