What -preset medium stand for in ffmpeg
preset is a private option that may be defined for an encoder, such as libx264. It is a shorthand method to set a whole bunch of options at once, and won't have any effect if set when using an encoder which doesn't define them.



When using x264 to encode to H.264 with preset medium, these are the arguments set:

cabac=1
ref=3
deblock=1:0:0
analyse=0x3:0x113
me=hex
subme=7
psy=1
psy_rd=1.00:0.00
mixed_ref=1
me_range=16
chroma_me=1
trellis=1
8x8dct=1
cqm=0
deadzone=21,11
fast_pskip=1
chroma_qp_offset=-2
threads=12
lookahead_threads=2
sliced_threads=0
nr=0
decimate=1
interlaced=0
bluray_compat=0
constrained_intra=0
bframes=3
b_pyramid=2
b_adapt=1
b_bias=0
direct=1
weightb=1
open_gop=0
weightp=2
keyint=250
keyint_min=25
scenecut=40
intra_refresh=0
rc_lookahead=40
rc=crf
mbtree=1
crf=23.0
qcomp=0.60
qpmin=0
qpmax=69
qpstep=4
ip_ratio=1.40
aq=1:1.00


The default preset is medium. You can override any of the individual variables by adding -x264-params key1=value:key2=value after the preset option. But you shouldn't unless you need to.