Question / Help Recording - video & audio track not same length.

Gaz

New Member
I've been facing a problem for a long time now where my audacity recordings don't match the audio recording in OBS.
I have tried many different things, even have a completely new computer which makes the problem more confusing to me, but nothing resolves it.
I quickly learned the problem is not with Audacity because the problem doesn't exist when I use other methods of recording gameplay (Bandicam, Xsplit, etc.) but for recording my 3DS, OBS is simply the most user friendly (recording 2 screens in 1 scene) which is why I keep trying.


Today I noticed this in Sony Vegas Pro when I look at the properties of the video file created by OBS.

Streams
Video: 00:36:09.433, 30.000 fps progressive, 1920x1080x12, AVC
Audio 1: 00:36:09.386, 48,000 Hz, Stereo, AAC
Audio 2: 00:36:09.365, 48,000 Hz, Stereo, AAC


You can see that Audio 1 (Desktop) is 0.047 shorter than the video track and Audio 2(mic) is 0.068 shorter.
When I mark the audio mic tracks in Sony Vegas at the end it roughly has a 0.04 difference.


Now in the log files I will see it post this on start up of the program:

01:29:20.099: ==== Startup complete ===============================================
01:29:20.099: Service '' not found
01:29:20.100: All scene data cleared
01:29:20.100: ------------------------------------------------
01:29:20.162: WASAPI: Device 'Speakers (Realtek High Definition Audio)' initialized
01:29:20.167: WASAPI: Device 'Microphone (Yeti Stereo Microphone)' initialized
01:29:20.222: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds
01:29:22.228: Switched to scene '3DS'

42 milliseconds would be about the same as 0.047 seconds, correct?


Now the problem is, it doesn't add this buffer on the complete recording because then I could easily offset it.
It seems to apply it at random throughout the recording causing the sync to drift further and further out of sync the longer I record.


I really need someone with more experience on the subject to help me out because it's driving me absolutely crazy.
I thought my old computer wasn't able to handle OBS recordings or something, but I have an i7-6700k now with 16GB memory. It should have no problems whatsoever.
 
Probably, your audio device can't handle heavy tracks at full quality (also, when adding devices as Audio Input Capture and Audio Output Capture sources you can control the Use Device Timestamps option - unchecked for Input device and checked for Output device by default). Check the device settings in windows and try to update sound card driver. Post the full log.
 
That doesn't make any sense to me since the exact same thing happened on my old computer. I bought and replaced every single part and obviously reinstalled Windows and the same thing is happening. I made sure to buy higher performance parts to try and prevent the problems I was having before. What I'm saying is I don't think it's a hardware issue but rather a setting I'm using.

I'm running on an Asus Maximum VIII Hero, it should be able to handle it no problems.
The output is checked and the input is unchecked for timestamps.



Here is the log file. I recorded 2 videos in this session and both of them have the audio running out of sync in comparison to the Audacity recording and the length of the audio track is shorter than the video track in both when analyzing them in Sony Vegas. There is a 3rd video inbetween but I stopped it after a few seconds.

http://pastebin.com/W3itP2aT
 
Last edited:
Did you tried to remux recorded files with OBS Studio and then import them to editing software or just decompress audio tracks to raw format (simple wav)? Because, previously most of the sync problems, I saw there, on the forum, were caused by mismatching settings of the input/output, insufficient bandwidth, dropped frames etc and were in the streaming. Sometimes it resolved by installing CoreAudio AAC codec (iTunes application uses it too, see https://obsproject.com/forum/resources/obs-studio-enable-coreaudio-aac-encoder-windows.220/). Also, as far as I know, Audacity uses different format/codec to record the audio files. Maybe it is wise to use other editing software? (https://obsproject.com/forum/resources/post-production-tools-you-can-use.234/ the discuss about the thread has more tools mentioned)

Also, possibly, you have a typo when posted this string:

Video: 00:36:09.433, 30.000 fps progressive, 1920x1080x12, AVC

what is the #12 in 1920x1080x12 ? (I have no experience with Sony Vegas Pro, if you know what this option means, please explain).
 
Last edited:
I have previously tried CoreAudioAAC codec, did not resolve anything.

I did not remux anything. I record gameplay (video+audio+mic tracks) in OBS, and a seperate microphone recording in Audacity so that I have a dedicated project file to edit the microphone recording which is then exported into a .wav file.
Both OBS and Audacity record the same microphone (blue yeti) at 48khz.
Then in Sony Vegas Pro(also at 48khz), I add the Audacity recording. Sync it up at the beginning (finger clip/hand slap/etc.) and it never stays in sync any longer than 5 to 10 minutes after which occasionally it will drift a little bit further out of sync with the OBS microphone track.
It is not a gradual sync drift that can be resolved with a speed increase/decrease of the entire track. On average in a 30 minute recording I get about 3 places in the file where it drifts out of sync.

The 12 is the bit depth of the color or something. 12 bit per pixel.

Again, I don't believe my computer to be the problem as it never even goes over 30-40% usage while doing any of this.
Audacity records to my HDD. And OBS is recording to a dedicated SSD (as a test, to see if the other HDD was a bottleneck).
 
About the hw try to compare sound chips (before and after upgrade).

I don't think that Studio able to produce 12-bit video by now, so your editing software cannot recognize format right.

Try to remux videos. File>Remux Recordings then import. Or even try to decompress each audio track and import it uncompressed.

Edit: USB mic?
 
Last edited:
I don't understand what you're trying to tell me.

OBS is the one creating the 12 bit video. Vegas imports (and exports) it without issues.


Also, there are so many things being thrown around from audio recording program to video editing when the problem is created within OBS.
The sync issue is audible in the video file created by OBS(before any editing has happened). When I go into SonyVegas and visually look for where the sync occurs by analyzing the audio wave, then go into the video file using a media player and playback at the same spot you can clearly hear a slight artifact in the sound.
OBS is the problem, therefor I am trying to figure out what I am doing wrong with OBS that's causing this sync drift.

I record in CBR at 8196 bit rate, to an .mp4 file with x264. 2 audio tracks seperated (game + mic).
Now of course you'll tell me "oh go and use VBR instead!", but I have tried and it doesn't make a difference.
Somewhere something is not right with OBS, but it's my only option to properly record a 3ds because it outputs 2 different screens. No other recording software allows me to record 2 screens within a single scene and have overlays (like pokemon icons etc.).

I love OBS, but it's a huge time sink to correct all the sync drift issues I am having.
AND what is most frustrating is that a completely new computer is having the EXACT same issue, so clearly I have something set up improperly but I can't figure out what.

Again, the sync drift occurs PRE-editing.
 
If mic is USB device - try to check Use Device Timestamps for Audio Input Capture and see what happens.

About studios videos - they are all 8-bit depth.
 
I tried that, still same problem.

I find it hard to believe that this is some kind of exotic problem that no one knows a solution to.
I've found a couple people with the same problem and no solution ever gets offered.

2 completely different computers, same problem. It just doesn't make sense.

I guess next thing to try is reduce the sample rate to 44.1khz in all programs. Which again doesn't make sense since I have a 48khz microphone.
 
Try to plug in casual mic with 3.5mm jack-in directly into your motherboard and record it with OBS Studio.
 
That's the problem lol. If I knew what setting was causing the problem I wouldn't be here asking for assistance.
I'll write a new topic in the future, it's clear that at this time nobody seems to know what the problem is.
 
It's because it hard to reproduce. For example, all my tracks up to 30min length always were in sync. It was mainly test videos with the graphics loops but the result is the same. Maybe you have raw example of the multi-track video recorded with OBS Studio? Or I may provide you a static video with 3 tracks and you'll try to import it into your editing software to see if it still in sync. My PC is weak for HD recordings so it will be still image video 320x240@25fps, as mic's sync sound, I can place mouse clicks to hide/show the image (it works almost without a delay). Wanna test it?
 
Current I am having the same issue Gaz is having.

My Specs:
i7 6700k 4.4ghz
32GB of Memory
GTX 1080 Founders Edition
Win 10

I found this issue while looking at my recording more. There's a shorter audio length in comparison to the video length. I don't use OBS to the stream just to record.

Video Time: 00:29:17.350
Audio Time: 00:29:17.334

Here's my log including my settings
.
16:46:34.488: [NVENC encoder: 'recording_h264'] settings:
16:46:34.488: rate_control: CBR
16:46:34.488: bitrate: 50000
16:46:34.488: cqp: 0
16:46:34.488: keyint: 250
16:46:34.488: preset: default
16:46:34.488: profile: high
16:46:34.488: level: auto
16:46:34.488: width: 1280
16:46:34.488: height: 720
16:46:34.488: 2-pass: true
16:46:34.488: b-frames: 2
16:46:34.488: GPU: 0
16:46:34.488:
16:46:34.684: [Media Foundation AAC: 'Track1']: encoder created
16:46:34.684: bitrate: 192
16:46:34.684: channels: 2
16:46:34.684: sample rate: 48000
16:46:34.684: bits-per-sample: 16
16:46:34.684:
16:46:34.684: [Media Foundation AAC: 'Track2']: encoder created
16:46:34.684: bitrate: 192
16:46:34.684: channels: 2
16:46:34.684: sample rate: 48000
16:46:34.684: bits-per-sample: 16
16:46:34.684:
16:46:34.688: ==== Recording Start ===============================================
16:46:34.688: [ffmpeg muxer: 'adv_file_output'] Writing file 'D:/Youtube/Recordings/Bioshock Remastered/Recordings/Gameplay/2017-01-23 16-46-34.mp4'...
17:15:52.586: [ffmpeg muxer: 'adv_file_output'] Output of file 'D:/Youtube/Recordings/Bioshock Remastered/Recordings/Gameplay/2017-01-23 16-46-34.mp4' stopped
17:15:52.586: Output 'adv_file_output': stopping
17:15:52.586: Output 'adv_file_output': Total encoded frames: 105473
17:15:52.586: Output 'adv_file_output': Total drawn frames: 105474
17:15:52.586: Output 'adv_file_output': Number of skipped frames due to encoding lag: 7 (0.0%)
17:15:52.586: ==== Recording Stop ================================================

Also the issue also occurs when you only use a single audio.

Please let me know if I am doing something incorrectly.
Also I have attached a picture of the time difference from Vegas Pro 14.
 

Attachments

  • Capture.PNG
    Capture.PNG
    3.2 KB · Views: 61
@Frostbyte I think, that this is bytes per quad (subsampling quad 2x2 --> 96 bits = 3 channels * 8 bits * 4 pixels). Thus it shows 3 channels videos (no alpha) 4:2:0 as 6 bytes; 4:4:4 at 8 bits per channel as 12 bytes, 4:4:4 at 16 bits per channel as 24 bytes. Anyway, this info a bit strange because OBS Studio outputs (in your case):

Chroma subsampling - 4:2:0
Bit depth - 8 bits.​

Or it is completely different info.

Maybe editing software wrongly decodes the file stream? Your log shows only encoding lag at 1-7 frames. But the data still should be in sync.

I can get about 16ms length difference (Video longer than Audio, shown by MediaInfo) at 25 fps recordings. This is less than 1 frame (40ms for 25fps). This is usual behavior. And there is no sync issues in my recordings (that I can mark as significant). After drops, sound still in sync.

Try to remux videos. File>Remux Recordings then import. Or even try to decompress each audio track and import it uncompressed.

Edit: OK. Probably it is 12 bits per pixel (with 4:2:0 applied).
 
Last edited:
Back
Top