diff --git a/technology/applications/media/MPV.md b/technology/applications/media/MPV.md index eca31f8..7783249 100644 --- a/technology/applications/media/MPV.md +++ b/technology/applications/media/MPV.md @@ -2,11 +2,11 @@ obj: application os: - linux -website: https://mpv.io/ +website: https://mpv.io flatpak-id: io.mpv.Mpv --- # MPV -mpv is a based media player. It supports a wide variety of video [file formats](../../files/File%20Formats.md), audio and video codecs, and subtitle types. Special input [URL](../../internet/URL.md) types are available to read input from a variety of sources other than disk files. Depending on platform, a variety of different video and audio output methods are supported. +mpv is a based media player. It supports a wide variety of video [file formats](../../files/File%20Formats.md), audio and video [codecs](../../media/Codecs.md), and subtitle types. Special input [URL](../../internet/URL.md) types are available to read input from a variety of sources other than disk files. Depending on platform, a variety of different video and audio output methods are supported. ## Usage Usage: `mpv [options] [file|URL|PLAYLIST|-]` @@ -325,16 +325,127 @@ Usage: `mpv [options] [file|URL|PLAYLIST|-]` - `--http-header-fields=` Set custom [HTTP](../../internet/HTTP.md) fields when accessing [HTTP](../../internet/HTTP.md) stream. - `--http-proxy=` - [URL](../../internet/URL.md) of the HTTP/HTTPS proxy. If this is set, the `http_proxy` environment is ignored. The `no_proxy` environment variable is still respected. This option is silently ignored if it does not start with `http://`. Proxies are not used for https URLs. Setting this option does not try to make the ytdl script use the proxy. + [URL](../../internet/URL.md) of the [HTTP](../../internet/HTTP.md)/HTTPS proxy. If this is set, the `http_proxy` environment is ignored. The `no_proxy` environment variable is still respected. This option is silently ignored if it does not start with `http://`. Proxies are not used for https URLs. Setting this option does not try to make the ytdl script use the proxy. ## Video Filters -#refactor -> $ mpv -vf=help To see a list of all available video filters: `mpv -vf=help` +### crop +Crop the video +Usage: `mpv -vf=crop=:::::` + +#### Options +| Option | Description | +| ------------- | ----------------------------------- | +| `out_w` | set the width crop area expression | +| `out_h` | set the height crop area expression | +| `x` | set the x crop area expression | +| `y` | set the y crop area expression | +| `keep_aspect` | keep aspect ratio | +| `exact` | do exact cropping | + +### drawbox +Draw a colored box on the input video. +Usage: `mpv -vf=drawbox=:::::::` + +#### Options +| Option | Description | +| ------------ | -------------------------------------------- | +| `x` | set horizontal position of the left box edge | +| `y` | set vertical position of the top box edge | +| `width` | set width of the box | +| `height` | set height of the box | +| `color` | set color of the box | +| `thickness` | set the box thickness | +| `replace` | replace color & alpha | +| `box_source` | use datas from bounding box in side data | + +### eq +Adjust brightness, contrast, gamma, and saturation. +Usage: `mpv -vf=eq=:::::::` + +#### Options +| Option | Description | +| -------------- | ---------------------------------------------------------------------- | +| `contrast` | set the contrast adjustment, negative values give a negative image | +| `brightness` | set the brightness adjustment | +| `saturation` | set the saturation adjustment | +| `gamma` | set the initial gamma value | +| `gamma_r` | gamma value for red | +| `gamma_g` | gamma value for green | +| `gamma_b` | gamma value for blue | +| `gamma_weight` | set the gamma weight which reduces the effect of gamma on bright areas | + +### framerate +Upsamples or downsamples progressive source between specified frame rates. +Usage: `mpv -vf=framerate=` + +### framestep +Select one frame every N frames. +Usage: `mpv -vf=framestep=` + +### gblur +Apply Gaussian Blur filter. +Usage: `mpv -vf=gblur=:::` + +#### Options +| Option | Description | +| -------- | -------------------- | +| `sigma` | set sigma | +| `steps` | set number of steps | +| `planes` | set planes to filter | +| `sigmaV` | set vertical sigma | + +### hflip +Horizontally flip the input video. +Usage: `mpv -vf=hflip` + +### vflip +Flip the input video vertically. +Usage: `mpv -vf=vflip` + +### pixelize +Pixelize video. +Usage: `mpv -vf=pixelize=:` + +### rotate +Rotate the input image. +Usage: `mpv -vf=rotate=::::` + +#### Options +| Option | Description | +| ----------- | ---------------------------- | +| `angle` | set angle (in radians) | +| `out_w` | set output width expression | +| `out_h` | set output height expression | +| `fillcolor` | set background fill color | +| `bilinear` | use bilinear interpolation | + +### scale +Scale the input video size and/or convert the image format. +Usage: `mpv -vf=scale=:` + +### swaprect +Swap 2 rectangular objects in video. +Usage: `mpv -vf=swaprect=:::::` + +#### Options +| Option | Description | +| ------ | ---------------------------------- | +| `w` | set rect width | +| `h` | set rect height | +| `x1` | set 1st rect x top left coordinate | +| `y1` | set 1st rect y top left coordinate | +| `x2` | set 2nd rect x top left coordinate | +| `y2` | set 2nd rect y top left coordinate | + ## Audio Filters -#refactor -> $ mpv -af=help To see a list of all available audio filters: `mpv -af=help` +### volume +Change input volume. +Usage: `mpv -af=volume=` + ## Encoding You can encode files from one format/codec to another using this facility. This is useful if you want to apply filters to a file. @@ -368,10 +479,142 @@ Each line maps a key to an input command. Keys are specified with their literal Syntax: `[Shift+][Ctrl+][Alt+][Meta+] [{
}] ( ; )*` ### List of Input Commands -#refactor -> https://mpv.io/manual/stable/#list-of-input-commands +Commands with parameters have the parameter name enclosed in `< / >`. Don't add those to the actual command. Optional arguments are enclosed in `[ / ]`. If you don't pass them, they will be set to a default value. + +- `ignore` +Use this to "block" keys that should be unbound, and do nothing. Useful for disabling default bindings, without disabling all bindings with `--no-input-default-bindings`. +- `seek []` +Change the playback position. By default, seeks by a relative amount of seconds. + +The second argument consists of flags controlling the seek mode: + +| Mode | Description | +| ------------------ | ------------------------------------------------------------------------ | +| relative (default) | Seek relative to current position (a negative value seeks backwards). | +| absolute | Seek to a given time (a negative value starts from the end of the file). | +| absolute-percent | Seek to a given percent position. | +| relative-percent | Seek relative to current position in percent. | +| keyframes | Always restart playback at keyframe boundaries (fast). | +| exact | Always do exact/hr/precise seeks (slow). | + +- `set ` +Set the given property or option to the given value. +- `del ` +Delete the given property. Most properties cannot be deleted. +- `add []` +Add the given value to the property or option. On overflow or underflow, clamp the property to the maximum. If `` is omitted, assume 1. +- `screenshot ` +Take a screenshot. + +Multiple flags are available (some can be combined with +): + +| Flag | Description | +| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ` (default)` | Save the video image, in its original resolution, and with subtitles. Some video outputs may still include the OSD in the output under certain circumstances. | +| `