Advanced x264 settings streamers should know

Advanced x264 settings streamers should know

At the moment the OBS developers do not recommend any advanced x264 settings because they think the default settings are good as is. However, there are a couple of advanced settings I do think streamers should be aware of, since tweaking them could make a huge difference for some.

The first setting I would like to introduce to streamers is the direct setting, which handles prediction modes for motion vectors.
This setting has three modes: spatial (default), temporal and none. If you are someone who plays alot of first person shooters on your stream, I would definitely recommend you changing this setting to none.

"Why?" you might ask.

Direct in its default mode will try to predict movements in the picture, and these predictions will be used to draw some parts of a frame. However, due to the nature of first person shooters, movements will often be very sudden and very unpredictable, wich will cause the encoder to make errors.

mv prediction.jpg

This screenshot from a twitch stream will show you the most common prediction error I come across, which causes multiple crosshairs being drawn in some frames.
To fix this issue just type direct=none in the advanced x264 settings. You will trade a small loss of picture quality for better picture accuracy. However, depending on what games you are streaming that trade might not be necessary.
Some of you might have never noticed this phenomenon since it seem to mostly occur, or get more visible, when the video bitrate is starved—which leads us to the next x264 setting.

The second setting I would like to introduce is deblock.
Now, you might have seen a stream where the picture quality is so terrible all you see is block artifacts, or "a bunch of giant pixels" as I sometimes hear people describe it, "and this despite the 1920x1080 resolution". Well, first and foremost, this has very little to do with the resolution, as I'm sure most experienced streamers are aware of. This actually happens because the video bitrate is starved. The encoder needs to collect more data to draw higher quality frames, but the streamer has restricted the video bitrate to something too low. In this case the most obvious solution to the problem would be to raise the video bitrate.

"Where are you going with this? Just tell me what deblock is already!"

Alright! Deblock work as a sort of filter that blurs out the edges of block artifacts, making the picture look cleaner. In a case such as the one I described previously, this setting wouldn't make any good difference. But for someone who only has a bit of visible block artifacts, this might be just what you are looking for.
There are two parameters to set, alpha deblock (strength) and beta deblock (threshold). The default setting is deblock=0:0. So if you try to raise these parameters to e.g. deblock=3:3 (maximum recommended values) you will definitely see all of these artifacts get blurred out. The only drawback is that if the beta deblock parameter is too high, the encoder might identify other things in the frame as block artifacts and blur them out too. And you wouldn't want too high alpha deblock either, since it could look too blurry. What you want is a good balance between the two.
I've been using the parameters deblock=1:1, and that has been working fine for me. But you might have to experiment a little bit to find the sweet spot.

That's all, folks! I hope this information has been helpful. Otherwise writing this has been a huge waste of time.
First release
Last update
0.00 star(s) 0 ratings

Latest updates

  1. Update 2019-02-19

    Corrected some grammar, and rewrote the second part to give a more detailed explaination. Also...