D
Deleted member 27089
Note: This mainly applies to 60fps capture. Haven't tested it with 30fps, but I never noticed a major problem in the past.
The first part including a demonstration video can be found in this thread. In was posted in the help section because I was unsure if I was making an error or not. But I did a few more tests and I'm 99% sure it's a problem with OBS.
First the data.
I made a capture of a constantly moving object. Twice with OBS/NVENC, once vsync on, once off. I repeated the same with Shadowplay, This gave me 4 videos.
Then I loaded a bunch of frames into Photoshop and overlaid them so you can see where the object is in the frame.
First up: Shadowplay with vsync on:
As you can see by the dark edge appearing at uniform distances the frames are captured in a constant and consistent order. There is one missing animation frame in the middle, noticable by the gap. If I would've included more frames you would be able to see that this won't happen in the remaining movement while the object passes the screen. I also checked for duplicate frames. There are none. If I forward through the motion frame by frame, there is only this one gap where the object jumps twice as far, but without any duplicate frames.
Now, OBS/NVENC with vsync on:
As you can see the motion wasn't capture fluidly by the frames in the video. Often the captured frames miss one of the animation frames resulting in jumps twice the step size of the object. At the same time there are many duplicate frames. This is shown with the animation. I lowered the "fill" of the layers. Single frames appear lighter in one picture of the animation. Duplicate frames appear darker.
If you want to see the effect in motion, see the video in the thread I linked above.
So, now to the explanation I came up with. I'm not saying this is the correct explanation, but I think it helps to understand the problem.
In a perfect capture (top arrows) the frame displayed and the frame captured are in sync. This is happening more or less with Shadowplay. There is always some error, of course, as can be seen with the missing animation frame.
But what "seems" to happen in OBS? A possible explanation is that OBS captures the frame at a time close to the swapping of the frame buffer and the time between screen grabs jitters. If the frame is captured earlier the frame buffer hasn't swapped to the next frame yet and we get a duplicate. Since we still need to get 60fps on average the time between other frame grabs will eventually be longer than 1/60s and two frame buffer swaps have past resulting in a missed frame of the animation.
This happens with NVENC or x264 capture. It doesn't matter if I change to high performance, low bitrate, low quality etc. Certainly I haven't permutated through all the possible combinations of settings, but this shouldn't happen in the first place. All tests with other screen grabbing software left me only with the conclusion that it's a problem of OBS.
Caveat: One thing that doesn't fit into my explanation is the result with vsync off. I expect the animation to be somewhat smoother, because at about 300fps the frame should've been swapped 5 times between captures. Even if the movement of the object isn't captured at a constant pace, the captured distances should be more or less the same, maybe deviate by 1/5 or 2/5 of a step. Instead I still get huge differences in captured movement distance in the frames. And, what I definitely didn't expect, OBS still has duplicate frames in the capture.
I didn't animate this to highlight the duplicate frames, but they are there.
For this to happen the jitter can't be small compared to a frame length at 60fps, it has be huge, practically up to the length of 1/60s. Or there is another severe error in the way the frames are captured.
Shadowplay without vsync:
Well.... if only Shadowplay wouldn't use bt.601 as the color matrix. *sad face*
https://gist.github.com/af5382410e8703e0cbf0
The first part including a demonstration video can be found in this thread. In was posted in the help section because I was unsure if I was making an error or not. But I did a few more tests and I'm 99% sure it's a problem with OBS.
First the data.
I made a capture of a constantly moving object. Twice with OBS/NVENC, once vsync on, once off. I repeated the same with Shadowplay, This gave me 4 videos.
Then I loaded a bunch of frames into Photoshop and overlaid them so you can see where the object is in the frame.
First up: Shadowplay with vsync on:
As you can see by the dark edge appearing at uniform distances the frames are captured in a constant and consistent order. There is one missing animation frame in the middle, noticable by the gap. If I would've included more frames you would be able to see that this won't happen in the remaining movement while the object passes the screen. I also checked for duplicate frames. There are none. If I forward through the motion frame by frame, there is only this one gap where the object jumps twice as far, but without any duplicate frames.
Now, OBS/NVENC with vsync on:
As you can see the motion wasn't capture fluidly by the frames in the video. Often the captured frames miss one of the animation frames resulting in jumps twice the step size of the object. At the same time there are many duplicate frames. This is shown with the animation. I lowered the "fill" of the layers. Single frames appear lighter in one picture of the animation. Duplicate frames appear darker.
If you want to see the effect in motion, see the video in the thread I linked above.
So, now to the explanation I came up with. I'm not saying this is the correct explanation, but I think it helps to understand the problem.
In a perfect capture (top arrows) the frame displayed and the frame captured are in sync. This is happening more or less with Shadowplay. There is always some error, of course, as can be seen with the missing animation frame.
But what "seems" to happen in OBS? A possible explanation is that OBS captures the frame at a time close to the swapping of the frame buffer and the time between screen grabs jitters. If the frame is captured earlier the frame buffer hasn't swapped to the next frame yet and we get a duplicate. Since we still need to get 60fps on average the time between other frame grabs will eventually be longer than 1/60s and two frame buffer swaps have past resulting in a missed frame of the animation.
This happens with NVENC or x264 capture. It doesn't matter if I change to high performance, low bitrate, low quality etc. Certainly I haven't permutated through all the possible combinations of settings, but this shouldn't happen in the first place. All tests with other screen grabbing software left me only with the conclusion that it's a problem of OBS.
Caveat: One thing that doesn't fit into my explanation is the result with vsync off. I expect the animation to be somewhat smoother, because at about 300fps the frame should've been swapped 5 times between captures. Even if the movement of the object isn't captured at a constant pace, the captured distances should be more or less the same, maybe deviate by 1/5 or 2/5 of a step. Instead I still get huge differences in captured movement distance in the frames. And, what I definitely didn't expect, OBS still has duplicate frames in the capture.
I didn't animate this to highlight the duplicate frames, but they are there.
For this to happen the jitter can't be small compared to a frame length at 60fps, it has be huge, practically up to the length of 1/60s. Or there is another severe error in the way the frames are captured.
Shadowplay without vsync:
Well.... if only Shadowplay wouldn't use bt.601 as the color matrix. *sad face*
https://gist.github.com/af5382410e8703e0cbf0
Last edited by a moderator: