Options in more detail - HelpSeeker/Restricted-WebM GitHub Wiki

Common options

Option Description
-h, --help Print the help text.
-q, --quiet Suppress non-error output by the script. This option has no influence on FFmpeg's verbosity (see --ffmpeg-verbosity to change it).
-v, --verbose Output verbose information. This option will print all settings, including those which are only accessible by editing the script. For each file it will output the general (i.e. doesn't change for different attempts) FFmpeg settings and for each attempt it will print the video/filter settings as well as the current, last and best output size.
-a, --audio Enable audio output. All present input audio streams will be used. This option has no effect if there's no input audio. If possible input audio streams get copied rather than reencoded.
-s, --size SIZE Set the output size limit in MB (default: 3).
-f, --filters FILTERS Use custom FFmpeg filters. See FFmpeg's documentation for more details. Using scale will disable automatic downscaling and fps will disable automatic frame rate reduction. This option will reduce the encoding performance as it introduces an additional demuxing/muxing step.
-p, --passes {1,2} Set the amount of passes for libvpx (default 2). 2-pass encoding should be preferred as it allows for a better bitrate control and a more consistent quality. There are two exceptions to this rule. For very low bitrates (<200-300Kbps in my experience) and to avoid this error single pass encoding should be preferred.
-u, --undershoot RATIO Set min. output file size. The min. size gets specified as percentage of the max. output size (e.g. 75% of 3MB or 95% of 10MB). Accepts values from 0-1 (default: 0.75). 0 disables the min. size limit, 1 would require the script to exactly hit the max. size limit (which is pretty much impossible). Values up to 0.95 should cause no problems. Everything above will potentially lead to a lot more encoding attempts for a minimal gain.
-i, --iterations ITER Set the amount of iterations (encoding attempts) per bitrate mode (default: 3). There are three bitrate modes (VBR + qmax, VBR and CBR) and an enhance loop, which uses the same amount of iterations. Therefore the script is by default limited to 12 encoding attempts per input video. In practice it is very unlikely to need that many attempts though.
-t, --threads THREADS Specify the number of threads to use for video encoding (default: 1). Using more than a single thread will lead to slightly worse results due to libvpx only offering tile-based multithreading. In general libvpx handles multithreaded encoding rather poorly. Although it depends on your hardware and output resolution, don't expect more than 50-80% CPU usage even under ideal conditions.
-ss, --start TIME Start encoding the input at the specified timecode. Supports FFmpeg time syntax as input (except negative values). If the time specified with this option exceeds the duration of the input, then both start and end time are ignored (i.e. the input gets converted in its full length).
-to, --end TIME Stop encoding the input at the specified timecode. Supports FFmpeg time syntax as input (except negative values). If the time specified with this option exceeds the duration of the input, then the end time is ignored. A potential start time will still be used.
-fs, --force-stereo Force all output audio streams to have 2 channels. This can help improve the output quality by sacrificing surround sound configurations and reducing the bitrate needed for such audio streams in the process. Please note that forcing stereo is not always desirable (e.g. mono input audio).
-bf, --basic-format Using this option will discard all audio streams, except the first one, to produce an output file with one video and one audio stream.

Subtitle options

Option Description
--subtitles Enable subtitle support. This will map all input subtitles tracks and convert text-based input subtitles to WebVTT. In case of image-based subtitles the input file will either be entirely skipped or MKV will be used as fallback container (see --mkv-fallback). With --burn-subs enabled only the initial mapping of input subtitles will be done, while the output gets suppressed.
--mkv-fallback Image-based subtitles can't be easily converted to text-based subtitles. If this flag is set, the output container will be changed to MKV in order to allow copying these problematic subtitles.
--burn-subs Discard soft subtitles after the user burns them into the video (via one of many possible filters). This will prevent unnecessary subtitles tracks in the output. This option implies --subtitles and because of the lack of subtitle output, makes the usage of --mkv-fallback unnecessary.

Advanced video options

Option Description
--vp9 Switch to VP9 as video coding format. VP9 is the successor of VP8. It offers a much better compression for low bitrates as well as support for some features VP8 is lacking (e.g. additional color spaces). The main drawback is its slower encoding speed and potential lack of support. Please note that this script doesn't offer any way to utilize VP9's lossless compression, as it would go against the goals of this script.
--crf Use libvpx's constrained quality mode for bitrate distribution instead of VBR. This may lead to a slightly better and more consistent quality at the cost of a less predictable output size. It can lead to more encoding attempts and/or a worse quality, if it prevents the script from fully utilizing the given size limit (e.g. 3.6MB output with --crf vs. 3.9MB output without).
--no-qmax Skip the first bitrate mode (VBR + qmax). This can reduce the encoding time for difficult input (low size limit, long duration or hectic movement), where the minimum quality set by qmax is likely to exceed the size limit by itself.
--bpp BPP Specify the target bpp (bits per pixel) value (default: 0.075). This value is used as a (very crude) measurement for the output quality. Higher values will result in a better quality. The output height and frame rate will be reduced to reach this target value (unless custom user filters or other thresholds prevent it). Personally I wouldn't go lower than 0.01 and higher than 0.1, although it depends on the input footage. Hectic scenes need a higher bpp value to look as good as calm scenes. 0.04 is often a good compromise between resolution/frame rate and quality for low size limits.
--transparency Enable alpha channel for the output (libvpx allows transparency for chroma subsampled VP8/VP9). This may be useful when converting animated GIFs to WebM. Please be aware that there is a bug when using an alpha channel with 2-pass encoding. The option itself is a shortcut for --pix-fmt yuva420p. To avoid confusion it takes precedence over --pix-fmt and will overwrite its color space if specified afterwards. The opposite case (--pix-fmt overwriting --transparency) will throw an error.
--pix-fmt FORMAT Use the specified color space (default: yuv420p). In case of VP8 encoding, you can specify yuv420p or yuva420p (same as --transparency). VP9, however, supports are far larger range of possible color spaces as well as bit depths (see ffmpeg -h encoder=libvpx-vp9 for a complete list).
--min-height HEIGHT The script may downscale the output automatically to ensure a certain quality. This option allows to specify a min. output height (default: 240). This threshold can't be used to upscale the input (you need to use a custom FFmpeg filter via -f/--filters for that). Very high thresholds (i.e. larger than or equal the input height) will therefore force the input resolution to remain unchanged.
--max-height HEIGHT Another (optional) height threshold. This option will set the max. output resolution and may be used to force further downscaling.
--min-fps FPS The script may reduce the frame rate of the output to ensure a certain quality. This option allows to specify a min. output height (default: 24). This threshold can't be used to increase the frame rate of the input (you need to use a custom FFmpeg filter via -f/--filters for that). High thresholds (i.e. larger than or equal the input frame rate) will therefore force the input frame rate to remain unchanged.
--max-fps FPS Another (optional) frame rate threshold. This option will set the max. frame rate and may be used to force a further frame rate reduction.

Advanced audio options

Option Description
--opus Use Opus as output audio format. Setting this option also allows input Opus streams to be copied. libopus may fail to encode certain surround sound configurations (see this bugtracker for more infos). In such a case libvorbis will be used as fallback encoder (as FFmpeg's native Opus encoder unfortunately forces stereo output).
--no-copy Force all streams to get reencoded, even if they would be qualified for copying (i.e. audio output, no start time, no audio filters, allowed audio format and small enough bitrate).
--force-copy Ignore the bitrate when deciding whether or not to copy an audio stream. Despite its name, this option won't force-copy input audio streams no matter what (audio output, no start time, no audio filters and allowed audio format are still necessary conditions).
--min-audio RATE Set a min. audio channel bitrate in Kbps (default: 24). Everything less than or equal 6 Kbps will allow the script to freely choose from its full bitrate range (6-96 Kbps). Everything greater than or equal 24 Kbps will prevent the possibility of the audio getting downsampled.
--max-audio RATE Another (optional) audio channel bitrate threshold in Kbps. This option can be used to exceed the max. channel bitrate of 96 Kbps, but it can't be lower than 6 Kbps.

Misc. options

Option Description
--no-filter-firstpass Disable custom filters (see -f/--filter) during the first pass, when using 2-pass encoding. This can be useful to cut down the encoding time drastically for resource intensive filters (e.g. nlmeans).
--ffmpeg-verbosity LEVEL Change FFmpeg's verbosity (default: stats). Allowed are all loglevel values supported by FFmpeg (quiet, panic, fatal, error, warning, info, verbose, debug, trace) as well as a special level called stats, which is error with the -stats option added to show the encoding progress. If you want to see the encoding progress, you need to use stats, info, verbose, debug or trace. All other values will suppress it. Please note that FFmpeg always outputs to stderr, so if you want to pipe to an error log and don't want it littered with progress messages, use one of the quieter levels.
--no-color By default the script uses colors to make the potentially quite verbose output more readable. The colors are supposed to provide a stark difference between the different kinds of information and to be readable on different backgrounds. It wasn't the goal to make the output more aesthetically pleasing and in fact, I doubt I would be able to even if I wanted. Therefore this option can be used to disabled colorized output completely, just in case the colors make your eyes bleed. If you want colorized output, but are dissatisfied with the colors I chose, then you can change them in the beginning of the script (see: ANSI escape codes).
--debug Print the FFmpeg commands instead of running them. The output size can be entered manually to simulate the whole adjustment process.