Problem with hanging when "stopping recording" of MP4 file

Hi,
New OBS user. I see that this has been reported before going back 4 years or so. But those cases seemed to have insufficient PC power.
As others have reported, OBS hangs while showing "stopping recording". Multiple clicks don't do anything. Exiting OBS leaves it running in the background. Have to kill it with Task Manager. In my case, the resulting MP4 (which I can view after killing OBS) has only a few seconds of recording in it. So OBS got in trouble early on.

Here is my log file: https://obsproject.com/logs/ya5wR7As8YWy3wey

I know the standard advice is to record in MKV and remux to MP4. However I'd prefer not to do this because my old VHS movie conversion files are 5 GB in size, and that's significant extra storage and processing time. But more importantly, the remux fails: the resulting MP4 is half the size and is filled with artifacts and is unviewable.

I am able to record MKV files just fine. CPU and GPU usage hover under 30 % and 40% respectively for MKV recordings, and around 20% during MP4 recording.

In my log file, the red flags I can see are the plug-in and dll warnings. I'm not sure what these mean and wonder if I have a corrupted installation. Can you comment on this, please?

I'm aware of the problems that can happen when recording directly to MP4. But these problem occurrences should be rare if OBS were operating as well as it does when recording to MKV. Worst case scenario would be that I would need to restart my 90 minute recording once in a great while. Currently, I'm recording to MKV, and then do an ffmpeg copy to add an MP4 wrapper. It works, but is an extra step I'd like to avoid if I can.

So my 2nd question is: does OBS truly support recording directly to MP4? If it's known to not work at all, then I'll stick with my workaround. But if it is supposed to work, then I'd like to see if I can make it work. Any advice would be appreciated.

Thanks,
Dennis
 

konsolenritter

Active Member
Did you pushed "Stop recording" instead (or before) quitting the OBS? Look, the button changes from "start recording" to "stop...".
 

koala

Active Member
OBS is perfectly able to record to mp4. Your log file shows no relevant error. Recording to mp4 versus recording to mkv should not make any difference during recording. CPU usage is exactly the same. If you can record to mkv, you should be able to record to mp4. If you cannot, there is something else different between the recording sessions.

One issue I saw in your logfile:
You record with 60 fps, while your capture device only outputs 30 fps. You should match both fps. Recording with 60 fps while the source is only 30 fps, wastes encoding resources and disk space. If you record VHS material, you need to deinterlace. If your capture card is deinterlacing, 30 fps output from the capture device is ok, but if you want OBS or your postprocessing to deinterlace, you need to read 60 fps from the capture device.

Your logfile is incomplete, probably because it is the one where you killed OBS. Make another test recording and post that log file here. It's important to see the full logfile, because it contains important information. The symptom you describe (unable to stop recording) is usually a sign of encoder overload, and this can be seen in the log file after finishing a recording.

If the internal remux of OBS is creating an incomplete mp4, then there is some issue during creation of the mkv. If you remux manually with ffmpeg, this issue may be covered, but the video material itself is probably not as good as it could. This initial broken creation of files is the core issue you have and you should try to solve - remuxing manually with ffmpeg or trying to directly record to mp4 is only working around issues that should not be there in the first place.

Expected and common is the following behavior:
You're recording to mkv, and OBS is remuxing after the recording to mp4, no error is reported, and both files contain the same length of video.
 
Thanks for your very helpful reply, @koala.
You set me on the right path when you mentioned that my capture device was putting out 30 FPS. I should have noticed that but failed to do so.
Switching to recording at 30 FPS (29.97) fixed all the MP4-related problems with no loss of picture quality:
1) Remux from MKV to MP4 now works as expected.
2) Recording directly to MP4 also works properly.
3) A problem I forgot to mention was that the ffmpeg copy I was using to add an MP4 wrapper to the MKV file used to give a slew of errors like this: "[mp4 @ 000002329d358300] Non-monotonous DTS in output stream 0:0; previous: 1072, current: 1072; changing to 1073. This may result in incorrect timestamps in the output file."
These have now gone away completely when I do an ffmpeg copy on a 30 FPS recording.

So you were right that there was something wrong with the MKV file.

Let me know if you want any more information about the error case I initially reported. I'm not sure I can produce a full log file in the scenario where OBS hangs.

For now, I'll start looking into deinterlacing. I need to find out if my capture device (a composite-video-(plus audio)-to-USB converter) is deinterlacing or not. And I may want to do reverse telecine on my commercial tapes of movies released in theaters.

Thanks again.
Dennis
 

koala

Active Member
It seems your GPU isn't powerful enough to encode 60 fps. Which makes me scratching my head. You use Quicksync for encoding, so you're using the GPU for encoding, and since you don't run a graphics-intensive game in parallel but instead just read video data from a capture card, your GPU should be able to fully dedicate all resources to encoding. Are you running other graphics intensive stuff at the same time? Try to not use that.

If you want to record with 60 fps, which is what you need if you want to deinterlace with OBS or a postprocessing tool, it might be worth to test x264 (software) as encoder. May be it can run that resolution without encoder overload, if you don't run any other CPU-intensive app in parallel.

The fffmpeg convert doesn't add a "wrapper". It changes the container. The envelope. It's as if someone takes mail letters out of their envelope, throws away the old envelope, and puts them into a new envelope without actually reading the letter. The content is exactly the same, only a new envelope, and the old envelope is gone.

The error message says there are duplicated frames in the original video - a sign of encoder overload, as I suspected. The encoder needs to drop frames to keep up, and OBS outputs the previous frame again, which can be seen as stutter or jumpy (not smooth) video.
If you see the encoder overload warning in OBS, don't ignore this. It's a sign of frames left out of the video, so you don't have a full copy of every frame of your vhs video.
 
Thanks, as always, for the helpful reply. My apologies for the delayed response, but a health issue intervened.
I will try the software encoder as you suggested to see if I can encode at 60 fps in preparation for de-interlacing.
Best,
Dennis
 
Top