How to split recording into X mins with Y frames overlap

FrankW24

New Member
Hello,

I have a question. Sometimes, I record long sessions over an hour and would like to split videos into say 15 mins segments.

I understand there is an option for that but I'd like to add extra frames before and after each segment. I understand it sounds silly but the problem is OBS Studio do not always sync video with audio. It's not a problem to sync a trimmed standalone footage as we have enough extra frames. The problem is automatically split segments lack of that. If one of the segments is out of sync I don't have room to correct them.

Is there any plugin I could use for that? Perhaps I could create a simple script but don't even know where I would start. I know both Python and Lua, so programming language would not be a problem.

Cheers!
 

AaronD

Active Member
So during the overlap, you're recording the same content to two files at the same time?

Or, can you tweak the Sync Offset in the Advanced Audio Properties, to align it so you don't have this problem? If the de-sync is variable, then the answer is probably no, but if it's constant, then it might be yes.
 

FrankW24

New Member
So during the overlap, you're recording the same content to two files at the same time?
Yes, that would be the case.

Overlap would provide extra frames (or audio smaples) to slide video parts forward/backward. By default OBS just split videos, which obviously makes sense. However, if audio is desynced, I can only make silent gaps to sync audio streams. There is a way to go around it and make gaps "unnoticable" in a video editor but it's somewhat cumbersome. It would be a lot easier with extra frames.

can you tweak the Sync Offset in the Advanced Audio Properties, to align it so you don't have this problem?
It was the first thing I tried. However, it seems de-sync is random, at least I haven't noticed any pattern.
 

AaronD

Active Member
Sounds to me like the de-sync is the real problem, and an overlap is just a band-aid. It might still be useful, but the more "correct" solution would be to fix the de-sync.

Even so, I'd think a simple de-sync would still be unnoticeable once you put the two recordings end-to-end. The abrupt end of one lines up exactly with the abrupt start of the next, and you're good, even if the audio is off, because what should have been at the end of one is at the start of the other or vice-versa. Right?

Or does the sync drift that far during each recording segment *and* reset for each split? That would be an important clue.

---

Looking at a different possibility as well, what source(s) have the random sync? Cheap USB captures are known to do that, along with some other problems...
 

FrankW24

New Member
Sounds to me like the de-sync is the real problem, and an overlap is just a band-aid. It might still be useful, but the more "correct" solution would be to fix the de-sync.

Even so, I'd think a simple de-sync would still be unnoticeable once you put the two recordings end-to-end. The abrupt end of one lines up exactly with the abrupt start of the next, and you're good, even if the audio is off, because what should have been at the end of one is at the start of the other or vice-versa. Right?

Or does the sync drift that far during each recording segment *and* reset for each split? That would be an important clue.

Thanks for your response.

De-sync is the problem, indeed, however I can't figure out what could be causing it and this is why I ask for this extraordinary workaround. It worth mentioning that there is one particular game, and only one so far, which I experience abrupt FPS drops and stutters with. And this is when all that de-sync occurs. First, I think this might cause de-sync between audio and video and might also be a reason why the offset is different.
 

rockbottom

Active Member
Based on your last post, sounds to me like your rig is being pushed too hard & is overloaded.

FPS drops > stutters > de-sync

Could also be settings, drivers or something else all together but no log, no service.

Run a recording until it falls on it's face & then stop. Close/re-open OBS & then post the previous log.
 

FrankW24

New Member
Based on your last post, sounds to me like your rig is being pushed too hard & is overloaded.

FPS drops > stutters > de-sync

Could also be settings, drivers or something else all together but no log, no service.

Run a recording until it falls on it's face & then stop. Close/re-open OBS & then post the previous log.

High Rockbottom,

I did two short recordings and attached two files. The first log should contain small stutters, however in the other one should have a log with a big stutter that occurred at the end of a video.

Thanks
 

Attachments

  • 2024-09-10 10-41-37.txt
    21.9 KB · Views: 4
  • 2024-09-10 09-56-47.txt
    43.4 KB · Views: 4

rockbottom

Active Member
Your set-up looks good overall. Game DVR should be disabled & your main monitor is @ 59HZ, set it @ 60HZ if possible.

I have no idea what your anti-virus is doing, I only run Defender. Test with it disabled.
10:41:37.242: COMODO Antivirus: enabled (AV)
10:41:37.242: COMODO Firewall: enabled (FW)
10:41:37.242: Windows Firewall: enabled (FW)

Is v-sync in play? Type? Fast doesn't work with some games.

Try limiting the frame-rate of your games/reduce quality if the lag persists.
 

rockbottom

Active Member
10:41 log, perfect test. Rendering lag is GPU overload, here's your skip at the end of the recording..

10:42:01.595: ==== Recording Start ===============================================
10:42:01.595: [ffmpeg muxer: 'adv_file_output'] Writing file 'D:/Videos/Elden Ring/2024-09-10 10-42-01.mkv'...
10:43:12.598: Stopping recording due to hotkey
10:43:12.926: [ffmpeg muxer: 'adv_file_output'] Output of file 'D:/Videos/Elden Ring/2024-09-10 10-42-01.mkv' stopped
10:43:12.926: Output 'adv_file_output': stopping
10:43:12.926: Output 'adv_file_output': Total frames output: 4261
10:43:12.926: Output 'adv_file_output': Total drawn frames: 4263 (4280 attempted)
10:43:12.926: Output 'adv_file_output': Number of lagged frames due to rendering lag/stalls: 17 (0.4%)
10:43:12.927: ==== Recording Stop ================================================
10:43:12.927: Video stopped, number of skipped frames due to encoding lag: 17/4278 (0.4%)
 

FrankW24

New Member
Hello again,

I am glad it looks good overall :) Here are some comments:
* I turned DVR off
* I can't find V-Sync setting in the game. NVidia Settings is currently set to Use 3D app. Other available options are On, Adaptive, Adaptive (Half Fresh Rate), Fast
*
I turned off COMODO Firewall but haven't noticed any difference.
* Monitors are set to 60Hz, I don't know why it reports 59Hz
* There does not seem to be setting for FPS. I'll look again because If I could reduce it and get rid of stutters that would perfect.

I have a question regarding V-Syn, should I change it to anything or disabled it? I changed quality settings for a better performance in GeForceExperience, because it kind of takes over game settings.

Overall, I made a few changes and did a test. I had only 2 frames dropped out of 6000. I think that's a progress :)

Finally, thanks for your comments, I can see I have some room to make adjustments in case it falls again. Cheers!
 

rockbottom

Active Member
I use fast v-sync but like I said, it doesn't work with certain games & there's other considerations.

In the Nvidia Control Panel, turn v-sync On. You will also need to enable Triple Buffering. If you do try Fast v-sync later, Triple Buffering should be disabled.

Sucks, there may be accumulation errors do to the slight refresh rate variance between monitors.

Eliminating the 4k > 2k downscale will reduce the load on the GPU. Run that Sammy & OBS @ 4k. Downscale in post if you must.
 

rockbottom

Active Member
Sounds like you already changed Texture Filter-Quality to Performance or HP. Should be able to set it back to Q.

Here's some other settings I use in the Nvidia Control Panel (3090):
Max Frame Rate - Off
Monitor Tech - Fixed Refresh
Preferred Refresh Rate - Highest Available

Almost everything else is Off
 

rockbottom

Active Member
I see why you were setting the Sammy @ 2k when capturing ER. Your set-up will struggle to maintain 60FPS @ 4k even when the game is at the lowest setting. I would still give it a try & see how bad it is. Don't know until you try.
 
Top