Zolja007

New Member
Trying to figure out the best possible quality to 0 buffer experience for the viewer. Anyone got ideas?

My settings, for Facebook Live:

x264
CBR
Bitrate 9k
Keyframe 2
CPU Slow
Profile High
Tune Film

My goal is to keep the best quality and have close to no buffer for the viewer when streaming at 9k bitrate... I figured with the "Use custom buffer size" button on and maybe having it at double the size? so Bitrate at 9k and Buffer size at 18k. Don't know if that would work.

Let me know please!!
 

JasonPlays

New Member
this may be late, or maybe you already know more than me by now ( nearly 2 months later )

using a custom buffer size can be beneficial, but only going down not up. Larger buffer size gives your stream more variance with upload and thus better quality. The issues will crop up if you do not have transcoding on a stream.

For example: If I am streaming with a 5k bitrate and I try to use a 5k buffer then that will allow OBS to increase or decrease by that buffer number. So if I am playing a fast paced FPS game then OBS will actually go above my 5k limit to keep quality higher. It uses the buffer as "permission" so it thinks it can go above the bitrate by the number of the buffer. On the other hand if I am streaming something very slow paced with little to no movement ( face cam only video ) then OBS will keep the bitrate lower because you don't need high bitrate.


I hope that makes sense. The issues you will run into are people watching the stream. If there is no transcoding, such as on Twitch, then they will have more issues with a higher buffer vs lower buffer.


Transcoding lets the viewer pick their resolution ( 1080p or 720p or 480p etc ) so someone with a slower internet connection can select a lower resolution and watch with little to no buffering. Most platforms have transcoding, so people can choose what resolution they want to watch.


Twitch specifically will only use transcoding for preferred streamers, so not everyone will have transcoding on their streams. So, with Twitch specifically and maybe other platforms, you want your stream to have little to no change in bitrate. When your bitrate goes up and down it causes buffering because your viewers have to "catch up" to your bitrate.

So, long detailed explanation short, a higher buffer will make your stream look better, but at the cost of more loading / buffering on the viewers screens. A smaller buffer is more stable / less loading and buffering for viewers but you will lose some quality.

This will not matter if your bitrate is already good enough. So streaming a 1080p video with a 20k bitrate will look amazing with no buffer at all, but will be crazy hard to do depending on your internet speeds, stability, etc. Buffers are great, but most people don't need to use a custom buffer. By default OBS will have a 1 second buffer built in, you can adjust it lower for better stability at potentially lower quality. Or you can increase it for worse stability but better quality. Streaming only of course, recording video locally is totally different.
 
Trying to figure out the best possible quality to 0 buffer experience for the viewer. Anyone got ideas?

My settings, for Facebook Live:

x264
CBR
Bitrate 9k
Keyframe 2
CPU Slow
Profile High
Tune Film

My goal is to keep the best quality and have close to no buffer for the viewer when streaming at 9k bitrate... I figured with the "Use custom buffer size" button on and maybe having it at double the size? so Bitrate at 9k and Buffer size at 18k. Don't know if that would work.

Let me know please!!

I stream several days a week to YouTube @ 1080P/60 with the Ultra-Low latency setting in the YouTube backend. Here's a link to my latest livestream https://www.youtube.com/watch?v=0_jtyCL4BSo . I've never tried the custom buffer size and it sounds like I should leave it alone.

1666731438317.png


OF NOTE: Frame rendering speed should be your biggest concern with the MacStudio ultra. The GPU is leveraged for frame rendering and preview display in OBS and it's FAR from optimized. OBS on it's own can easily consume > 60% of your GPU. Add in overhead for the OS and additional apps and the GPU can easily be saturated. Once frame rendering exceeds 13ms, you will lose the ability to maintain 60fps.
 

attaboyBrad

Member
OF NOTE: Frame rendering speed should be your biggest concern with the MacStudio ultra. The GPU is leveraged for frame rendering and preview display in OBS and it's FAR from optimized. OBS on it's own can easily consume > 60% of your GPU. Add in overhead for the OS and additional apps and the GPU can easily be saturated. Once frame rendering exceeds 13ms, you will lose the ability to maintain 60fps.
I see you mentioned using the x264 encoder in place of the Apple hardware encoder on another thread. Doing this quadrupled my CPU usage (a whole 20% instead of 5% on M1 Ultra, 2160p60 with CRF at 60%), but definitely stabilized my frame render time as well.

Do you have any other suggestions for how to mitigate the lack of GPU optimization? It would seem that rendering a fast-scrolling PDF with a bunch of filters in 2022 is like running Crysis in 2005.
 

archimac

New Member
Are you saying that using Apple Hardware encoding on the M1 is better than x264? Are you running the native ARM OBS? Since the M1 does not have a dedicated video memory or card - would it be better to use more CPU or less (like the ultrafast setting)?
 

attaboyBrad

Member
Are you saying that using Apple Hardware encoding on the M1 is better than x264? Are you running the native ARM OBS? Since the M1 does not have a dedicated video memory or card - would it be better to use more CPU or less (like the ultrafast setting)?
Not sure if this was addressed to me, but "better" between x264 and Hardware VT will depend on the tradeoffs with your particular system. If your rendering is GPU bottlenecked, using x264 should transfer some weight from your GPU to your CPU--which could be helpful provided your CPU can handle that workload. On the other hand, if you found yourself CPU bottlenecked with x264 you could use Hardware VT to shift workload from your CPU onto specialized parts of your GPU.

Typically, hardware encoding should be massively faster than anything your CPU can manage, but @thomaslfessler was suggesting that in the case of M1-native OBS 28, putting that additional workload on the GPU might saturate the GPUs ability to process data, leading to an unacceptable rate of dropped frames.

I also understand that, at some point in the past, software encoding was viewed as capable of producing higher quality output than hardware encoding, but I don't know if that's changed as dedicated hardware has improved--I suspect it either has changed or the difference has narrowed.

Personally, I'm still A/B testing x264 vs Hardware VT for my particular workflow and haven't found an obvious winner yet due to other bugs confounding my attempts at a fair comparison.
 

archimac

New Member
I appreciate the feedback. Are you testing exclusively on the M1? I am torn between getting a 27" intel iMac which has an AMD graphics card or an M1 Mac Mini. Both are around the same price. I was thinking the encoding on the iMac would be of better quality by using the graphics card for encoding instead of x264?
 
I see you mentioned using the x264 encoder in place of the Apple hardware encoder on another thread. Doing this quadrupled my CPU usage (a whole 20% instead of 5% on M1 Ultra, 2160p60 with CRF at 60%), but definitely stabilized my frame render time as well.

Do you have any other suggestions for how to mitigate the lack of GPU optimization? It would seem that rendering a fast-scrolling PDF with a bunch of filters in 2022 is like running Crysis in 2005.

Use SwitchResX to display a non-scaled image to your 4k Monitor.
Limit the number of display's you are using.
Each preview window increases GPU load. use sparingly.
Load activity monitor to observe system resources, especially GPU.
Use the renice terminal command to give OBS highest task priority.

When OBS is running and streaming to youtube, with a blackmagic Ultra Studio video capture, along with Chrome for web and video content, Chromium for VDO Ninja guest platform, Quicktime, and other apps, my GPU is running ~90% capacity. My CPU cores are BUSY, with some headroom.

Another reason I use x264 is because it supports the i444 color profile. The color profiles supported by the Apple VT Hardware encoder, including NV12, has a bug on MacOS that over saturates the red channel. While OBS warns of additional CPU overhead, I'll take the extra resource hit VS poor color conversion.
 

attaboyBrad

Member
The color profiles supported by the Apple VT Hardware encoder, including NV12, has a bug on MacOS that over saturates the red channel.
This could explain why my nose and lips were looking so freaking red! I thought maybe it was just chilly when I streamed or something, but I looked basically like Rudolph in Red Lipstick and I thought I'd calibrated everything pretty well.

Good suggestions all around. Thanks.
 

Zolja007

New Member
this may be late, or maybe you already know more than me by now ( nearly 2 months later )

using a custom buffer size can be beneficial, but only going down not up. Larger buffer size gives your stream more variance with upload and thus better quality. The issues will crop up if you do not have transcoding on a stream.

For example: If I am streaming with a 5k bitrate and I try to use a 5k buffer then that will allow OBS to increase or decrease by that buffer number. So if I am playing a fast paced FPS game then OBS will actually go above my 5k limit to keep quality higher. It uses the buffer as "permission" so it thinks it can go above the bitrate by the number of the buffer. On the other hand if I am streaming something very slow paced with little to no movement ( face cam only video ) then OBS will keep the bitrate lower because you don't need high bitrate.


I hope that makes sense. The issues you will run into are people watching the stream. If there is no transcoding, such as on Twitch, then they will have more issues with a higher buffer vs lower buffer.


Transcoding lets the viewer pick their resolution ( 1080p or 720p or 480p etc ) so someone with a slower internet connection can select a lower resolution and watch with little to no buffering. Most platforms have transcoding, so people can choose what resolution they want to watch.


Twitch specifically will only use transcoding for preferred streamers, so not everyone will have transcoding on their streams. So, with Twitch specifically and maybe other platforms, you want your stream to have little to no change in bitrate. When your bitrate goes up and down it causes buffering because your viewers have to "catch up" to your bitrate.

So, long detailed explanation short, a higher buffer will make your stream look better, but at the cost of more loading / buffering on the viewers screens. A smaller buffer is more stable / less loading and buffering for viewers but you will lose some quality.

This will not matter if your bitrate is already good enough. So streaming a 1080p video with a 20k bitrate will look amazing with no buffer at all, but will be crazy hard to do depending on your internet speeds, stability, etc. Buffers are great, but most people don't need to use a custom buffer. By default OBS will have a 1 second buffer built in, you can adjust it lower for better stability at potentially lower quality. Or you can increase it for worse stability but better quality. Streaming only of course, recording video locally is totally different.
Makes perfect sense. Thank you for taking your time in explaining all this. I mostly stream on Facebook, and I do believe it has transcoding? I'm not 100% sure but I'll check (if I find that info). I know that while people are "live" I myself am able to change the resolution, or the phone itself chooses the "best" resolution it can run steadily. However, I don't know if my page has that or if this is a "everyone can use it if you go live" kinda scenario. I'll have to do some digging.

Either way thank you for your explanation!
 
Top