Get butter smooth 60 fps (no buffering) with this guide!
This guide will work especially well for first person shooter games, where you have sudden movements and high motion scenes.
x264 was optimized for 24 fps medium motion cinematic video eg. Hollywood movies. So some of the default values are bad for high motion 60fps! This guide is aimed to fix those bad default values for more fluent video in high fps.
Basic settings:
Advanced settings:
Explanation of custom settings:
direct=temporal
bframes=1
qcomp=0.4
keyint-min=30
scenecut=20
threads=your cores minus one
Old stuff:
These settings below can be overridden with qcomp ratio, so use it instead.
ipratio=1
pbratio=1
1.5.2016
This guide will work especially well for first person shooter games, where you have sudden movements and high motion scenes.
x264 was optimized for 24 fps medium motion cinematic video eg. Hollywood movies. So some of the default values are bad for high motion 60fps! This guide is aimed to fix those bad default values for more fluent video in high fps.
Basic settings:
- Limit your game FPS to 60
- Uncheck CFR setting (constant frame rate)
- use default buffer size (same as bitrate)
- use game capture or window capture (monitor capture is slower than 60fps)
Advanced settings:
advanced encoding settings:
bframes=1 direct=temporal qcomp=0.4 keyint-min=30 scenecut=20 threads= your cores minus one
bframes=1 direct=temporal qcomp=0.4 keyint-min=30 scenecut=20 threads= your cores minus one
Explanation of custom settings:
direct=temporal
default=spatial
This is another motion estimation method compared to the spatial mode, but is more accurate when movement is changed every frame, like in high motion scenes. But this mode requires bframes to be set to 1.
This is another motion estimation method compared to the spatial mode, but is more accurate when movement is changed every frame, like in high motion scenes. But this mode requires bframes to be set to 1.
bframes=1
default=3
bframes are cheap frames, but are really bad in high motion scenes. having bframes set to one, will make playback requirements lower and make playback smoother at 60fps. But bframes are required in scenes where you are waiting for next high motion scene to come, as it saves bits for next high motion scene.
bframes are cheap frames, but are really bad in high motion scenes. having bframes set to one, will make playback requirements lower and make playback smoother at 60fps. But bframes are required in scenes where you are waiting for next high motion scene to come, as it saves bits for next high motion scene.
qcomp=0.4
default=0.6
Is the amplitude how much bitrate can vary, so if you do 360 no scope turn with default value, you are going to eat all the buffer in less than half a second. Lowering this value will make bit-rate distribution smoother over given period of time... This value will lower image quality, but will add more consistent quality in case of high movement, like you would expect in FPS game. Lowest you should try is 0.2 any below that will just destroy the benefit making quality look always bad.
Guide Update Note: Since this parameter will make bit-rate more smooth when lowered, we do not need the ipratio and pbratio values to be set anymore.
Is the amplitude how much bitrate can vary, so if you do 360 no scope turn with default value, you are going to eat all the buffer in less than half a second. Lowering this value will make bit-rate distribution smoother over given period of time... This value will lower image quality, but will add more consistent quality in case of high movement, like you would expect in FPS game. Lowest you should try is 0.2 any below that will just destroy the benefit making quality look always bad.
Guide Update Note: Since this parameter will make bit-rate more smooth when lowered, we do not need the ipratio and pbratio values to be set anymore.
keyint-min=30
default=12
This setting limits how often IDR frame can be placed. Place it too often and you waste resources.
This setting limits how often IDR frame can be placed. Place it too often and you waste resources.
scenecut=20
default=40
Many times in high motion first person 180degree turns the normal x264 algorithm will detect multiple scenecuts = complete refresh of image... what will cause stuttery playback in high motion scenes. Wasting good encoding and playback resources for nothing... This setting will limit how easy it is to detect complete scenecut. So that 180 or 360 turns will look smoother.
NOTE: if you have big STATIC INTERFACE like in dota2, keep this setting as default, otherwise scenecut will not be detected even if whole screen of the game changes and interface will remain the same.
Many times in high motion first person 180degree turns the normal x264 algorithm will detect multiple scenecuts = complete refresh of image... what will cause stuttery playback in high motion scenes. Wasting good encoding and playback resources for nothing... This setting will limit how easy it is to detect complete scenecut. So that 180 or 360 turns will look smoother.
NOTE: if you have big STATIC INTERFACE like in dota2, keep this setting as default, otherwise scenecut will not be detected even if whole screen of the game changes and interface will remain the same.
threads=your cores minus one
default=your cores times 1.5
Example: I have 8 cores, and detected threads are 1.5 times 8 ... eg 12 ... + 2 lookahead threads. But this will cause unnecessary context switches when there are no need for those. Especially when this value is based on encoding, not encoding AND playing with same computer. So we reserve one core for the game and other cores have thread for encoding. This will make encoding even smoother because timing between encoded frames are smaller, because of the race condition between competing threads.
Example: I have 8 cores, and detected threads are 1.5 times 8 ... eg 12 ... + 2 lookahead threads. But this will cause unnecessary context switches when there are no need for those. Especially when this value is based on encoding, not encoding AND playing with same computer. So we reserve one core for the game and other cores have thread for encoding. This will make encoding even smoother because timing between encoded frames are smaller, because of the race condition between competing threads.
Old stuff:
These settings below can be overridden with qcomp ratio, so use it instead.
ipratio=1
default=1.4
Called as large key frame.
If you have 60fps and large buffer size, this 1.4 ratio will cause IDR frames to take 90% of all bitrate you have, thus the game looks super crisp every time IDR frame is placed, but quality suffers from movement. ... Setting this to OLD default 1, will cause the bits to be distributed more evenly between the IDR frames, so high motion frames will get bigger P frames. Also affects scenecut initiated I-frames. But we still want to reserver those bits NOT for still image, but for MOTION!
Called as large key frame.
If you have 60fps and large buffer size, this 1.4 ratio will cause IDR frames to take 90% of all bitrate you have, thus the game looks super crisp every time IDR frame is placed, but quality suffers from movement. ... Setting this to OLD default 1, will cause the bits to be distributed more evenly between the IDR frames, so high motion frames will get bigger P frames. Also affects scenecut initiated I-frames. But we still want to reserver those bits NOT for still image, but for MOTION!
pbratio=1
default=1.3
Same as above, by default bframes are considered as "cheap" frames, but in high motion games this is not the case, so we boost the bframes aswell, because we don't want any stuttery feeling even small motion scenes.
Changelog:Same as above, by default bframes are considered as "cheap" frames, but in high motion games this is not the case, so we boost the bframes aswell, because we don't want any stuttery feeling even small motion scenes.
1.5.2016
- removed ipratio and pbratio
- added qcomp
- added qcomp