title: How to set ReFrames in ffmpeg?
body: <p>I tried to set the ReFrames to 3 using the above command, but the output shown by MediaInfo is always ReFrames = 4 frames.</p>
  
  <p>I also tried <code>"-x264opts ref=3"</code>, but still the ReFrames is always 4.
  How to set this using the right ffmpeg option?</p>
  
  <p><code>ffmpeg -ss 00:00:00.000 -t 00:00:18.000 -i /input -ss 00:00:18.001 -t 00:00:35.000 -i /media/C4_TCODEIN01/dmt-201/IN_C1XE7MCO-EXCELLENCECREME_6036330 -filter_complex "[0:v:0]crop=out_h=576:y=32,yadif=1:-1:0[part1crop]; [1:v:0]crop=out_h=576:y=32,yadif=1:-1:0[part2crop];[part1crop][0:a:0] [part2crop][1:a:0]concat=n=2:v=1:a=1[vconcat][aconcat]" -map '[vconcat]' -codec:v libx264 -profile:v High -level 4.1 -coder 1 -pix_fmt yuv420p -video_track_timescale 25 -r 25 -s:v 1920x1080 -aspect 16:9 -x264-params "cabac=1:no-deblock=0:ref=3:weightp=2:chroma_qp_offset=0:keyint=50:keyint_min=5:bframes=3:b_pyramid=2:b-adapt=2:subme=7:b_bias=0:direct=1:weightb=1:open_gop=0:scenecut=40:nal-hrd=vbr:bitrate=15000:vbv_maxrate=22500:vbv-bufsize=30000:threads=7:lookahead_threads=1" -map '[aconcat]' -codec:a libfdk_aac -ac 2 -b:a 192K -write_tmcd off /media/OUT_24.mp4</code></p>
  
  <p>Media Info:</p>
  
  <pre><code>Format                                   : MPEG-4
  Format profile                           : Base Media
  Codec ID                                 : isom (isom/iso2/avc1/mp41)
  File size                                : 54.9 MiB
  Duration                                 : 35 s 80 ms
  Overall bit rate mode                    : Variable
  Overall bit rate                         : 13.1 Mb/s
  Writing application                      : Lavf57.56.101
  
  Video
  ID                                       : 1
  Format                                   : AVC
  Format/Info                              : Advanced Video Codec
  Format profile                           : High@L4.1
  Format settings                          : CABAC / 4 Ref Frames
  Format settings, CABAC                   : Yes
  Format settings, Reference frames        : 4 frames
  Codec ID                                 : avc1
  Codec ID/Info                            : Advanced Video Coding
  Duration                                 : 35 s 80 ms
  Bit rate mode                            : Variable
  Bit rate                                 : 12.9 Mb/s
  Nominal bit rate                         : 15.0 Mb/s
  Maximum bit rate                         : 22.5 Mb/s
  Width                                    : 1 920 pixels
  Height                                   : 1 080 pixels
  Display aspect ratio                     : 16:9
  Frame rate mode                          : Constant
  Frame rate                               : 25.000 FPS
  Color space                              : YUV
  Chroma subsampling                       : 4:2:0
  Bit depth                                : 8 bits
  Scan type                                : Progressive
  Bits/(Pixel*Frame)                       : 0.250
  Stream size                              : 54.1 MiB (98%)
  Writing library                          : x264 core 148
  Encoding settings                        : 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=7 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=50 / keyint_min=5 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=15000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=22500 / vbv_bufsize=30000 / nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:1.00
  Codec configuration box                  : avcC
  
  Audio
  ID                                       : 2
  Format                                   : AAC LC
  Format/Info                              : Advanced Audio Codec Low Complexity
  Codec ID                                 : mp4a-40-2
  Duration                                 : 35 s 42 ms
  Duration_LastFrame                       : -9 ms
  Bit rate mode                            : Constant
  Bit rate                                 : 192 kb/s
  Channel(s)                               : 2 channels
  Channel layout                           : L R
  Sampling rate                            : 48.0 kHz
  Frame rate                               : 46.875 FPS (1024 SPF)
  Compression mode                         : Lossy
  Stream size                              : 822 KiB (1%)
  Default                                  : Yes
  Alternate group                          : 1
  </code></pre>