Question / Help Cannot stream and record at the same time

janprusak

New Member
Hi,
today I have configured OBS MP for recording (20Mbps) and streaming (2Mbps).
But I can not stream and record at the same time.
If I start streaming I can not press the record button even if I stop streaming.
To start recording I have to restart OBS MP, but then the problem is reversed that I can not start streaming.
Is that a known bug or do I have something set wrong?

Log https://gist.github.com/anonymous/b8aceb1afb7b6e9cf27d
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
I am actually quite baffled - I just tested it just now to see if I could replicate but didn't get the same issue. Your settings however feel quite unusual. 20000 bitrate? Perhaps you should try settings tailored to recording: ignore bitrate, use a custom buffer size set to 0, turn off CBR, set CRF to 16.
 

janprusak

New Member
I have been fiddling with it in the past days and have discovered that in Output mode Simple I can stream and record at the same time. But that is both with the low bitrate (completely insufficient for my 2560*1440 monitor while playing games with fast changing picture).
But as I change Output mode to Advanced, there goes the ability to streram and record simultaneously.

As you instructed I ignored the bitrate (left it at 20.000) changed buffer to use it and have it at 0, turned off CBR and set CRF to 16. But there is no change. Even if I change the bitrate to be the same 2.000 as the stream is, no streaming and recording fo me.

My solution at this time is streaming in OBS MP and recording at high bitrate with OBS, but there is no webcam in the recording as it is used by OBS MP in the stream.

(To be honest I have no idea what that buffer or CRF is...)
 

Anonanon

Member
To be honest I have no idea what that buffer or CRF is...
There are two ways to control how good your stream looks.

The first method called CBR is to set how much network data you want to send (ie 2000 kbps) and the image quality becomes the varying factor.

The second method called CRF is to set your desired image quality you want (ie 0 is lossless, 18 is pretty good, 23 is reasonable) and the amount of network data sent becomes the varying factor.

If you are streaming to Twitch, you want to use CBR to ensure you are delivering a constant, stable stream of bitrate so you don't overwhelm some viewers who have less than stellar connections.

If you are recording locally to hard drive, you want to use CRF to ensure your footage always maintain a consistent quality.
 
ie 0 is lossless

crf=0 isn't the most lossless you can get. You want to set the quantizer to 0 for that (add "qp=0" to x264 options). The difference isn't big though.

The way this works is that x264 uses a quantizer, which is a value that says how "lossy" an image is. CRF sets the average quantizer, so crf=14 will you a low quantizer for a non-moving scene, but can get more lossy for higher motion scenes. Directly setting a quantizer disables the CRF system, and forces x264 to always encode at the same level of lossyness (lossless in this case).

I'm not fully sure what setting the buffer to 0 does either, but from my understanding a buffer of "0" means an infinite bitrate limit, allowing x264 to reach as high a bitrate as it may need to produce a lossless image. I personally just set the bitrate to 100000, which is usually wont hit anyway.
 

goldenh

New Member
If you want to be sneaky, you can try screencapping OBS MP from OBS and grab the webcam (I reccomend vice versa, since you want the higher quality webcam footage in the recording, of course).
 

Jack0r

The Helping Squad
@janprusak: could you get us a screenshot of your streaming and recording settings (when in advanced mode)?
I think we should really find out why you cant do streaming and recording at the same time.
Or to be more exact, why you get: [x264 encoder: 'streaming_h264'] x264 failed to load
Maybe the screenshots will give us a hint.
 

janprusak

New Member
1.jpg
2.jpg
3.jpg
 
I have an idea why things might not be working for you... a constant bitrate of 20000 is pretty insane. It's okay if you're recording in CBR, but for streaming that's literally 6 times as much as twitch says is the maximum. Also, an audio bitrate of more than 128 is hardly ever necessary. AAC is efficient enough to encode in good quality at that bitrate. (I use 96 myself, but might switch to 128 in the future)

Also, you haven't selected a profile. Maybe that's confusing the encoder? I'd recommend using high in your case.
 

janprusak

New Member
The 20.000kbps was a mistake, I use it at 2.000 and record at 20.000. Already corrected.

I tried audio at 128kbps, CBR for recording, streaming+recording profile at high (no idea what that means). Still not possible to record and stream at the same time.
 
Last edited:
Twitch also wants you to use a keyframe interval of 2 for streaming, forgot to mention that.

Also, profiles define what advanced encoding features x264 is allowed to use. The reason for this is that every encoding feature needs to be decoded on the other end (heavily simplifying of course), and some older devices can't decode anything beyond "main". However today nearly all devices support high either natively or once appropriate updates are made (to drivers and/or video player software), so there's no point in using main. Youtube prefers high for recordings also.

Have you tried running two seperate instances of OBS MP (one for just streaming, and one for just recording) instead of streaming and recording in the same? Not really a solution to your problem, but if it works you could use it as a temporary fix until we figure out what's keeping you from recording and streaming in the same OBS MP.
 

Jack0r

The Helping Squad
I think I could reproduce your problem now. Getting a slightly different error though:
[x264 encoder: 'streaming_h264'] encode failed
Error encoding with encoder 'streaming_h264'
Called profile end with mismatching name: start("do_encode"[691419B8]) <-> end("receive_video"[691419C4])

Changing from 2560x1440 to my normal desktop resolution of 1080p removed that error. I will ask Jim if he can take another look at the problem.
 
Nice catch Jack0r, I hadn't even realized janprusak was using such a high resolution. It's possible OBS just isn't built for resolutions above 1080.

@janprusak: Does recording/streaming in 1080 work for you? If so that might work.
 

janprusak

New Member
@WilliamBarrows
I can stream at 2560*1440 with no problem. I can do the same with recording. But not both at the same time. At this time I stream with OBS MP and record it with OBS, that works.


@Jack0r
Great findings about the resolution incompatibility.
When I set both the streaming and recording to rescale to 1920*1080, then it works.

So I guess there is some software bug in OBS MP that does not allow resolutions above FullHD to both stream and record simultaneously.
(I even tried recsaling streaming to FullHD and recording in original 2540*1440, but that still does not work).

Honestly I could live with streaming rescaled to lower resolution, but I need to record in the original resolution.

It would be great if you could look into this.



These are my current settings.
1.jpg
2.jpg
3.jpg
 
Have you tried rescaling streaming to 720p and recording in 1440p? 1080p is relatively high for livestreaming anyway, especially if you re-upload in higher quality later (which I assume the 1440p is for).
 
Top