Unpausing a recording results in termination of the recording
Operating System Info
Ubuntu 20.04
Other OS
No response
OBS Studio Version
28.0.1
OBS Studio Version (Other)
No response
OBS Studio Log URL
https://obsproject.com/logs/BtkLzneQvpMxmZmk
OBS Studio Crash Log URL
No response
Expected Behavior
Pausing a recording, for any length of time, and subsequently unpausing, should resume the recording.
Current Behavior
Pausing for any longer than 5 seconds results in the attached error dialog, and termination of the recording. This is a regression, and did not happen prior to upgrade to 28.0.1.

Steps to Reproduce
- Open OBS and start recording
- Pause the recording
- Wait at least 5 seconds, then unpause
Anything else we should know?
This does not seem to be Linux-specific - see the forum report here from a Windows user. Not sure if it is confined to h.264.
Update: pausing and unpausing multiple times also triggers the bug, as soon as the total pause duration exceeds 5s. So two 3s pauses will do it.
It seems that this doesnt require lossless or i444 like I originally thought. In 28, setting color range to full while using h264 + ffmpeg scaling(doesnt occur on obs h264), a +5 second pause will trigger https://obsproject.com/logs/BAzphhhki_l8u9Wf
This seems to be a regression because on 27, using the same settings(full color range + ffmepg h264), a +5 second pause has no issue https://obsproject.com/logs/NHFPHxs_x7wiKvcL
If you have replay buffer enabled, it will also break the replay buffer control button on 28(note in the first log link, replay buffer was never started)

In response to my findings that MattyFresh68 provided, I have yet to test whether this is the case on stream. If the stream stops due to the above error in the first post, color range would be irrelevant. If it doesn't persist, we know what caused this bug.
In response to my findings that MattyFresh68 provided, I have yet to test whether this is the case on stream. If the stream stops due to the above error in the first post, color range would be irrelevant. If it doesn't persist, we know what caused this bug.
The issue is either caused by FFmpeg or Full Color Range, although I believe it to be the color range as I am still using Rescaling under the Output tab in settings, which falls back to ffmpeg as far as I am aware.
It's definitely a problem caused by using FFmpeg. I've had streams get cut off because of GPU stalls since upgrading to OBS 28, and I tested the same settings on a local recording just now and can replicate the issue with the pause recording function. Never been an issue in previous OBS versions.
I'm on Windows, 1440p canvas rescaled down to 720p stream. NV12 colour format, with limited colour range.
Full log from the test: https://obsproject.com/logs/K4z5HRTn7sJlCzjx
FWIW this issue does not occur on macOS with either x264 or VideoToolbox encoding - I tried output with rescaling, limited/full colour ranges, both encoders, no issues in any case.
Does this occur on Windows/Linux with x264 or non-NVidia encoders as well?
The error is issued by ffmpeg_video_encode() in obs-ffmpeg-video-encoders.c only. The only change in that file since V27 that deals with the timestamps being checked is https://github.com/obsproject/obs-studio/commit/8bb03a1136d06088c0cacca3bead58a33b100633
The error is issued, if the difference between cur_ts and av_pkt.pts + enc->start_ts gets too big, but here ends my knowledge, since I don't know when av_pkt.pts and enc->start_ts are actually updated and to what timestamps. May be just a type conversion/integer truncation issue with 64-bit introduced by the commit, although it explicitly tried to avoid this.
Just to confirm, what exactly was the last version this was not an issue? 27.2.4? Or was this introduced in 28.0 to 28.0.1? Knowing last known good version will help with a bisect to understand what might have changed.
I can reproduce the error by:
- advanced output mode
- nvenc h.264 or nvenc hevc
- force fallback to ffmpeg by setting "rescale output" to 1280x720 while having output resolution still at 1920x1080
- start recording, pause recording for more than 5 seconds, resume recording
Happens for me for all 28 versions. I tested them all starting with 28.0.0 beta 1, up to 28.0.1. Doesn't happen with x264 or Quicksync or jim-nvenc (disable rescaling in encoder). Doesn't happen with 27.2.4.
ALL HAIL!