x264 Command Line Arguments

Technical assistance & information for projects
Post Reply
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

x264 Command Line Arguments

Post by Neo » Wed Jan 13, 2010 1:48 pm

Code: Select all

x264 core:49
Syntax: x264 [options] -o outfile infile [widthxheight]

Infile can be raw YUV 4:2:0 (in which case resolution is required),
  or YUV4MPEG 4:2:0 (*.y4m),
  or AVI or Avisynth if compiled with AVIS support (no).
Outfile type is selected by filename:
 .264 -> Raw bytestream
 .mkv -> Matroska
 .mp4 -> MP4 if compiled with GPAC support (yes)

Options:

  -h, --help                  List the more commonly used options
      --longhelp              List all options

Frame-type options:

  -I, --keyint <integer>      Maximum GOP size [250]
  -b, --bframes <integer>     Number of B-frames between I and P [0]
      --b-pyramid             Keep some B-frames as references
      --no-cabac              Disable CABAC
  -r, --ref <integer>         Number of reference frames [1]
  -f, --filter <alpha:beta>   Loop filter AlphaC0 and Beta parameters [0:0]

Ratecontrol:

  -q, --qp <integer>          Set QP (0=lossless) [26]
  -B, --bitrate <integer>     Set bitrate (kbit/s)
      --crf <integer>         Quality-based VBR (nominal QP)
      --vbv-bufsize <integer> Enable CBR and set size of the VBV buffer (kbit) [0]
      --ratetol <float>       Allowed variance of average bitrate [1.0]
      --ipratio <float>       QP factor between I and P [1.40]
      --pbratio <float>       QP factor between P and B [1.30]

  -p, --pass <1|2|3>          Enable multipass ratecontrol
                                  - 1: First pass, creates stats file
                                  - 2: Last pass, does not overwrite stats file
                                  - 3: Nth pass, overwrites stats file
      --stats <string>        Filename for 2 pass stats ["x264_2pass.log"]
      --qcomp <float>         QP curve compression: 0.0 => CBR, 1.0 => CQP [0.60]
      --zones <zone0>/<zone1>/...  Tweak the bitrate of some regions of the video

Analysis:

  -A, --analyse <string>      Partitions to consider ["p8x8,b8x8,i8x8,i4x4"]
                                  - p8x8, p4x4, b8x8, i8x8, i4x4
                                  - none, all
                                  (p4x4 requires p8x8. i8x8 requires --8x8dct.)
      --direct <string>       Direct MV prediction mode ["spatial"]
                                  - none, spatial, temporal, auto
  -w, --weightb               Weighted prediction for B-frames
      --me <string>           Integer pixel motion estimation method ["hex"]
                                  - dia, hex, umh
      --merange <integer>     Maximum motion vector search range [16]
  -m, --subme <integer>       Subpixel motion estimation and partition
                                  decision quality: 1=fast, 7=best. [5]
      --b-rdo                 RD based mode decision for B-frames. Requires subme 6.
      --mixed-refs            Decide references on a per partition basis
  -8, --8x8dct                Adaptive spatial transform size
  -t, --trellis <integer>     Trellis RD quantization. Requires CABAC. [0]
                                  - 0: disabled
                                  - 1: enabled only on the final encode of a MB
                                  - 2: enabled on all mode decisions
      --no-fast-pskip         Disables early SKIP detection on P-frames
      --no-dct-decimate       Disables coefficient thresholding on P-frames
      --nr <integer>          Noise reduction [0]
      --cqmfile <string>      Read custom quant matrices from a JM-compatible file

Input/Output:

  -o, --output                Specify output file
      --sar width:height      Specify Sample Aspect Ratio
      --fps <float|rational>  Specify framerate
      --seek <integer>        First frame to encode
      --frames <integer>      Maximum number of frames to encode
      --level <string>        Specify level (as defined by Annex A)

  -v, --verbose               Print stats for each frame
      --progress              Show a progress indicator while encoding
      --quiet                 Quiet Mode
      --no-psnr               Disable PSNR computation
      --threads <integer>     Parallel encoding (uses slices)
      --thread-input          Run Avisynth in its own thread
Download this version of x264.
x264.zip
(229.56 KiB) Downloaded 529 times
Sample command line:

Code: Select all

x264.exe --frames 114 -B 8000 --fps 25 -o dest.mp4 source.mpg 720x576
Mysoogal
Captain
Captain
Posts: 223
Joined: Thu Dec 17, 2009 7:15 am
Location: Planet VPS

Re: x264 Command Line Arguments

Post by Mysoogal » Thu Oct 07, 2010 6:01 am

goes nicely with my power-shell post :mrgreen:
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: x264 Command Line Arguments

Post by Neo » Thu Oct 07, 2010 10:16 am

Good to hear that. Would you mind sharing the script here :D
Mysoogal
Captain
Captain
Posts: 223
Joined: Thu Dec 17, 2009 7:15 am
Location: Planet VPS

Re: x264 Command Line Arguments

Post by Mysoogal » Fri Oct 08, 2010 11:07 am

yes its located here, with info how to use :mrgreen:

https://robot.lk/viewtopic.php?f=12&p=4348#p4348
Post Reply

Return to “Project Assistance”