refactor
This commit is contained in:
parent
6fdcf2a7c5
commit
7abeac09d0
1 changed files with 250 additions and 7 deletions
|
@ -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=<field1,field2>`
|
||||
Set custom [HTTP](../../internet/HTTP.md) fields when accessing [HTTP](../../internet/HTTP.md) stream.
|
||||
- `--http-proxy=<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=<out_w>:<out_h>:<x>:<y>:<keep_aspect>:<exact>`
|
||||
|
||||
#### 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=<x>:<w>:<width>:<height>:<color>:<thickness>:<replace>:<box_source>`
|
||||
|
||||
#### 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=<contrast>:<brightness>:<saturation>:<gamma>:<gamma_r>:<gamma_g>:<gamma_b>:<gamma_weight>`
|
||||
|
||||
#### 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=<fps>`
|
||||
|
||||
### framestep
|
||||
Select one frame every N frames.
|
||||
Usage: `mpv -vf=framestep=<step>`
|
||||
|
||||
### gblur
|
||||
Apply Gaussian Blur filter.
|
||||
Usage: `mpv -vf=gblur=<sigma>:<steps>:<planes>:<sigmaV>`
|
||||
|
||||
#### 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=<width>:<height>`
|
||||
|
||||
### rotate
|
||||
Rotate the input image.
|
||||
Usage: `mpv -vf=rotate=<angle>:<out_w>:<out_h>:<fillcolor>:<bilinear>`
|
||||
|
||||
#### 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=<w>:<h>`
|
||||
|
||||
### swaprect
|
||||
Swap 2 rectangular objects in video.
|
||||
Usage: `mpv -vf=swaprect=<w>:<h>:<x1>:<y1>:<x2>:<y2>`
|
||||
|
||||
#### 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=<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+]<key> [{<section>}] <command> ( ; <command> )*`
|
||||
|
||||
### 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 <target> [<flags>]`
|
||||
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 <name> <value>`
|
||||
Set the given property or option to the given value.
|
||||
- `del <name>`
|
||||
Delete the given property. Most properties cannot be deleted.
|
||||
- `add <name> [<value>]`
|
||||
Add the given value to the property or option. On overflow or underflow, clamp the property to the maximum. If `<value>` is omitted, assume 1.
|
||||
- `screenshot <flags>`
|
||||
Take a screenshot.
|
||||
|
||||
Multiple flags are available (some can be combined with +):
|
||||
|
||||
| Flag | Description |
|
||||
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `<subtitles> (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. |
|
||||
| `<video>` | Like subtitles, but typically without OSD or subtitles. The exact behavior depends on the selected video output. |
|
||||
| `<window>` | Save the contents of the mpv window. Typically scaled, with OSD and subtitles. The exact behavior depends on the selected video output. |
|
||||
| `<each-frame>` | Take a screenshot each frame. Issue this command again to stop taking screenshots. Note that you should disable frame-dropping when using this mode - or you might receive duplicate images in cases when a frame was dropped. This flag can be combined with the other flags, e.g. video+each-frame. |
|
||||
|
||||
- `playlist-next`
|
||||
Go to the next entry on the playlist.
|
||||
- `playlist-prev`
|
||||
Go to the previous entry on the playlist.
|
||||
- `playlist-play-index <integer|current|none>`
|
||||
Start (or restart) playback of the given playlist index.
|
||||
- `loadfile <url> [<flags> [<options>]]`
|
||||
Load the given file or [URL](../../internet/URL.md) and play it. Technically, this is just a playlist manipulation command (which either replaces the playlist or appends an entry to it). Actual file loading happens independently. For example, a loadfile command that replaces the current file with a new one returns before the current file is stopped, and the new file even begins loading.
|
||||
- `loadlist <url> [<flags>]`
|
||||
Load the given playlist file or [URL](../../internet/URL.md) (like `--playlist`).
|
||||
- `playlist-clear`
|
||||
Clear the playlist, except the currently played file.
|
||||
- `playlist-remove <index>`
|
||||
Remove the playlist entry at the given index. Index values start counting with 0. The special value current removes the current entry. Note that removing the current entry also stops playback and starts playing the next entry.
|
||||
- `playlist-move <index1> <index2>`
|
||||
Move the playlist entry at index1, so that it takes the place of the entry index2. (Paradoxically, the moved playlist entry will not have the index value index2 after moving if index1 was lower than index2, because index2 refers to the target entry, not the index the entry will have after moving.)
|
||||
- `playlist-shuffle`
|
||||
Shuffle the playlist. This is similar to what is done on start if the `--shuffle` option is used.
|
||||
- `run <command> [<arg1> [<arg2> [...]]]`
|
||||
Run the given command. Unlike in MPlayer/mplayer2 and earlier versions of mpv (0.2.x and older), this doesn't call the [shell](../cli/Shell.md). Instead, the command is run directly, with each argument passed separately. Each argument is expanded like in Property Expansion.
|
||||
This command has a variable number of arguments, and cannot be used with named arguments.
|
||||
The program is run in a detached way. mpv doesn't wait until the command is completed, but continues playback right after spawning it.
|
||||
- `quit [<code>]`
|
||||
Exit the player. If an argument is given, it's used as process exit code.
|
||||
- `sub-add <url> [<flags> [<title> [<lang>]]]`
|
||||
Load the given subtitle file or stream. By default, it is selected as current subtitle after loading.
|
||||
- `sub-remove [<id>]`
|
||||
Remove the given subtitle track. If the id argument is missing, remove the current track. (Works on external subtitle files only.)
|
||||
- `show-text <text> [<duration>|-1 [<level>]]`
|
||||
Show text on the OSD. The string can contain properties, which are expanded as described in Property Expansion. This can be used to show playback time, filename, and so on. no-osd has no effect on this command.
|
||||
- `expand-text <string>`
|
||||
Property-expand the argument and return the expanded string. This can be used only through the client API or from a script using mp.command_native.
|
||||
- `audio-add <url> [<flags> [<title> [<lang>]]]`
|
||||
Load the given audio file.
|
||||
- `audio-remove [<id>]`
|
||||
Remove the given audio track.
|
||||
- `audio-reload [<id>]`
|
||||
Reload the given audio tracks.
|
||||
- `video-add <url> [<flags> [<title> [<lang> [<albumart>]]]]`
|
||||
Load the given video file.
|
||||
- `video-remove [<id>]`
|
||||
Remove the given video track.
|
||||
- `video-reload [<id>]`
|
||||
Reload the given video tracks.
|
||||
|
||||
### List of Properties
|
||||
#refactor -> https://mpv.io/manual/stable/#property-list
|
||||
- `filename`
|
||||
Currently played file, with path stripped. If this is an [URL](../../internet/URL.md), try to undo percent encoding as well. (The result is not necessarily correct, but looks better for display purposes. Use the `path` property to get an unmodified filename.)
|
||||
- `filename/no-ext`
|
||||
Like the filename property, but if the text contains a `.`, strip all text after the last `.`. Usually this removes the file extension.
|
||||
- `file-size`
|
||||
Length in bytes of the source file/stream.
|
||||
- `estimated-frame-count`
|
||||
Total number of frames in current file.
|
||||
- `pid`
|
||||
Process-id of mpv.
|
||||
- `media-title`
|
||||
If the currently played file has a title tag, use that. Otherwise, return the filename property.
|
||||
- `file-format`
|
||||
Symbolic name of the file format. In some cases, this is a comma-separated list of format names, e.g. mp4 is mov,mp4,m4a,3gp,3g2,mj2 (the list may grow in the future for any format).
|
||||
- `duration`
|
||||
Duration of the current file in seconds. If the duration is unknown, the property is unavailable. Note that the file duration is not always exactly known, so this is an estimate.
|
||||
- `duration/full`
|
||||
duration with milliseconds.
|
||||
- `percent-pos` (RW)
|
||||
Position in current file (0-100). The advantage over using this instead of calculating it out of other properties is that it properly falls back to estimating the playback position from the byte position, if the file duration is not known.
|
||||
- `time-pos` (RW)
|
||||
Position in current file in seconds.
|
||||
- `time-pos/full`
|
||||
`time-pos` with milliseconds.
|
||||
- `time-remaining`
|
||||
Remaining length of the file in seconds. Note that the file duration is not always exactly known, so this is an estimate.
|
||||
- `time-remaining/full`
|
||||
`time-remaining` with milliseconds.
|
||||
- `playtime-remaining`
|
||||
`time-remaining` scaled by the current speed.
|
||||
- `playtime-remaining/full`
|
||||
`playtime-remaining` with milliseconds.
|
||||
- `chapter` (RW)
|
||||
Current chapter number. The number of the first chapter is 0.
|
||||
- `chapters`
|
||||
Number of chapters.
|
||||
- `metadata`
|
||||
Metadata key/value pairs.
|
||||
- `metadata/by-key/<key>`
|
||||
Value of metadata entry `<key>`.
|
||||
- `metadata/list/count`
|
||||
Number of metadata entries.
|
||||
- `metadata/list/N/key`
|
||||
Key name of the Nth metadata entry. (The first entry is 0).
|
||||
- `metadata/list/N/value`
|
||||
Value of the Nth metadata entry.
|
||||
- `width`, `height`
|
||||
Video size. This uses the size of the video as decoded, or if no video frame has been decoded yet, the (possibly incorrect) container indicated size.
|
||||
- `playlist-pos` (RW)
|
||||
Current position on playlist. The first entry is on position 0. Writing to this property may start playback at the new position.
|
||||
- `playlist-count`
|
||||
Number of total playlist entries.
|
||||
- `working-directory`
|
||||
The working directory of the mpv process. Can be useful for JSON IPC users, because the command line player usually works with relative paths.
|
||||
|
||||
## Configuration
|
||||
You can put all of the options in configuration files which will be read every time mpv is run. The system-wide configuration file 'mpv.conf' is in your configuration directory (e.g. `/etc/mpv` or `/usr/local/etc/mpv`), the user-specific one is `~/.config/mpv/mpv.conf`.
|
||||
|
|
Loading…
Reference in a new issue