Streambuilder parameters¶
H.264 video encoding parameters¶
Parameters description
Parameter |
Description |
|---|---|
g |
Keyframe interval, also known as GOP (group of pictures) length. This determines the maximum distance between I-frames. Very high GOP lengths will result in slightly more efficient compression, but will make seeking in the video somewhat more difficult. Recommended default: 250 |
keyint_min |
Minimum GOP length, the minimum distance between I-frames. Recommended default: 25 |
sc_threshold |
Adjusts the sensitivity of x264’s scenecut detection. Rarely needs to be adjusted. Recommended default: 40 |
b |
Set bitrate in bits/s. Enables target bitrate mode. Attempts to reach a specific bitrate. Should be used in 2-pass mode whenever possible; 1-pass bitrate mode is generally the worst ratecontrol mode x264 has. |
bf |
B-frames are a core element of H.264 and are more efficient in H.264 than any previous standard. Some specific targets, such as HD-DVD and Blu-Ray, have limitations on the number of consecutive B-frames. Most, however, do not; as a result, there is rarely any negative effect to setting this to the maximum (16) since x264 will, if B-adapt is used, automatically choose the best number of B-frames anyways. This parameter simply serves to limit the max number of B-frames. Note that Baseline Profile, such as that used by iPods, does not support B-frames. (default: 16) |
b_strategy |
x264, by default, adaptively decides through a low-resolution lookahead the best number of B-frames to use. It is possible to disable this adaptivity; this is not recommended. Recommended default: 1 |
qmin |
Minimum quantizer scale. (default: 10) |
qmax |
Maximum quantizer scale. (default: 51) |
qdiff |
Maximum difference between quantizer scales. (default: 4) |
qblur |
Quantizer curve blur |
qcomp |
Quantizer curve compression factor |
refs |
Number of reference frames each P-frame can use. The range is from 0-16. |
sc_threshold |
Sets the threshold for the scene change detection. |
trellis |
Performs Trellis quantization to increase efficiency. Enabled by default. |
me_range |
Maximum range of the motion search in pixels. |
me_method |
Set motion estimation method. Possible values in the decreasing order of speed: dia, epzs, hex, umh, esa, tesa |
subq |
Sub-pixel motion estimation method. |
b_strategy |
Adaptive B-frame placement decision algorithm. Use only on first-pass. |
keyint_min |
Minimum GOP size. |
cmp |
Set full pixel motion estimation comparison algorithm. Possible values: chroma, sad. Ignore chroma in motion estimation. It generates the same effect as x264’s –no-chroma-me option. |
threads |
Number of encoding threads |
thread_type |
Set multithreading technique. Possible values: slice (Slice-based multithreading. It generates the same effect as x264’s –sliced-threads option.), frame (Frame-based multithreading.) |
flags |
Set encoding flags. It can be used to disable closed GOP and enable open GOP by setting it to -cgop. The result is similar to the behavior of x264’s –open-gop option. |
maxrate |
Specifies the maximum bitrate at any point in the video. Requires the VBV buffersize to be set. This option is generally used when encoding for a piece of hardware with bitrate limitations. |
bufsize |
Depends on the profile level of the video being encoded. Set only if you’re encoding for a hardware device. |
preset |
Set the encoding preset (ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo) (default “medium”) |
tune |
Tune the encoding params (film, animation, grain, stillimage, psnr, ssim, fastdecode, zerolatency) |
profile |
Set profile restrictions (baseline, main, high, high10, high422, high444) |
fastfirstpass |
Use fast settings when encoding first pass (default true) |
level |
Specify level (1, 1.1, 1.2, 1.3, 2, 2.1, 2.2, 3, 3.1, 3.2, 4, 4.1, 4.2, 5, 5.1) |
passlogfile |
Filename for 2 pass stats |
wpredp |
Weighted prediction for P-frames |
a53cc |
Use A53 Closed Captions (if available) (default true) |
crf |
Constant quality mode (also known as constant ratefactor). Bitrate corresponds approximately to that of constant quantizer, but gives better quality overall at little speed cost. The best one-pass option in x264. |
crf_max |
In CRF mode, prevents VBV from lowering quality beyond this point. (default -1) |
qp |
Constant quantization parameter rate control method (default -1) |
aq_mode |
AQ method (‘none (0)’, ‘variance (1)’, ‘autovariance (2)’) (default -1) |
aq_strength |
AQ strength. Reduces blocking and blurring in flat and textured areas. (default -1) |
psy |
Use psychovisual optimizations. (default auto) |
psy_rd |
Strength of psychovisual optimization, in <psy-rd>:<psy-trellis> format. |
rc_lookahead |
Number of frames to look ahead for frametype and ratecontrol (default -1) |
weightb |
Weighted prediction for B-frames. (default auto) |
weightp |
Weighted prediction analysis method. (‘none (0)’, ‘simple (1)’, ‘smart (2)’) (default -1) |
ssim |
Calculate and print SSIM stats. (default auto) |
intra_refresh |
Use Periodic Intra Refresh instead of IDR frames. (default auto) |
bluray_compat |
Bluray compatibility workarounds. (default auto) |
b_bias |
Influences how often B-frames are used (from INT_MIN to INT_MAX) (default INT_MIN) |
b_pyramid |
Keep some B-frames as references. (from -1 to INT_MAX) (default -1) |
mixed_refs |
One reference per partition, as opposed to one reference per macroblock (default auto) |
8x8dct |
High profile 8x8 transform. (default auto) |
fast_pskip |
(default auto) |
aud |
Use access unit delimiters. (default auto) |
mbtree |
Use macroblock tree ratecontrol. (default auto) |
deblock |
Loop filter parameters, in <alpha:beta> form. |
cplxblur |
Reduce fluctuations in QP (before curve compression) (default -1) |
partitions |
A comma-separated list of partitions to consider. Possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all |
direct_pred |
Direct MV prediction mode (from -1 to INT_MAX) (default -1) |
slice_max_size |
Limit the size of each slice in bytes (from -1 to INT_MAX) (default -1) |
stats |
Filename for 2 pass stats |
nal_hrd |
Signal HRD information (requires vbv-bufsize; cbr not allowed in .mp4) (from -1 to INT_MAX) (default -1) |
motion_est |
Set motion estimation method (from -1 to 4) (default -1) |
forced_idr |
Normally, when forcing a I-frame type, the encoder can select any type of I-frame. This option forces it to choose an IDR-frame. (default false) |
coder |
Coder type (from -1 to 1) (default -1) |
b_strategy |
Strategy to choose between I/P/B-frames (from -1 to 2) (default -1) |
chromaoffset |
QP difference between chroma and luma (from INT_MIN to INT_MAX) (default -1) |
sc_threshold |
Scene change threshold (from INT_MIN to INT_MAX) (default -1) |
noise_reduction |
Noise reduction (from INT_MIN to INT_MAX) (default -1) |
x264-params |
Override the x264 configuration using a :-separated list of key=value parameters |
User Datagram Protocol (UDP) options¶
The required syntax for an UDP URL is:
udp://hostname:port[?options]
options contains a list of &-separated options of the form key=val.
In case threading is enabled on the system, a circular buffer is used to store the incoming data, which allows one to reduce loss of data due to UDP socket buffer overruns. The fifo_size and overrun_nonfatal options are related to this buffer.
The list of supported options follows.
Option |
Description |
|---|---|
buffer_size=size |
Set the UDP maximum socket buffer size in bytes. This is used to set either the receive or send buffer size, depending on what the socket is used for. Default is 64KB. See also fifo_size. |
bitrate=bitrate |
If set to nonzero, the output will have the specified constant bitrate if the input has enough packets to sustain it. |
burst_bits=bits |
When using bitrate this specifies the maximum number of bits in packet bursts. |
localport=port |
Override the local UDP port to bind with. |
localaddr=addr |
Choose the local IP address. This is useful e.g. if sending multicast and the host has multiple interfaces, where the user can choose which interface to send on by specifying the IP address of that interface. |
pkt_size=size |
Set the size in bytes of UDP packets. |
reuse=1|0 |
Explicitly allow or disallow reusing UDP sockets. |
ttl=ttl |
Set the time to live value (for multicast only). |
connect=1|0 |
Initialize the UDP socket with connect(). In this case, the destination address can’t be changed with ff_udp_set_remote_url later. If the destination address isn’t known at the start, this option can be specified in ff_udp_set_remote_url, too. This allows finding out the source address for the packets with getsockname, and makes writes return with AVERROR(ECONNREFUSED) if “destination unreachable” is received. For receiving, this gives the benefit of only receiving packets from the specified peer address/port. |
sources=address[,address] |
Only receive packets sent to the multicast group from one of the specified sender IP addresses. |
block=address[,address] |
Ignore packets sent to the multicast group from the specified sender IP addresses. |
fifo_size=units |
Set the UDP receiving circular buffer size, expressed as a number of packets with size of 188 bytes. If not specified defaults to 7*4096. |
overrun_nonfatal=1|0 |
Survive in case of UDP receiving circular buffer overrun. Default value is 0. |
timeout=microseconds |
Set raise error timeout, expressed in microseconds. This option is only relevant in read mode: if no data arrived in more than this time interval, raise error. |
broadcast=1|0 |
Explicitly allow or disallow UDP broadcasting. Note that broadcasting may not work properly on networks having a broadcast storm protection. |
MPEGTS muxer options¶
Common extensions: ts, m2t, m2ts, mts.
Default video codec: mpeg2video.
Default audio codec: mp2.
Option |
Description |
|---|---|
mpegts_transport_stream_id |
Set transport_stream_id field. (from 1 to 65535) (default 1) |
mpegts_original_network_id |
Set original_network_id field. (from 1 to 65535) (default 65281) |
mpegts_service_id |
Set service_id field. (from 1 to 65535) (default 1) |
mpegts_service_type |
Set service_type field. (from 1 to 255) Values are: digital_tv, digital_radio, teletext, advanced_codec_digital_radio, mpeg2_digital_hdtv, advanced_codec_digital_sdtv, advanced_codec_digital_hdtv, hevc_digital_hdtv (default digital_tv) |
mpegts_pmt_start_pid |
Set the first pid of the PMT. (from 16 to 7936) (default 4096) |
mpegts_start_pid |
Set the first pid. (from 16 to 3840) (default 256) |
mpegts_m2ts_mode |
Enable m2ts mode. (default auto) |
muxrate |
Defined by MPEG-2 as the combined rate of all video and audio elementary stream packets common to one program. This rate also includes the VBI and sub-picture private stream data, which MPEG treats as a private stream type. (from 0 to INT_MAX) (default 1) |
pes_payload_size |
Minimum PES packet payload in bytes (from 0 to INT_MAX) (default 2930) |
mpegts_flags |
MPEG-TS muxing flags (default 0) |
resend_headers |
Reemit PAT/PMT before writing the next packet (from 0 to INT_MAX) (default 0) |
mpegts_copyts |
don’t offset dts/pts (default auto) |
tables_version |
set PAT, PMT and SDT version (from 0 to 31) (default 0) |
omit_video_pes_length |
Omit the PES packet length for video packets (default true) |
pcr_period |
PCR retransmission time in milliseconds (from 0 to INT_MAX) (default 20) |
pat_period |
PAT/PMT retransmission time limit in seconds (from 0 to INT_MAX) (default INT_MAX) |
sdt_period |
SDT retransmission time limit in seconds (from 0 to INT_MAX) (default INT_MAX) |
mpegts_flags values:
resend_headers Reemit PAT/PMT before writing the next packet
latm Use LATM packetization for AAC
pat_pmt_at_frames Reemit PAT and PMT at each video frame
system_b Conform to System B (DVB) instead of System A (ATSC)
initial_discontinuity Mark initial packets as discontinuous
Presets and profiles for encoders¶
libx264 codec¶
--preset <string> Use a preset to select encoding settings [medium]
Overridden by user settings.
- ultrafast:
--no-8x8dct --aq-mode 0 --b-adapt 0
--bframes 0 --no-cabac --no-deblock
--no-mbtree --me dia --no-mixed-refs
--partitions none --rc-lookahead 0 --ref 1
--scenecut 0 --subme 0 --trellis 0
--no-weightb --weightp 0
- superfast:
--no-mbtree --me dia --no-mixed-refs
--partitions i8x8,i4x4 --rc-lookahead 0
--ref 1 --subme 1 --trellis 0 --weightp 1
- veryfast:
--no-mixed-refs --rc-lookahead 10
--ref 1 --subme 2 --trellis 0 --weightp 1
- faster:
--no-mixed-refs --rc-lookahead 20
--ref 2 --subme 4 --weightp 1
- fast:
--rc-lookahead 30 --ref 2 --subme 6
--weightp 1
- medium:
Default settings apply.
- slow:
--direct auto --rc-lookahead 50 --ref 5
--subme 8 --trellis 2
- slower:
--b-adapt 2 --direct auto --me umh
--partitions all --rc-lookahead 60
--ref 8 --subme 9 --trellis 2
- veryslow:
--b-adapt 2 --bframes 8 --direct auto
--me umh --merange 24 --partitions all
--ref 16 --subme 10 --trellis 2
--rc-lookahead 60
- placebo:
--bframes 16 --b-adapt 2 --direct auto
--slow-firstpass --no-fast-pskip
--me tesa --merange 24 --partitions all
--rc-lookahead 60 --ref 16 --subme 11
--trellis 2
--profile <string> Force the limits of an H.264 profile
Overrides all settings.
- baseline:
--no-8x8dct --bframes 0 --no-cabac
--cqm flat --weightp 0
No interlaced.
No lossless.
- main:
--no-8x8dct --cqm flat
No lossless.
- high:
No lossless.
- high10:
No lossless.
Support for bit depth 8-10.
- high422:
No lossless.
Support for bit depth 8-10.
Support for 4:2:0/4:2:2 chroma subsampling.
- high444:
Support for bit depth 8-10.
Support for 4:2:0/4:2:2/4:4:4 chroma subsampling.
h264_qsv codec¶
-preset (from 1 to 7) (default medium)
veryfast
faster
fast
medium
slow
slower
veryslow
-profile (from 0 to INT_MAX) (default unknown)
unknown
baseline
main
high
h264_nvenc codec¶
-preset Set the encoding preset (from 0 to 11) (default medium)
default
slow hq 2 passes
medium hq 1 pass
fast hp 1 pass
hp
hq
bd
ll low latency
llhq low latency hq
llhp low latency hp
lossless
losslesshp
-profile Set the encoding profile (from 0 to 3) (default main)
baseline
main
high
high444p