http://mewiki.project357.com/wiki/X264_Settings
1. preset
--preset veryslow --bframes 3 --ref 5 --rc-lookahead 120
2. tune
--tune fastdecode ( --no-cabac --no-deblock --no-weightb --weightp 0).
3.
The number of reference frames is controlled by x264's ref option. It's the number of frames in the Decoded Picture Buffer.
Note: there is a minimum DPB size which depends on b-frame settings.
- b-frames enabled and b-pyramid normal -> 4
- b-frames enabled and b-pyramid strict -> 3
- b-frames enabled and b-pyramid none -> 2
- b-frames disabled -> 1
If you request a lower ref value, there will still be that many frames in the DPB (e.g. as reported by MediaInfo).
As I understand it, however, x264 will not place more references than requested in the DPB.
x264 Presets
x264 exposes a preset and tune system. Presets range from:
UltraFast
Placebo
Typically, it's recommended to use the Very Fast to Slow settings range for best results, or one of the slower options if you don't mind the speed loss. Medium is a good balance and most of HandBrakes presets use this option.
x264 Tunes
The x264 tune options assign some additional options which will optimize theencoder for certain types of content.
If you are unsure or your content doesn't really fit into one of the followingtunes, you can simply leave this option at "None".
H.264 Profile
H.264 profiles define the features / capabilities that the encoder can use.
HandBrake exposes 3 profiles for H.264 Encodes. You can think of the profile as the level of complexity required in encode /decode. The higher the complexity, the more CPU power is needed to encode/decode. Setting a profile, constrains the encode to using settings that are allowed for that profile level.
Typically, devices will advertise that they are compatible for a particular profile and level, so you can simply set the option that matches your device for the best chance of compatibility.
Note that setting a profile does not mean your encoded file will end up being that profile. It simply prevents options being used that would breach that profile constraint.
H.264 Levels
The levels are another form of constraints that define things like maximum bitrates, framerates and resolution etc. The wikipedia article lists the relevant information for each level.http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels
Most devices (and sometimes, software decoders) support a "maximum" level. When the video's specifications exceed that level's constraints, the decoder won't be able to decode the video properly (it may simply refuse to play the file).
HandBrake's H.264 encoder, x264, sets the appropriate level automatically based on all the other settings. To make sure your video doesn't exceed a specific level, you simply have to make sure the other parameters fit within the constraints imposed by the level.
It is recommended that you leave this setting on "Auto" unless you require to set it for device compatibility.
For a more detailed guide, see https://forum.handbrake.fr/viewtopic.php?f=6&t=19368