Interesting YouTube article. I'm going to try to explain this in detail because I have seen people asking before.
But yeah, like
R1CH said, you can just record to MKV or FLV to have a streamable file format.
However, if you want to use MP4 there's a key part mentioned on the YouTube article:
Container: MP4
* moov atom at the front of the file (Fast Start)
This is not normally how the file is created. This needs to be done in a second pass after the recording is done.
The
moov atom is like a file index that contains all the necessary info to play the file and is normally placed at the end of the file. This is why we never recommend recording straight to MP4 from OBS, because if something happens during recording, the footage will be unplayable.
So you see, the problem for YouTube is that if they cannot read the index (moov atom) they have to wait for you to finish the upload completely before it starts getting processed.
How do you fix it?
For new recordings you can just add this to your custom muxer settings: movflags=faststart
However, this will make it take longer than normal to stop the recording due to the extra step, but shouldn't be more than a few seconds. But again, this is not the recommended way to record.
Remuxing from within OBS from one container to MP4 does not (currently) do this extra step.
If you record to MKV or FLV and want to remux to MP4 with "faststart" you can download
ffmpeg and run this:
Code:
ffmpeg.exe -i recording.mkv -c copy -movflags faststart youtube.mp4
You will see in the output that it says:
- Starting second pass: moving the moov atom to the beginning of the file
Now, let's really go hard with this reply and go through the video codec section as well... :)
Video codec: H.264
* Progressive scan (no interlacing)
* High Profile
* 2 consecutive B frames
* Closed GOP. GOP of half the frame rate.
* CABAC
* Variable bitrate. No bitrate limit required, though we offer recommended bit rates below for reference
* Chroma subsampling: 4:2:0
* Progressive scan (no interlacing)
This is default. There is no built-in option in OBS to make it interlaced.
* High Profile
This can be selected if you switch to Advanced output.
* 2 consecutive B frames
This can be set with a custom encoder option (for x264)
bframes=2
For NVENC you can just set the B-frames option to 2
* Closed GOP. GOP of half the frame rate.
Closed GOP is default. It can be set with custom option
open_gop=0 but it is already set by default.
GOP of half the frame rate is kind of crazy. It means every 0.5 sec which is lower than what can be set with the OBS UI, so you can set it in frame numbers with
keyint=30 (if you are recording at 60 fps).
And here's an extra note on that; x264 will try to detect when the picture has changed enough to warrant a new keyframe. This is normally good for your quality, but if we want to keep a set 30 frame interval we can set
scenecut=0
For NVENC this cannot be done. You have to set it to 1 second keyframe interval.
*
CABAC
This is default. However, if you use the low cpu option in the simple output it will be disabled (because it uses the ultrafast preset).
* Variable bitrate
Self explanatory. Just anything other than CBR. Stick to CRF for x264 or CQP for NVENC.
* Chroma subsampling: 4:2:0
This is default. Stick to NV12 which is default in OBS.
The recording window would look something like this with custom muxer and custom encoder settings:
The other settings don't have to look the way I have mine, obviously ^^
However, I should say, pretty much anything you do with these encoder settings should affect YouTube's ability to read the file. Only the first thing with the moov atom should actually matter. I would recommend that you keep what you have and you're happy with.
I just felt like doing a write up ^^ Happy recording.
Feel free to shoot back any questions.