Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0536841647 | ||
|
|
0803f4ad21 | ||
|
|
9d2980dab7 | ||
|
|
21cd4ff05b | ||
|
|
d1d6257731 | ||
|
|
ba9b2f1e49 | ||
|
|
e1993d5ad2 | ||
|
|
0607dcebff | ||
|
|
a33a44cf4e | ||
|
|
273607c1c6 | ||
|
|
5b7d0fbab3 | ||
|
|
ec567d8a77 | ||
|
|
f8c57433b9 | ||
|
|
ead2933792 | ||
|
|
181e1377b2 |
No files matched your search
@@ -1,26 +0,0 @@
|
||||
# To use this config on you editor, follow the instructions at:
|
||||
# http://editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
max_line_length = 80
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[.git/COMMIT*]
|
||||
max_line_length = 72
|
||||
|
||||
[{osdep/dirent-win.h,TOOLS/osxbundle/mpv.app/Contents/PkgInfo,TOOLS/osxbundle/mpv.app/Contents/Resources/Assets.car}]
|
||||
charset = unset
|
||||
insert_final_newline = unset
|
||||
indent_style = unset
|
||||
indent_size = unset
|
||||
max_line_length = unset
|
||||
trim_trailing_whitespace = unset
|
||||
|
||||
[menu.conf]
|
||||
indent_style = tab
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"Format": "github-actions",
|
||||
"Disable": {
|
||||
"IndentSize": true,
|
||||
"MaxLineLength": true
|
||||
}
|
||||
}
|
||||
@@ -1,160 +0,0 @@
|
||||
name: "Report a Linux Issue"
|
||||
description: "Create a report for a runtime related Linux Issue"
|
||||
labels: ["os:linux"]
|
||||
type: Bug
|
||||
body:
|
||||
- type: textarea
|
||||
id: mpv_information
|
||||
attributes:
|
||||
label: "mpv Information"
|
||||
placeholder: |
|
||||
mpv v0.38.0-96-gf776be6af5 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
|
||||
built on May 5 2024 18:37:43
|
||||
libplacebo version: v7.349.0 (v6.338.0-120-g7b294350)
|
||||
FFmpeg version: 6.1.1
|
||||
FFmpeg library versions:
|
||||
libavutil 58.29.100
|
||||
libavcodec 60.31.102
|
||||
libavformat 60.16.100
|
||||
libswscale 7.5.100
|
||||
libavfilter 9.12.100
|
||||
libswresample 4.12.100
|
||||
description: |
|
||||
Provide the output of `mpv --version`.
|
||||
render: bash
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: other_information
|
||||
attributes:
|
||||
label: "Other Information"
|
||||
description: >
|
||||
Provide following information if applicable.
|
||||
- Linux Version: `cat /etc/os-release | grep "NAME"`
|
||||
- Kernel Version: `uname -a`
|
||||
- GPU Model: `lspci -nn | grep VGA` or `lshw -C display -numeric`
|
||||
- Mesa/GPU Driver Version: `glxinfo -B | grep "OpenGL version string"` or `vulkaninfo | grep driverInfo`
|
||||
- Window Manager and Version
|
||||
- Source of the mpv binary
|
||||
- Latest version of mpv you know without the problem
|
||||
- The time when the problem started to happen (after updating mpv, system, driver, etc.)
|
||||
- Possible screenshot or video of visual glitches
|
||||
|
||||
If you're not using the git master branch or the [latest release](https://github.com/mpv-player/mpv/releases/latest), please update.
|
||||
Older versions are not supported. If your distribution does not provide the latest version, please report the issue to them.
|
||||
|
||||
Packages and builds can be found [here](https://mpv.io/installation/).
|
||||
value: |-
|
||||
- Linux version:
|
||||
- Kernel Version:
|
||||
- GPU Model:
|
||||
- Mesa/GPU Driver Version:
|
||||
- Window Manager and Version:
|
||||
- Source of mpv:
|
||||
- Latest known working version:
|
||||
- Issue started after the following happened:
|
||||
render: text
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reproduction_steps
|
||||
attributes:
|
||||
label: "Reproduction Steps"
|
||||
description: >
|
||||
Try to reproduce your issue with `--no-config` first. If it isn't reproducible
|
||||
with `--no-config` try to find out which option or script causes your issue.
|
||||
|
||||
|
||||
If the issue is render performance-related, try to reproduce it with `--no-config
|
||||
--profile=fast`, which is designed to work on lower-end mobile devices.
|
||||
|
||||
|
||||
For decoding performance-related issues, additionally try to enable hardware
|
||||
decoding with `--hwdec=yes` or the `Ctrl+h` shortcut.
|
||||
|
||||
|
||||
Describe the reproduction steps as precise as possible. It's very likely that
|
||||
the bug you experience wasn't reproduced by the developer because the workflow
|
||||
differs from your own.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected_behavior
|
||||
attributes:
|
||||
label: "Expected Behavior"
|
||||
placeholder: "What were you expecting?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: actual_behavior
|
||||
attributes:
|
||||
label: "Actual Behavior"
|
||||
placeholder: "What happened instead?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: log_file
|
||||
attributes:
|
||||
label: "Log File"
|
||||
placeholder: "Drag and drop log file here (Don't paste content directly)"
|
||||
description: >
|
||||
Make a log file with `--gpu-debug --log-file=output.txt`, which is our preferred way, and
|
||||
attach it to the issue.
|
||||
|
||||
|
||||
If you have trouble producing a log file, you can alternatively use `--gpu-debug --msg-time -v -v`,
|
||||
save the terminal output to a file, and attach it to the issue.
|
||||
|
||||
|
||||
In the case of a crash, please provide a [backtrace](https://wiki.archlinux.org/title/Debugging/Getting_traces).
|
||||
|
||||
|
||||
Without the log file, this issue will be closed for ignoring the issue template.
|
||||
|
||||
|
||||
Disclaimer: The log file may contain identifiable information, such as your username.
|
||||
Review the log file before sharing and redact any sensitive data if necessary.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: sample_files
|
||||
attributes:
|
||||
label: "Sample Files"
|
||||
placeholder: "Drag and drop sample files here"
|
||||
description: >
|
||||
Please provide sample files for a minimal reproduction case, if the issue can't be
|
||||
reproduced without it or it is helpful to demonstrate the issue.
|
||||
|
||||
|
||||
Preferably files should be attached directly within the text field below. Due to GitHub's
|
||||
upload restriction, you may need to archive the sample file first and upload it as `.zip`
|
||||
file. If the sample file is too big to attach directly, use a solution that is easy to
|
||||
access with possible long-term retention. Possible services include, but are not limited
|
||||
to, the following:
|
||||
|
||||
- [0x0.st](https://0x0.st/) (no long-term retention)
|
||||
- [Dropbox](https://www.dropbox.com)
|
||||
- [Google Drive](https://www.google.com/drive/)
|
||||
- [iCLoud Drive](https://www.icloud.com/iclouddrive/)
|
||||
- [MediaFire](https://www.mediafire.com/)
|
||||
- [OneDrive](https://onedrive.live.com/)
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: "I carefully read all instruction and confirm that I did the following:"
|
||||
options:
|
||||
- label: "I tested and confirmed that the issue exists with the [latest release version](https://github.com/mpv-player/mpv/releases/latest) or newer."
|
||||
required: true
|
||||
- label: "I provided all required information including system and mpv version."
|
||||
required: true
|
||||
- label: >-
|
||||
I produced the log file with the exact same set of files, parameters, and conditions
|
||||
used in "Reproduction Steps", with the addition of `--log-file=output.txt`.
|
||||
required: true
|
||||
- label: >-
|
||||
I produced the log file while the behaviors described in "Actual Behavior" were
|
||||
actively observed.
|
||||
required: true
|
||||
- label: "I attached the full, untruncated log file."
|
||||
required: true
|
||||
- label: "I attached the backtrace in the case of a crash."
|
||||
required: true
|
||||
@@ -1,153 +0,0 @@
|
||||
name: "Report a macOS Issue"
|
||||
description: "Create a report for a runtime related macOS Issue"
|
||||
labels: ["os:mac"]
|
||||
type: Bug
|
||||
body:
|
||||
- type: textarea
|
||||
id: mpv_information
|
||||
attributes:
|
||||
label: "mpv Information"
|
||||
placeholder: |
|
||||
mpv v0.38.0-96-gf776be6af5 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
|
||||
built on May 5 2024 18:37:43
|
||||
libplacebo version: v7.349.0 (v6.338.0-120-g7b294350)
|
||||
FFmpeg version: 6.1.1
|
||||
FFmpeg library versions:
|
||||
libavutil 58.29.100
|
||||
libavcodec 60.31.102
|
||||
libavformat 60.16.100
|
||||
libswscale 7.5.100
|
||||
libavfilter 9.12.100
|
||||
libswresample 4.12.100
|
||||
description: |
|
||||
Provide the output of `mpv --version`.
|
||||
render: bash
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: other_info
|
||||
attributes:
|
||||
label: "Other Information"
|
||||
description: >
|
||||
- macOS Version: `system_profiler SPSoftwareDataType | sed -rn 's/^ *System Version: (.*$)/\1/p'`
|
||||
- Source of the mpv binary or bundle
|
||||
- Latest version of mpv you know without the problem
|
||||
- The time when the problem started to happen (after updating mpv, system, driver, etc.)
|
||||
- Possible screenshot or video of visual glitches
|
||||
|
||||
If you're not using git master or the latest release, update.
|
||||
Nightly builds from master can be found [here](https://github.com/mpv-player/mpv/actions/workflows/build.yml?query=branch%3Amaster+event%3Apush),
|
||||
click on the latest workflow run, scroll down to the Artifacts section and download the
|
||||
appropriate build. Packages and builds can be found [here](https://mpv.io/installation/).
|
||||
value: |-
|
||||
- macOS version:
|
||||
- Source of mpv:
|
||||
- Latest known working version:
|
||||
- Issue started after the following happened:
|
||||
render: text
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reproduction_steps
|
||||
attributes:
|
||||
label: "Reproduction Steps"
|
||||
description: >
|
||||
Try to reproduce your issue with `--no-config` first. If it isn't reproducible
|
||||
with `--no-config` try to find out which option or script causes your issue.
|
||||
|
||||
|
||||
If the issue is render performance-related, try to reproduce it with `--no-config
|
||||
--profile=fast`, which is designed to work on lower-end mobile devices.
|
||||
|
||||
|
||||
For decoding performance-related issues, additionally try to enable hardware
|
||||
decoding with `--hwdec=yes` or the `Ctrl+h` shortcut.
|
||||
|
||||
|
||||
Describe the reproduction steps as precise as possible. It's very likely that
|
||||
the bug you experience wasn't reproduced by the developer because the workflow
|
||||
differs from your own.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected_behavior
|
||||
attributes:
|
||||
label: "Expected Behavior"
|
||||
placeholder: "What were you expecting?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: actual_behavior
|
||||
attributes:
|
||||
label: "Actual Behavior"
|
||||
placeholder: "What happened instead?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: log_file
|
||||
attributes:
|
||||
label: "Log File"
|
||||
placeholder: "Drag and drop log file here (Don't paste content directly)"
|
||||
description: >
|
||||
Make a log file with `--gpu-debug --log-file=output.txt`, which is our preferred way, and
|
||||
attach it to the issue. If you use the Bundle, a default log is created for your last run
|
||||
at `~/Library/Logs/mpv.log`. You can jump to that file via the `Help > Show log File…` menu.
|
||||
|
||||
|
||||
If you have trouble producing a log file, you can alternatively use `--gpu-debug --msg-time -v -v`,
|
||||
save the terminal output to a file, and attach it to the issue.
|
||||
|
||||
|
||||
In the case of a crash, please provide the macOS Crash Report or create a [backtrace](https://developer.apple.com/library/archive/documentation/General/Conceptual/lldb-guide/chapters/C5-Examining-The-Call-Stack.html)
|
||||
yourself.
|
||||
|
||||
|
||||
Without the log file, this issue will be closed for ignoring the issue template.
|
||||
|
||||
|
||||
Disclaimer: The log file may contain identifiable information, such as your username.
|
||||
Review the log file before sharing and redact any sensitive data if necessary.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: sample_files
|
||||
attributes:
|
||||
label: "Sample Files"
|
||||
placeholder: "Drag and drop sample files here"
|
||||
description: >
|
||||
Please provide sample files for a minimal reproduction case, if the issue can't be
|
||||
reproduced without it or it is helpful to demonstrate the issue.
|
||||
|
||||
|
||||
Preferably files should be attached directly within the text field below. Due to GitHub's
|
||||
upload restriction, you may need to archive the sample file first and upload it as `.zip`
|
||||
file. If the sample file is too big to attach directly, use a solution that is easy to
|
||||
access with possible long-term retention. Possible services include, but are not limited
|
||||
to, the following:
|
||||
|
||||
- [0x0.st](https://0x0.st/) (no long-term retention)
|
||||
- [Dropbox](https://www.dropbox.com)
|
||||
- [Google Drive](https://www.google.com/drive/)
|
||||
- [iCLoud Drive](https://www.icloud.com/iclouddrive/)
|
||||
- [MediaFire](https://www.mediafire.com/)
|
||||
- [OneDrive](https://onedrive.live.com/)
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: "I carefully read all instruction and confirm that I did the following:"
|
||||
options:
|
||||
- label: "I tested and confirmed that the issue exists with the [latest release version](https://github.com/mpv-player/mpv/releases/latest) or newer."
|
||||
required: true
|
||||
- label: "I provided all required information including system and mpv version."
|
||||
required: true
|
||||
- label: >-
|
||||
I produced the log file with the exact same set of files, parameters, and conditions
|
||||
used in "Reproduction Steps", with the addition of `--log-file=output.txt`.
|
||||
required: true
|
||||
- label: >-
|
||||
I produced the log file while the behaviors described in "Actual Behavior" were
|
||||
actively observed.
|
||||
required: true
|
||||
- label: "I attached the full, untruncated log file."
|
||||
required: true
|
||||
- label: "I attached the backtrace in the case of a crash."
|
||||
required: true
|
||||
@@ -1,154 +0,0 @@
|
||||
name: "Report a Windows Issue"
|
||||
description: "Create a report for a runtime related Windows Issue"
|
||||
labels: ["os:win"]
|
||||
type: Bug
|
||||
body:
|
||||
- type: textarea
|
||||
id: mpv_information
|
||||
attributes:
|
||||
label: "mpv Information"
|
||||
placeholder: |
|
||||
mpv v0.38.0-96-gf776be6af5 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
|
||||
built on May 5 2024 18:37:43
|
||||
libplacebo version: v7.349.0 (v6.338.0-120-g7b294350)
|
||||
FFmpeg version: 6.1.1
|
||||
FFmpeg library versions:
|
||||
libavutil 58.29.100
|
||||
libavcodec 60.31.102
|
||||
libavformat 60.16.100
|
||||
libswscale 7.5.100
|
||||
libavfilter 9.12.100
|
||||
libswresample 4.12.100
|
||||
description: |
|
||||
Provide the output of `mpv --version`.
|
||||
render: bash
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: other_information
|
||||
attributes:
|
||||
label: "Other Information"
|
||||
description: >
|
||||
- Windows Version: `cmd /c ver`
|
||||
- GPU model, driver and version
|
||||
- Source of the mpv binary
|
||||
- Latest version of mpv you know without the problem
|
||||
- The time when the problem started to happen (after updating mpv, system, driver, etc.)
|
||||
- Possible screenshot or video of visual glitches
|
||||
|
||||
If you're not using git master or the latest release, update.
|
||||
Nightly builds from master can be found [here](https://github.com/mpv-player/mpv/actions/workflows/build.yml?query=branch%3Amaster+event%3Apush),
|
||||
click on the latest workflow run, scroll down to the Artifacts section and download the
|
||||
appropriate build. Packages and builds can be found [here](https://mpv.io/installation/).
|
||||
value: |-
|
||||
- Windows version:
|
||||
- GPU model, driver and version:
|
||||
- Source of mpv:
|
||||
- Latest known working version:
|
||||
- Issue started after the following happened:
|
||||
render: text
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reproduction_steps
|
||||
attributes:
|
||||
label: "Reproduction Steps"
|
||||
description: >
|
||||
Try to reproduce your issue with `--no-config` first. If it isn't reproducible
|
||||
with `--no-config` try to find out which option or script causes your issue.
|
||||
|
||||
|
||||
If the issue is render performance-related, try to reproduce it with `--no-config
|
||||
--profile=fast`, which is designed to work on lower-end mobile devices.
|
||||
|
||||
|
||||
For decoding performance-related issues, additionally try to enable hardware
|
||||
decoding with `--hwdec=yes` or the `Ctrl+h` shortcut.
|
||||
|
||||
|
||||
Describe the reproduction steps as precise as possible. It's very likely that
|
||||
the bug you experience wasn't reproduced by the developer because the workflow
|
||||
differs from your own.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected_behavior
|
||||
attributes:
|
||||
label: "Expected Behavior"
|
||||
placeholder: "What were you expecting?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: actual_behavior
|
||||
attributes:
|
||||
label: "Actual Behavior"
|
||||
placeholder: "What happened instead?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: log_file
|
||||
attributes:
|
||||
label: "Log File"
|
||||
placeholder: "Drag and drop log file here (Don't paste content directly)"
|
||||
description: >
|
||||
Make a log file with `--gpu-debug --log-file=output.txt`, which is our preferred way, and
|
||||
attach it to the issue.
|
||||
|
||||
|
||||
If you have trouble producing a log file, you can alternatively use `--gpu-debug --msg-time -v -v`,
|
||||
save the terminal output to a file, and attach it to the issue.
|
||||
|
||||
|
||||
In the case of a crash, please provide a backtrace, attach the appropriate `.dmp` file
|
||||
from `%LOCALAPPDATA%\CrashDumps`.
|
||||
|
||||
|
||||
Without the log file, this issue will be closed for ignoring the issue template.
|
||||
|
||||
|
||||
Disclaimer: The log file may contain identifiable information, such as your username.
|
||||
Review the log file before sharing and redact any sensitive data if necessary.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: sample_files
|
||||
attributes:
|
||||
label: "Sample Files"
|
||||
placeholder: "Drag and drop sample files here"
|
||||
description: >
|
||||
Please provide sample files for a minimal reproduction case, if the issue can't be
|
||||
reproduced without it or it is helpful to demonstrate the issue.
|
||||
|
||||
|
||||
Preferably files should be attached directly within the text field below. Due to GitHub's
|
||||
upload restriction, you may need to archive the sample file first and upload it as `.zip`
|
||||
file. If the sample file is too big to attach directly, use a solution that is easy to
|
||||
access with possible long-term retention. Possible services include, but are not limited
|
||||
to, the following:
|
||||
|
||||
- [0x0.st](https://0x0.st/) (no long-term retention)
|
||||
- [Dropbox](https://www.dropbox.com)
|
||||
- [Google Drive](https://www.google.com/drive/)
|
||||
- [iCLoud Drive](https://www.icloud.com/iclouddrive/)
|
||||
- [MediaFire](https://www.mediafire.com/)
|
||||
- [OneDrive](https://onedrive.live.com/)
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: "I carefully read all instruction and confirm that I did the following:"
|
||||
options:
|
||||
- label: "I tested and confirmed that the issue exists with the [latest release version](https://github.com/mpv-player/mpv/releases/latest) or newer."
|
||||
required: true
|
||||
- label: "I provided all required information including system and mpv version."
|
||||
required: true
|
||||
- label: >-
|
||||
I produced the log file with the exact same set of files, parameters, and conditions
|
||||
used in "Reproduction Steps", with the addition of `--log-file=output.txt`.
|
||||
required: true
|
||||
- label: >-
|
||||
I produced the log file while the behaviors described in "Actual Behavior" were
|
||||
actively observed.
|
||||
required: true
|
||||
- label: "I attached the full, untruncated log file."
|
||||
required: true
|
||||
- label: "I attached the backtrace in the case of a crash."
|
||||
required: true
|
||||
@@ -1,151 +0,0 @@
|
||||
name: "Report an Issue on other platforms"
|
||||
description: "Create a report for a runtime related Issue on other platforms"
|
||||
labels: []
|
||||
type: Bug
|
||||
body:
|
||||
- type: textarea
|
||||
id: mpv_information
|
||||
attributes:
|
||||
label: "mpv Information"
|
||||
placeholder: |
|
||||
mpv v0.38.0-96-gf776be6af5 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
|
||||
built on May 5 2024 18:37:43
|
||||
libplacebo version: v7.349.0 (v6.338.0-120-g7b294350)
|
||||
FFmpeg version: 6.1.1
|
||||
FFmpeg library versions:
|
||||
libavutil 58.29.100
|
||||
libavcodec 60.31.102
|
||||
libavformat 60.16.100
|
||||
libswscale 7.5.100
|
||||
libavfilter 9.12.100
|
||||
libswresample 4.12.100
|
||||
description: |
|
||||
Provide the output of `mpv --version`.
|
||||
render: bash
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: important_information
|
||||
attributes:
|
||||
label: "Important Information"
|
||||
description: >
|
||||
- Platform and Version
|
||||
- GPU model, driver and version
|
||||
- Source of the mpv binary
|
||||
- Latest version of mpv you know without the problem
|
||||
- The time when the problem started to happen (after updating mpv, system, driver, etc.)
|
||||
- Possible screenshot or video of visual glitches
|
||||
|
||||
If you're not using git master or the latest release, update.
|
||||
Packages and builds can be found [here](https://mpv.io/installation/).
|
||||
value: |-
|
||||
- Platform version:
|
||||
- GPU model, driver and version:
|
||||
- Source of mpv:
|
||||
- Latest known working version:
|
||||
- Issue started after the following happened:
|
||||
render: text
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reproduction_steps
|
||||
attributes:
|
||||
label: "Reproduction Steps"
|
||||
description: >
|
||||
Try to reproduce your issue with `--no-config` first. If it isn't reproducible
|
||||
with `--no-config` try to find out which option or script causes your issue.
|
||||
|
||||
|
||||
If the issue is render performance-related, try to reproduce it with `--no-config
|
||||
--profile=fast`, which is designed to work on lower-end mobile devices.
|
||||
|
||||
|
||||
For decoding performance-related issues, additionally try to enable hardware
|
||||
decoding with `--hwdec=yes` or the `Ctrl+h` shortcut.
|
||||
|
||||
|
||||
Describe the reproduction steps as precise as possible. It's very likely that
|
||||
the bug you experience wasn't reproduced by the developer because the workflow
|
||||
differs from your own.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected_behavior
|
||||
attributes:
|
||||
label: "Expected Behavior"
|
||||
placeholder: "What were you expecting?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: actual_behavior
|
||||
attributes:
|
||||
label: "Actual Behavior"
|
||||
placeholder: "What happened instead?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: log_file
|
||||
attributes:
|
||||
label: "Log File"
|
||||
placeholder: "Drag and drop log file here (Don't paste content directly)"
|
||||
description: >
|
||||
Make a log file with `--gpu-debug --log-file=output.txt`, which is our preferred way, and
|
||||
attach it to the issue.
|
||||
|
||||
|
||||
If you have trouble producing a log file, you can alternatively use `--gpu-debug --msg-time -v -v`,
|
||||
save the terminal output to a file, and attach it to the issue.
|
||||
|
||||
|
||||
In the case of a crash, please provide a backtrace.
|
||||
|
||||
|
||||
Without the log file, this issue will be closed for ignoring the issue template.
|
||||
|
||||
|
||||
Disclaimer: The log file may contain identifiable information, such as your username.
|
||||
Review the log file before sharing and redact any sensitive data if necessary.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: sample_files
|
||||
attributes:
|
||||
label: "Sample Files"
|
||||
placeholder: "Drag and drop sample files here"
|
||||
description: >
|
||||
Please provide sample files for a minimal reproduction case, if the issue can't be
|
||||
reproduced without it or it is helpful to demonstrate the issue.
|
||||
|
||||
|
||||
Preferably files should be attached directly within the text field below. Due to GitHub's
|
||||
upload restriction, you may need to archive the sample file first and upload it as `.zip`
|
||||
file. If the sample file is too big to attach directly, use a solution that is easy to
|
||||
access with possible long-term retention. Possible services include, but are not limited
|
||||
to, the following:
|
||||
|
||||
- [0x0.st](https://0x0.st/) (no long-term retention)
|
||||
- [Dropbox](https://www.dropbox.com)
|
||||
- [Google Drive](https://www.google.com/drive/)
|
||||
- [iCLoud Drive](https://www.icloud.com/iclouddrive/)
|
||||
- [MediaFire](https://www.mediafire.com/)
|
||||
- [OneDrive](https://onedrive.live.com/)
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: "I carefully read all instruction and confirm that I did the following:"
|
||||
options:
|
||||
- label: "I tested and confirmed that the issue exists with the [latest release version](https://github.com/mpv-player/mpv/releases/latest) or newer."
|
||||
required: true
|
||||
- label: "I provided all required information including system and mpv version."
|
||||
required: true
|
||||
- label: >-
|
||||
I produced the log file with the exact same set of files, parameters, and conditions
|
||||
used in "Reproduction Steps", with the addition of `--log-file=output.txt`.
|
||||
required: true
|
||||
- label: >-
|
||||
I produced the log file while the behaviors described in "Actual Behavior" were
|
||||
actively observed.
|
||||
required: true
|
||||
- label: "I attached the full, untruncated log file."
|
||||
required: true
|
||||
- label: "I attached the backtrace in the case of a crash."
|
||||
required: true
|
||||
@@ -1,76 +0,0 @@
|
||||
name: "Report a build Problem"
|
||||
description: "Create a report for a build related Issue"
|
||||
labels: ["core:meson"]
|
||||
type: Bug
|
||||
body:
|
||||
- type: textarea
|
||||
id: important_information
|
||||
attributes:
|
||||
label: "Important Information"
|
||||
description: >
|
||||
- mpv version
|
||||
- Platform and Version
|
||||
- Meson version
|
||||
|
||||
If you're not using git master or the latest release, update.
|
||||
Releases are listed [here](https://github.com/mpv-player/mpv/releases).
|
||||
value: |-
|
||||
- mpv version:
|
||||
- Platform version:
|
||||
- Meson version:
|
||||
render: text
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reproduction_steps
|
||||
attributes:
|
||||
label: "Reproduction Steps"
|
||||
description: >
|
||||
Describe the reproduction steps as precise as possible. It's very likely that
|
||||
the bug you experience wasn't reproduced by the developer because the workflow
|
||||
differs from your own.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected_behavior
|
||||
attributes:
|
||||
label: "Expected Behavior"
|
||||
placeholder: "What were you expecting?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: actual_behavior
|
||||
attributes:
|
||||
label: "Actual Behavior"
|
||||
placeholder: "What happened instead?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: log_file
|
||||
attributes:
|
||||
label: "Log File"
|
||||
placeholder: "Drag and drop log file here (Don't paste content directly)"
|
||||
description: >
|
||||
Attach meson-logs/meson-log.txt or meson setup build output to the issue.
|
||||
|
||||
Without the log file, this issue will be closed for ignoring the issue template.
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: "I carefully read all instruction and confirm that I did the following:"
|
||||
options:
|
||||
- label: "I tested and confirmed that the issue exists with the [latest release version](https://github.com/mpv-player/mpv/releases/latest) or newer."
|
||||
required: true
|
||||
- label: "I provided all required information including system and mpv version."
|
||||
required: true
|
||||
- label: >-
|
||||
I produced the log file with the exact same set of parameters, and conditions used in
|
||||
"Reproduction Steps".
|
||||
required: true
|
||||
- label: >-
|
||||
I produced the log file while the behaviors described in "Actual Behavior" were
|
||||
actively observed.
|
||||
required: true
|
||||
- label: "I attached the full, untruncated log file."
|
||||
required: true
|
||||
@@ -1,60 +0,0 @@
|
||||
name: "Request a new Feature"
|
||||
description: "Create a request for a new feature"
|
||||
labels: ["meta:feature-request"]
|
||||
type: Feature
|
||||
body:
|
||||
- type: textarea
|
||||
id: expected_behavior
|
||||
attributes:
|
||||
label: "Expected behavior of the wanted feature"
|
||||
description: >
|
||||
Before requesting a new feature, make sure it hasn't been
|
||||
[requested yet](https://github.com/mpv-player/mpv/labels/meta%3Afeature-request),
|
||||
and isn't already supported by [mpv](https://mpv.io/manual/master/),
|
||||
[ffmpeg](https://ffmpeg.org/documentation.html), or existing
|
||||
[mpv scripts](https://github.com/mpv-player/mpv/wiki/User-Scripts).
|
||||
|
||||
|
||||
If you are not sure about this, ask on
|
||||
[mpv Discussions](https://github.com/mpv-player/mpv/discussions) and
|
||||
[mpv IRC channel](https://mpv.io/community/) first before opening a feature request.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: alternative_behavior
|
||||
attributes:
|
||||
label: "Alternative behavior of the wanted feature"
|
||||
- type: textarea
|
||||
id: log_file
|
||||
attributes:
|
||||
label: "Log File"
|
||||
description: >
|
||||
Even if you think it's not necessary at first, it might help us later to find
|
||||
possible issues. Make a log file with `--log-file=output.txt`, which is our preferred way,
|
||||
and attach it to the issue.
|
||||
|
||||
|
||||
If you have trouble producing a log file, you can alternatively use `-v -v`, save the
|
||||
terminal output to a file, and attach it to the issue.
|
||||
- type: textarea
|
||||
id: sample_files
|
||||
attributes:
|
||||
label: "Sample Files"
|
||||
placeholder: "Drag and drop sample files here"
|
||||
description: >
|
||||
Please provide sample files in the case you request a format/codec/container dependent
|
||||
feature, and it could help us test and implement it.
|
||||
|
||||
|
||||
Preferably files should be attached directly within the text field below. Due to GitHub's
|
||||
upload restriction, you may need to archive the sample file first and upload it as `.zip`
|
||||
file. If the sample file is too big to attach directly, use a solution that is easy to
|
||||
access with possible long-term retention. Possible services include, but are not limited
|
||||
to, the following:
|
||||
|
||||
- [0x0.st](https://0x0.st/) (no long-term retention)
|
||||
- [Dropbox](https://www.dropbox.com)
|
||||
- [Google Drive](https://www.google.com/drive/)
|
||||
- [iCLoud Drive](https://www.icloud.com/iclouddrive/)
|
||||
- [MediaFire](https://www.mediafire.com/)
|
||||
- [OneDrive](https://onedrive.live.com/)
|
||||
@@ -1,12 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: mpv Discussions
|
||||
url: https://github.com/mpv-player/mpv/discussions
|
||||
about: If you have questions or want to discuss things use our GitHub Discussions
|
||||
- name: mpv IRC channel
|
||||
url: https://mpv.io/community/
|
||||
about: Feel free to ask questions here irc://irc.libera.chat/mpv
|
||||
- name: mpv IRC developer channel
|
||||
url: https://mpv.io/community/
|
||||
about: Ask questions related to the development of mpv here
|
||||
irc://irc.libera.chat/mpv-devel
|
||||
@@ -1,5 +0,0 @@
|
||||
Read this before you submit this pull request:
|
||||
https://github.com/mpv-player/mpv/blob/master/DOCS/contribute.md
|
||||
|
||||
Reading this link and following the rules will get your pull request reviewed
|
||||
and merged faster. Nobody wants lazy pull requests.
|
||||
@@ -1,8 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
commit-message:
|
||||
prefix: "ci"
|
||||
@@ -1,786 +0,0 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- ci
|
||||
- 'release/**'
|
||||
paths-ignore:
|
||||
- 'DOCS/**'
|
||||
- 'TOOLS/lua/**'
|
||||
- '.editorconfig'
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
- '.github/PULL_REQUEST_TEMPLATE'
|
||||
- '.gitignore'
|
||||
- 'Copyright'
|
||||
- 'README.md'
|
||||
- 'RELEASE_NOTES'
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths-ignore:
|
||||
- 'DOCS/**'
|
||||
- 'TOOLS/lua/**'
|
||||
- '.editorconfig'
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
- '.github/PULL_REQUEST_TEMPLATE'
|
||||
- '.gitignore'
|
||||
- 'Copyright'
|
||||
- 'README.md'
|
||||
- 'RELEASE_NOTES'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
mingw:
|
||||
runs-on: ubuntu-24.04
|
||||
env:
|
||||
CCACHE_BASEDIR: ${{ github.workspace }}
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
CCACHE_MAXSIZE: 500M
|
||||
DOWNLOAD_CACHE: ${{ github.workspace }}/.ccache/downloads
|
||||
TARGET: ${{ matrix.arch }}-w64-mingw32
|
||||
RUST_TARGET: ${{ matrix.arch }}-pc-windows-gnu
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: i686
|
||||
wine: wine32
|
||||
- arch: x86_64
|
||||
wine: wine64
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Get time
|
||||
id: get_time
|
||||
run: echo "timestamp=`date +%s%N`" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache/restore@v5
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: ${{ env.TARGET }}-${{ steps.get_time.outputs.timestamp }}
|
||||
restore-keys: ${{ env.TARGET }}-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
rustup target add ${{ env.RUST_TARGET }}
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update
|
||||
sudo apt-get install --no-install-recommends -y ccache g++-mingw-w64 gcc-multilib python3-pip nasm ninja-build pkgconf ${{ matrix.wine }} wine
|
||||
python -m pip install meson
|
||||
|
||||
- name: Install Meson Wraps
|
||||
run: |
|
||||
mkdir subprojects -p
|
||||
meson wrap install mujs
|
||||
meson subprojects download
|
||||
|
||||
- name: Build libraries
|
||||
run: |
|
||||
./ci/build-mingw64.sh
|
||||
|
||||
- name: Build with meson
|
||||
id: build
|
||||
run: |
|
||||
./ci/build-mingw64.sh meson pack
|
||||
|
||||
- name: Print meson log
|
||||
if: ${{ failure() && steps.build.outcome == 'failure' }}
|
||||
run: |
|
||||
cat ./mingw_build/meson-logs/meson-log.txt
|
||||
|
||||
- name: Functional test
|
||||
run: |
|
||||
cd artifact && wine ./mpv.com -v --no-config
|
||||
env:
|
||||
WINEDEBUG: '+loaddll'
|
||||
|
||||
- name: Run meson tests
|
||||
id: tests
|
||||
run: |
|
||||
meson test -C mingw_build
|
||||
|
||||
- name: Print meson test log
|
||||
if: ${{ failure() && steps.tests.outcome == 'failure' }}
|
||||
run: |
|
||||
cat ./mingw_build/meson-logs/testlog.txt
|
||||
|
||||
- name: Artifact name
|
||||
id: artifact
|
||||
run: |
|
||||
VERSION_FILE=$(find . -path "*/common/version.h" -type f | head -n 1)
|
||||
VER=$(grep VERSION "$VERSION_FILE" | cut -d'"' -f2)
|
||||
PR=${{ github.event.pull_request.number && format('-pr{0}', github.event.pull_request.number) || '' }}
|
||||
echo "name=mpv-$VER$PR-${{ github.run_id }}-$TARGET" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ steps.artifact.outputs.name }}
|
||||
path: artifact/*
|
||||
|
||||
- name: Save Cache
|
||||
uses: actions/cache/save@v5
|
||||
if: always()
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: ${{ env.TARGET }}-${{ steps.get_time.outputs.timestamp }}
|
||||
|
||||
win32:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- target: x86_64-pc-windows-msvc
|
||||
arch: "x64"
|
||||
os: "windows-2025-vs2026"
|
||||
- target: aarch64-pc-windows-msvc
|
||||
arch: "arm64"
|
||||
os: "windows-11-arm"
|
||||
env:
|
||||
CC: "ccache clang"
|
||||
CXX: "ccache clang++"
|
||||
CC_LD: "lld-link"
|
||||
CXX_LD: "lld-link"
|
||||
RUST_LD: "lld-link"
|
||||
WINDRES: "llvm-rc"
|
||||
CCACHE_BASEDIR: ${{ github.workspace }}
|
||||
CCACHE_DIR: "${{ github.workspace }}\\.ccache"
|
||||
CCACHE_MAXSIZE: 500M
|
||||
steps:
|
||||
- name: Disable autocrlf
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.eol lf
|
||||
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Get time
|
||||
id: get_time
|
||||
run: |
|
||||
"timestamp=$((Get-Date).Ticks)" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache/restore@v5
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: ${{ matrix.target }}-${{ steps.get_time.outputs.timestamp }}
|
||||
restore-keys: ${{ matrix.target }}-
|
||||
|
||||
- name: Install Winget on windows-11-arm
|
||||
if: matrix.os == 'windows-11-arm'
|
||||
shell: pwsh
|
||||
run: |
|
||||
Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force
|
||||
Repair-WinGetPackageManager -Latest -Force
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install meson
|
||||
winget install --accept-source-agreements --accept-package-agreements Ccache.Ccache NASM.NASM
|
||||
echo "$env:LOCALAPPDATA\Microsoft\WinGet\Links" >> $env:GITHUB_PATH
|
||||
# For cargo -C
|
||||
rustup default nightly
|
||||
|
||||
- name: Update Meson WrapDB
|
||||
run: |
|
||||
meson wrap update-db
|
||||
# Explicitly download wraps, as nested projects may have older versions of them.
|
||||
meson wrap install expat
|
||||
meson wrap install harfbuzz
|
||||
meson wrap install libpng
|
||||
meson wrap install zlib
|
||||
|
||||
- name: Find Visual Studio
|
||||
run: |
|
||||
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
$vsPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
||||
if (-not $vsPath) { throw "Could not find a Visual Studio installation" }
|
||||
"VS=$vsPath"
|
||||
"VS=$vsPath" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Build
|
||||
id: build
|
||||
run: |
|
||||
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' -and `
|
||||
$_ -ne 'C:\Program Files\CMake\bin' -and `
|
||||
$_ -ne 'C:\Strawberry\c\bin' }) -join ';'
|
||||
$env:PATH += ';C:\Program Files\NASM'
|
||||
Import-Module "$env:VS\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
|
||||
Enter-VsDevShell -VsInstallPath $env:VS -SkipAutomaticLocation -DevCmdArguments "-arch=${{ matrix.arch }} -host_arch=${{ matrix.arch }}"
|
||||
./ci/build-win32.ps1
|
||||
|
||||
- name: Print build log
|
||||
if: ${{ failure() && steps.build.outcome == 'failure' }}
|
||||
run: |
|
||||
cat ./build/meson-logs/meson-log.txt
|
||||
|
||||
- name: Run meson tests
|
||||
id: tests
|
||||
run: |
|
||||
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' -and `
|
||||
$_ -ne 'C:\Program Files\CMake\bin' -and `
|
||||
$_ -ne 'C:\Strawberry\c\bin' }) -join ';'
|
||||
$env:PATH += ';C:\Program Files\NASM'
|
||||
Import-Module "$env:VS\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
|
||||
Enter-VsDevShell -VsInstallPath $env:VS -SkipAutomaticLocation -DevCmdArguments "-arch=${{ matrix.arch }} -host_arch=${{ matrix.arch }}"
|
||||
meson test -C build -t 2
|
||||
|
||||
- name: Print meson test log
|
||||
if: ${{ failure() && steps.tests.outcome == 'failure' }}
|
||||
run: |
|
||||
cat ./build/meson-logs/testlog.txt
|
||||
|
||||
- name: Artifact name
|
||||
id: artifact
|
||||
run: |
|
||||
$VERSION_FILE = gci . -r -Filter "version.h" | ? { $_.FullName -match "[/\\]common[/\\]version\.h$" } | select -First 1 -exp FullName
|
||||
$VER = (sls $VERSION_FILE -Pattern 'VERSION').Line -replace '.*"([^"]+)".*', '$1'
|
||||
$PR = if ("${{ github.event.pull_request.number }}") { "-pr${{ github.event.pull_request.number }}" } else { "" }
|
||||
$name = "mpv-$VER$PR-${{ github.run_id }}-${{ matrix.target }}"
|
||||
"name=$name" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ steps.artifact.outputs.name }}
|
||||
path: |
|
||||
build/mpv.???
|
||||
build/mpv-*.bat
|
||||
build/vulkan-*.dll
|
||||
!build/mpv.lib
|
||||
!build/mpv.pdb
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ steps.artifact.outputs.name }}-pdb
|
||||
path: |
|
||||
build/mpv.pdb
|
||||
|
||||
- name: Save Cache
|
||||
uses: actions/cache/save@v5
|
||||
if: always()
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: ${{ matrix.target }}-${{ steps.get_time.outputs.timestamp }}
|
||||
|
||||
macos:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: "macos-14"
|
||||
arch: "arm"
|
||||
xcode: "Xcode_15.0"
|
||||
- os: "macos-15"
|
||||
arch: "arm"
|
||||
- os: "macos-15-intel"
|
||||
- os: "macos-26"
|
||||
arch: "arm"
|
||||
- os: "macos-26"
|
||||
arch: "test"
|
||||
swift: "-target arm64-apple-macosx10.15"
|
||||
target: "10.15"
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Remove stray upstream python binary symlinks under /usr/local
|
||||
run: |
|
||||
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete -print
|
||||
brew unlink python && brew link --overwrite python
|
||||
|
||||
- name: Unlink pkg-config if the CI runner happens to have it already installed
|
||||
run: |
|
||||
find "$(brew config | grep HOMEBREW_PREFIX | cut -f 2- -d ' ')/bin" -lname '*/pkg-config@0*/*' -print -exec brew unlink pkg-config@0.29.2 \; -quit
|
||||
|
||||
- name: Change Xcode version
|
||||
if: ${{ matrix.xcode != '' }}
|
||||
run: |
|
||||
sudo xcode-select -s /Applications/${{ matrix.xcode }}.app
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
if [[ -n "${{ matrix.homebrew }}" ]]; then
|
||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
cd "$(brew --repo homebrew/core)"
|
||||
git checkout --force ${{ matrix.homebrew }}
|
||||
else
|
||||
brew update
|
||||
fi
|
||||
if brew list ffmpeg &> /dev/null; then brew unlink ffmpeg; fi
|
||||
brew install -q autoconf automake curl pkgconf libtool python freetype fribidi little-cms2 \
|
||||
luajit libass ffmpeg-full meson rust uchardet mujs libplacebo molten-vk vulkan-loader vulkan-headers \
|
||||
libarchive libbluray libcaca libcdio-paranoia libdvdnav rubberband zimg
|
||||
brew link ffmpeg-full
|
||||
|
||||
- name: Build with meson
|
||||
id: build
|
||||
run: |
|
||||
./ci/build-macos.sh
|
||||
env:
|
||||
TRAVIS_OS_NAME: "${{ matrix.os }}"
|
||||
SWIFT_FLAGS: "${{ matrix.swift }}"
|
||||
MACOSX_DEPLOYMENT_TARGET: "${{ matrix.target }}"
|
||||
|
||||
- name: Create App Bundle
|
||||
if: ${{ matrix.arch != 'test' }}
|
||||
run: |
|
||||
meson compile -C build macos-bundle
|
||||
tar -czvf mpv.tar.gz -C build mpv.app
|
||||
|
||||
- name: Print meson log
|
||||
if: ${{ failure() && steps.build.outcome == 'failure' }}
|
||||
run: |
|
||||
cat ./build/meson-logs/meson-log.txt
|
||||
|
||||
- name: Run meson tests
|
||||
id: tests
|
||||
run: |
|
||||
meson test -C build
|
||||
|
||||
- name: Print meson test log
|
||||
if: ${{ failure() && steps.tests.outcome == 'failure' }}
|
||||
run: |
|
||||
cat ./build/meson-logs/testlog.txt
|
||||
|
||||
- name: Artifact name
|
||||
id: artifact
|
||||
run: |
|
||||
VERSION_FILE=$(find . -path "*/common/version.h" -type f | head -n 1)
|
||||
VER=$(grep VERSION "$VERSION_FILE" | cut -d'"' -f2)
|
||||
TARGET=${{ matrix.os }}${{ matrix.arch != '' && format('-{0}', matrix.arch) || '' }}
|
||||
PR=${{ github.event.pull_request.number && format('-pr{0}', github.event.pull_request.number) || '' }}
|
||||
echo "name=mpv-$VER$PR-${{ github.run_id }}-$TARGET" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
if: ${{ matrix.arch != 'test' }}
|
||||
with:
|
||||
name: ${{ steps.artifact.outputs.name }}
|
||||
path: mpv.tar.gz
|
||||
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: "registry.opensuse.org/home/mia/images/images/mpv-ci:stable-deps"
|
||||
env:
|
||||
CC: "${{ matrix.config.cc }}"
|
||||
CXX: "${{ matrix.config.cxx }}"
|
||||
CC_LD: "${{ matrix.config.ld }}"
|
||||
CXX_LD: "${{ matrix.config.ld }}"
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- cc: "gcc"
|
||||
cxx: "g++"
|
||||
args: "-Db_ndebug=true"
|
||||
- cc: "clang"
|
||||
cxx: "clang++"
|
||||
ld: "lld"
|
||||
args: "-Db_lto=true -Db_lto_mode=thin"
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Build with meson
|
||||
id: build
|
||||
run: |
|
||||
./ci/build-tumbleweed.sh ${{ matrix.config.args }}
|
||||
|
||||
- name: Print meson log
|
||||
if: ${{ failure() && steps.build.outcome == 'failure' }}
|
||||
run: |
|
||||
cat ./build/meson-logs/meson-log.txt
|
||||
|
||||
- name: Run meson tests
|
||||
id: tests
|
||||
run: |
|
||||
meson test -C build
|
||||
|
||||
- name: Print meson test log
|
||||
if: ${{ failure() && steps.tests.outcome == 'failure' }}
|
||||
run: |
|
||||
cat ./build/meson-logs/testlog.txt
|
||||
|
||||
linux-fuzz:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: "registry.opensuse.org/home/mia/images/images/mpv-ci:stable-deps"
|
||||
env:
|
||||
CC: "clang"
|
||||
CXX: "clang++"
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Build with meson
|
||||
id: build
|
||||
run: |
|
||||
meson setup build \
|
||||
--werror \
|
||||
-Dfuzzers=true -Dlibmpv=true -Dcplayer=false
|
||||
meson compile -C build fuzzers
|
||||
|
||||
- name: Print meson log
|
||||
if: ${{ failure() && steps.build.outcome == 'failure' }}
|
||||
run: |
|
||||
cat ./build/meson-logs/meson-log.txt
|
||||
|
||||
linux-ffmpeg-6-1:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# We want to test ffmpeg 6.1.2, which Alpine 3.21 includes.
|
||||
# Also test compatibility with Wayland Protocols 1.38 and Wayland libs 1.23.
|
||||
# Musl support is an added bonus.
|
||||
image: alpine:3.21
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apk update
|
||||
apk add \
|
||||
binutils \
|
||||
curl-dev \
|
||||
ffmpeg-dev \
|
||||
gcc \
|
||||
git \
|
||||
g++ \
|
||||
libass-dev \
|
||||
lua5.2-dev \
|
||||
pulseaudio-dev \
|
||||
libplacebo-dev \
|
||||
libx11-dev \
|
||||
libxfixes-dev \
|
||||
libxkbcommon-dev \
|
||||
libxrandr-dev \
|
||||
libxpresent-dev \
|
||||
libxscrnsaver-dev \
|
||||
meson \
|
||||
musl-dev \
|
||||
rust \
|
||||
samurai \
|
||||
wayland-dev \
|
||||
wayland-protocols
|
||||
|
||||
- name: Build with meson
|
||||
id: build
|
||||
run: |
|
||||
./ci/build-linux-old.sh
|
||||
|
||||
- name: Print meson log
|
||||
if: ${{ failure() && steps.build.outcome == 'failure' }}
|
||||
run: |
|
||||
cat ./build/meson-logs/meson-log.txt
|
||||
|
||||
- name: Run meson tests
|
||||
id: tests
|
||||
run: |
|
||||
meson test -C build
|
||||
|
||||
- name: Print meson test log
|
||||
if: ${{ failure() && steps.tests.outcome == 'failure' }}
|
||||
run: |
|
||||
cat ./build/meson-logs/testlog.txt
|
||||
|
||||
openbsd:
|
||||
runs-on: ubuntu-latest # until https://github.com/actions/runner/issues/385
|
||||
timeout-minutes: 15 # avoid any weirdness with the VM
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Test in OpenBSD VM
|
||||
uses: cross-platform-actions/action@v1.1.0
|
||||
with:
|
||||
operating_system: openbsd
|
||||
version: '7.8'
|
||||
run: |
|
||||
sudo pkg_add -U \
|
||||
cmake \
|
||||
curl \
|
||||
ffmpeg \
|
||||
git \
|
||||
libarchive \
|
||||
libbluray \
|
||||
libcaca \
|
||||
libcdio-paranoia \
|
||||
libdvdnav \
|
||||
libiconv \
|
||||
libplacebo \
|
||||
libv4l \
|
||||
libxkbcommon \
|
||||
luajit \
|
||||
meson \
|
||||
openal \
|
||||
pkgconf \
|
||||
pulseaudio \
|
||||
python3 \
|
||||
rubberband \
|
||||
rust \
|
||||
sdl2 \
|
||||
shaderc \
|
||||
spirv-cross \
|
||||
spirv-headers \
|
||||
uchardet \
|
||||
vulkan-loader \
|
||||
vulkan-headers \
|
||||
zimg
|
||||
./ci/build-openbsd.sh
|
||||
if ! meson test -C build; then
|
||||
cat ./build/meson-logs/testlog.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
freebsd:
|
||||
runs-on: ubuntu-latest # until https://github.com/actions/runner/issues/385
|
||||
timeout-minutes: 15 # avoid any weirdness with the VM
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Test in FreeBSD VM
|
||||
uses: cross-platform-actions/action@v1.1.0
|
||||
with:
|
||||
operating_system: freebsd
|
||||
version: '15.0'
|
||||
run: |
|
||||
sudo pkg update
|
||||
sudo pkg install -y \
|
||||
alsa-lib \
|
||||
cmake \
|
||||
curl \
|
||||
evdev-proto \
|
||||
ffmpeg \
|
||||
git \
|
||||
iconv \
|
||||
jackit \
|
||||
libarchive \
|
||||
libbluray \
|
||||
libcaca \
|
||||
libcdio-paranoia \
|
||||
libdvdnav \
|
||||
libdisplay-info \
|
||||
libplacebo \
|
||||
libXinerama \
|
||||
libxkbcommon \
|
||||
libXpresent \
|
||||
libXv \
|
||||
luajit \
|
||||
meson \
|
||||
mujs \
|
||||
openal-soft \
|
||||
pipewire \
|
||||
pkgconf \
|
||||
pulseaudio \
|
||||
python3 \
|
||||
rubberband \
|
||||
rust \
|
||||
sekrit-twc-zimg \
|
||||
sdl2 \
|
||||
sndio \
|
||||
uchardet \
|
||||
v4l_compat \
|
||||
vulkan-headers \
|
||||
wayland-protocols
|
||||
./ci/build-freebsd.sh
|
||||
if ! meson test -C build; then
|
||||
cat ./build/meson-logs/testlog.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
msys2:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- sys: "clang64"
|
||||
os: "windows-2025-vs2026"
|
||||
auto-var-init: "uninitialized"
|
||||
- sys: "clang64"
|
||||
os: "windows-2025-vs2026"
|
||||
asan: true
|
||||
- sys: "clang64"
|
||||
os: "windows-2025-vs2026"
|
||||
auto-var-init: "zero"
|
||||
- sys: "clang64"
|
||||
os: "windows-2025-vs2026"
|
||||
auto-var-init: "pattern"
|
||||
- sys: "mingw64"
|
||||
os: "windows-2025-vs2026"
|
||||
- sys: "ucrt64"
|
||||
os: "windows-2025-vs2026"
|
||||
- sys: "clangarm64"
|
||||
os: "windows-11-arm"
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
steps:
|
||||
- name: Disable autocrlf
|
||||
shell: pwsh
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.eol lf
|
||||
- uses: actions/checkout@v6
|
||||
- uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.sys }}
|
||||
update: true
|
||||
install: git
|
||||
pacboy: >-
|
||||
amf-headers:p
|
||||
angleproject:p
|
||||
ca-certificates:p
|
||||
cc:p
|
||||
cppwinrt:p
|
||||
curl:p
|
||||
ffmpeg:p
|
||||
lcms2:p
|
||||
libarchive:p
|
||||
libass:p
|
||||
libcdio-paranoia:p
|
||||
libdvdnav:p
|
||||
libjpeg-turbo:p
|
||||
libplacebo:p
|
||||
lua51:p
|
||||
meson:p
|
||||
ninja:p
|
||||
pkgconf:p
|
||||
python:p
|
||||
rst2pdf:p
|
||||
rubberband:p
|
||||
rust:p
|
||||
shaderc:p
|
||||
spirv-cross:p
|
||||
uchardet:p
|
||||
vapoursynth:p
|
||||
vulkan-devel:p
|
||||
|
||||
- name: Build with meson
|
||||
id: build
|
||||
run: |
|
||||
./ci/build-msys2.sh meson
|
||||
env:
|
||||
SYS: ${{ matrix.sys }}
|
||||
ASAN: ${{ matrix.asan }}
|
||||
AUTO_VAR_INIT: ${{ matrix.auto-var-init }}
|
||||
|
||||
- name: Print meson log
|
||||
if: ${{ failure() && steps.build.outcome == 'failure' }}
|
||||
run: |
|
||||
cat ./build/meson-logs/meson-log.txt
|
||||
|
||||
- name: Run meson tests
|
||||
id: tests
|
||||
run: |
|
||||
meson test -C build
|
||||
env:
|
||||
GGML_NO_BACKTRACE: 1
|
||||
|
||||
- name: Print meson test log
|
||||
if: ${{ failure() && steps.tests.outcome == 'failure' }}
|
||||
run: |
|
||||
cat ./build/meson-logs/testlog.txt
|
||||
|
||||
publish:
|
||||
name: Publish git release
|
||||
needs: [mingw, win32, macos]
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' &&
|
||||
github.repository == 'mpv-player/mpv'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
actions: read
|
||||
concurrency:
|
||||
group: publish-git
|
||||
cancel-in-progress: false
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Publish to git release
|
||||
env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -eu
|
||||
tag=git-release
|
||||
base_url="https://github.com/$GH_REPO/releases/download/$tag"
|
||||
|
||||
artifacts=$(gh api "repos/{owner}/{repo}/actions/runs/${{ github.run_id }}/artifacts")
|
||||
|
||||
# Attach every build artifact unchanged; the notes link to them with
|
||||
# labels derived from the verbose names.
|
||||
mkdir -p release
|
||||
jq -r '.artifacts[] | "\(.id)\t\(.name)"' <<< "$artifacts" |
|
||||
while IFS=$'\t' read -r id name; do
|
||||
gh api "repos/{owner}/{repo}/actions/artifacts/$id/zip" > "release/$name.zip"
|
||||
done
|
||||
|
||||
section() {
|
||||
jq -r --arg url "$base_url" --arg re "$1" '
|
||||
def pretty:
|
||||
(if test("i686") then "i686"
|
||||
elif test("aarch64") then "arm64"
|
||||
elif test("-arm$") then "arm64"
|
||||
elif test("intel") then "x86_64"
|
||||
else "x86_64" end) as $arch
|
||||
| [ (if test("mingw") then "GCC" elif test("msvc") then "Clang" else empty end),
|
||||
(if test("macos") then "macOS " + capture("macos-(?<v>[0-9]+)").v else empty end),
|
||||
(if test("-pdb") then "debug symbols" else empty end) ] as $q
|
||||
| $arch + (if ($q | length) > 0 then " (" + ($q | join(", ")) + ")" else "" end);
|
||||
# primary builds first (x86_64, arm64, i686; Clang before GCC), debug symbols last
|
||||
def rank:
|
||||
[ (if test("-pdb") then 1 else 0 end),
|
||||
(if test("x86_64|intel") then 0 elif test("i686") then 2 else 1 end),
|
||||
(if test("mingw") then 1 else 0 end),
|
||||
(if test("macos") then (capture("macos-(?<v>[0-9]+)").v | tonumber) else 0 end) ];
|
||||
[ .artifacts[] | select(.name | test($re)) ] | sort_by(.name | rank)
|
||||
| map("* [\(.name | pretty)](\($url)/\(.name).zip)") | join("\n")
|
||||
' <<< "$artifacts"
|
||||
}
|
||||
|
||||
# Match the version string baked into the build (see common/meson.build).
|
||||
version=$(git describe --abbrev=9 --tags --dirty)
|
||||
notes=$(cat <<EOF
|
||||
Automated development build of the latest \`master\` branch.
|
||||
|
||||
- Version: \`$version\`
|
||||
- Commit: ${{ github.sha }}
|
||||
- Built: $(date -u '+%Y-%m-%d %H:%M:%S UTC')
|
||||
|
||||
### Windows
|
||||
|
||||
$(section 'w64|msvc')
|
||||
|
||||
### macOS
|
||||
|
||||
$(section 'macos')
|
||||
|
||||
> [!WARNING]
|
||||
> These are untested development builds of the very latest \`master\`.
|
||||
> They are **not** official releases. For stable builds see the
|
||||
> [latest release](https://github.com/$GH_REPO/releases/latest).
|
||||
EOF
|
||||
)
|
||||
|
||||
# Create the release once (which also creates the tag), then only edit
|
||||
# it in place so watchers aren't notified on every master push. Stale
|
||||
# assets are dropped first since their names embed the run id.
|
||||
if gh release view "$tag" >/dev/null 2>&1; then
|
||||
gh release view "$tag" --json assets --jq '.assets[].name' |
|
||||
while read -r asset; do
|
||||
gh release delete-asset "$tag" "$asset" --yes
|
||||
done
|
||||
gh release edit "$tag" \
|
||||
--prerelease \
|
||||
--latest=false \
|
||||
--title "mpv development build" \
|
||||
--notes "$notes"
|
||||
gh release upload "$tag" release/*
|
||||
else
|
||||
gh release create "$tag" \
|
||||
--target "$GITHUB_SHA" \
|
||||
--prerelease \
|
||||
--latest=false \
|
||||
--title "mpv development build" \
|
||||
--notes "$notes" \
|
||||
release/*
|
||||
fi
|
||||
@@ -1,48 +0,0 @@
|
||||
name: Cleanup caches
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [build]
|
||||
types: [completed]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
cache:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: |
|
||||
gh cache list -L 100 --json id,key,ref -S last_accessed_at -O desc --jq '
|
||||
map(select(.key | startswith("x86_64-w64-mingw32-") or
|
||||
startswith("i686-w64-mingw32-") or
|
||||
startswith("aarch64-pc-windows-msvc-") or
|
||||
startswith("x86_64-pc-windows-msvc-"))) |
|
||||
group_by(.ref) |
|
||||
map({
|
||||
ref: .[0].ref,
|
||||
caches: map({
|
||||
key: .key,
|
||||
prefix: (.key | capture("^(?<prefix>[\\w_-]+-)\\d+$").prefix)
|
||||
}) | group_by(.prefix) | map({keys: map(.key)})
|
||||
}) |
|
||||
.[]
|
||||
' |
|
||||
while read -r group; do
|
||||
pr=$(echo "$group" | jq -r '.ref | capture("refs/pull/(?<num>[0-9]+)/merge").num')
|
||||
if [[ -n "$pr" ]] && [ "$(gh pr view $pr --json state --jq '.state')" != "OPEN" ]; then
|
||||
keys=$(echo "$group" | jq -c '.caches | map(.keys) | .[]')
|
||||
else
|
||||
keys=$(echo "$group" | jq -c '.caches | map(.keys[1:]) | .[]')
|
||||
fi
|
||||
for key in $(echo "$keys" | jq -r '.[]'); do
|
||||
gh cache delete "$key"
|
||||
done
|
||||
done
|
||||
env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -1,55 +0,0 @@
|
||||
name: comment
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [build]
|
||||
types: [completed]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
pr_comment:
|
||||
if: github.event.workflow_run.event == 'pull_request' &&
|
||||
github.event.workflow_run.conclusion == 'success'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
pr=$(gh pr list --state open --json headRefOid,number \
|
||||
--jq '.[] | select(.headRefOid == "${{ github.event.workflow_run.head_sha }}") | .number')
|
||||
if [ -z "$pr" ]; then
|
||||
echo "No matching open pull request found"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
artifacts=$(gh api repos/{owner}/{repo}/actions/runs/${{ github.event.workflow_run.id }}/artifacts --jq '.artifacts')
|
||||
if [ "$(echo "$artifacts" | jq 'length')" -eq 0 ]; then
|
||||
echo "No artifacts found"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
body=$(echo "$artifacts" | jq -r '
|
||||
def link: "https://nightly.link/${{ github.repository }}/actions/artifacts/\(.id).zip";
|
||||
def entry: "* [\(.name)](\(link))";
|
||||
"Download the artifacts for this pull request:\n<details><summary>Windows</summary>\n\n" +
|
||||
(sort_by(.name) | map(select(.name | test("w64|msvc")) | entry) | join("\n")) +
|
||||
"\n</details>\n<details><summary>macOS</summary>\n\n" +
|
||||
(sort_by(.name) | map(select(.name | test("macos")) | entry) | join("\n")) +
|
||||
"\n</details>"
|
||||
')
|
||||
|
||||
comment_id=$(gh issue view $pr --json comments \
|
||||
--jq '.comments[] | select(.author.login == "github-actions") | .id')
|
||||
if [ -n "$comment_id" ]; then
|
||||
edit=--edit-last
|
||||
fi
|
||||
gh pr comment $pr --body "$body" $edit
|
||||
@@ -1,30 +0,0 @@
|
||||
name: docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- ci
|
||||
- 'release/**'
|
||||
paths:
|
||||
- 'DOCS/**'
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'DOCS/**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check-docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Docs
|
||||
run: |
|
||||
sudo apt-get install --no-install-recommends -y python3-docutils rst2pdf
|
||||
./TOOLS/docutils-wrapper.py rst2man --strip-elements-with-class=contents --halt=2 ./DOCS/man/mpv.rst mpv.1
|
||||
./TOOLS/docutils-wrapper.py rst2html --halt=2 ./DOCS/man/mpv.rst mpv.html
|
||||
./TOOLS/docutils-wrapper.py rst2pdf -c -b 1 --repeat-table-rows ./DOCS/man/mpv.rst -o mpv.pdf
|
||||
@@ -1,61 +0,0 @@
|
||||
name: Pull Request Fuzzing
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths-ignore:
|
||||
- 'DOCS/**'
|
||||
- 'TOOLS/lua/**'
|
||||
- '.editorconfig'
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
- '.github/PULL_REQUEST_TEMPLATE'
|
||||
- '.gitignore'
|
||||
- 'Copyright'
|
||||
- 'README.md'
|
||||
- 'RELEASE_NOTES'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
Fuzzing:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
security-events: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sanitizer: [address, undefined, memory]
|
||||
steps:
|
||||
- name: Build Fuzzers (${{ matrix.sanitizer }})
|
||||
id: build
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'mpv'
|
||||
language: c
|
||||
sanitizer: ${{ matrix.sanitizer }}
|
||||
- name: Run Fuzzers (${{ matrix.sanitizer }})
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'mpv'
|
||||
language: c
|
||||
fuzz-seconds: 1200
|
||||
sanitizer: ${{ matrix.sanitizer }}
|
||||
report-ooms: true
|
||||
report-timeouts: true
|
||||
output-sarif: true
|
||||
- name: Upload Crash
|
||||
uses: actions/upload-artifact@v7
|
||||
if: failure() && steps.build.outcome == 'success'
|
||||
with:
|
||||
name: ${{ matrix.sanitizer }}-artifacts
|
||||
path: ./out/artifacts
|
||||
- name: Upload Sarif
|
||||
if: always() && steps.build.outcome == 'success'
|
||||
uses: github/codeql-action/upload-sarif@v4
|
||||
with:
|
||||
sarif_file: cifuzz-sarif/results.sarif
|
||||
checkout_path: cifuzz-sarif
|
||||
@@ -1,75 +0,0 @@
|
||||
name: lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- ci
|
||||
- 'release/**'
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
commit-msg:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 50
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
./ci/lint-commit-msg.py
|
||||
|
||||
swift:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: norio-nomura/action-swiftlint@3.2.1
|
||||
|
||||
lua:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: lunarmodules/luacheck@v1
|
||||
|
||||
ruff:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Check
|
||||
id: check
|
||||
uses: astral-sh/ruff-action@v3
|
||||
with:
|
||||
src: ". TOOLS/umpv"
|
||||
- name: Suggested changes
|
||||
if: ${{ failure() && steps.check.outcome == 'failure' }}
|
||||
run: ruff check . TOOLS/umpv --diff
|
||||
|
||||
mypy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: python/mypy@master
|
||||
with:
|
||||
install_project_dependencies: no
|
||||
options: '--check-untyped-defs'
|
||||
paths: ". TOOLS/umpv"
|
||||
|
||||
editorconfig:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: editorconfig-checker/action-editorconfig-checker@main
|
||||
- run: editorconfig-checker -config .editorconfig-checker.json
|
||||
|
||||
pre-commit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: pre-commit/action@v3.0.1
|
||||
+38
-3
@@ -1,3 +1,38 @@
|
||||
/subprojects/*
|
||||
!/subprojects/packagefiles
|
||||
!/subprojects/*.wrap
|
||||
*.o
|
||||
*.a
|
||||
*.d
|
||||
*.exe
|
||||
*.pyc
|
||||
.depend
|
||||
|
||||
/config.h
|
||||
/config.mak
|
||||
/config.log
|
||||
/mpv
|
||||
/mpv.app
|
||||
/version.h
|
||||
/input/input_conf.h
|
||||
/tags
|
||||
/TAGS
|
||||
/video/out/x11_icon.inc
|
||||
/video/out/opengl/nnedi3_weights.inc
|
||||
/demux/ebml_defs.c
|
||||
/demux/ebml_types.h
|
||||
/sub/osd_font.h
|
||||
/player/lua/*.inc
|
||||
/DOCS/man/mpv.1
|
||||
/DOCS/man/mpv.aux
|
||||
/DOCS/man/mpv.log
|
||||
/DOCS/man/mpv.out
|
||||
/DOCS/man/mpv.pdf
|
||||
/DOCS/man/mpv.toc
|
||||
|
||||
/waf
|
||||
/waf-*
|
||||
/waf3-*
|
||||
/build
|
||||
/.waf*
|
||||
/.lock-waf_*
|
||||
|
||||
/old_build
|
||||
/Makefile
|
||||
-110
@@ -1,110 +0,0 @@
|
||||
local mp_globals = {
|
||||
mp = {
|
||||
fields = {
|
||||
command = {},
|
||||
commandv = {},
|
||||
command_native = {},
|
||||
command_native_async = {},
|
||||
add_hook = {},
|
||||
abort_async_command = {},
|
||||
del_property = {},
|
||||
get_property = {},
|
||||
get_property_osd = {},
|
||||
get_property_bool = {},
|
||||
get_property_number = {},
|
||||
get_property_native = {},
|
||||
set_property = {},
|
||||
set_property_bool = {},
|
||||
set_property_number = {},
|
||||
set_property_native = {},
|
||||
get_time = {},
|
||||
add_key_binding = {},
|
||||
add_forced_key_binding = {},
|
||||
remove_key_binding = {},
|
||||
register_event = {},
|
||||
unregister_event = {},
|
||||
observe_property = {},
|
||||
unobserve_property = {},
|
||||
add_timeout = {},
|
||||
add_periodic_timer = {},
|
||||
get_opt = {},
|
||||
get_script_name = {},
|
||||
get_script_directory = {},
|
||||
osd_message = {},
|
||||
get_wakeup_pipe = {},
|
||||
get_next_timeout = {},
|
||||
dispatch_events = {},
|
||||
register_idle = {},
|
||||
unregister_idle = {},
|
||||
enable_messages = {},
|
||||
register_script_message = {},
|
||||
unregister_script_message = {},
|
||||
create_osd_overlay = {},
|
||||
get_osd_size = {},
|
||||
msg = {
|
||||
fields = {
|
||||
fatal = {},
|
||||
error = {},
|
||||
warn = {},
|
||||
info = {},
|
||||
verbose = {},
|
||||
debug = {},
|
||||
trace = {},
|
||||
}
|
||||
},
|
||||
-- Not documented
|
||||
-- TODO: Document or remove them
|
||||
disable_key_bindings = {},
|
||||
enable_key_bindings = {},
|
||||
find_config_file = {},
|
||||
flush_keybindings = {},
|
||||
format_time = {},
|
||||
get_mouse_pos = {},
|
||||
set_key_bindings = {},
|
||||
set_mouse_area = {},
|
||||
set_osd_ass = {},
|
||||
}
|
||||
},
|
||||
exit = {},
|
||||
unpack = {},
|
||||
}
|
||||
|
||||
local mp_internal = {
|
||||
mp = {
|
||||
fields = {
|
||||
-- Internal
|
||||
-- TODO: Move to mp_internal module
|
||||
ARRAY = { fields = { info = {}, type = {} }},
|
||||
MAP = { fields = { info = {}, type = {} }},
|
||||
UNKNOWN_TYPE = { fields = { info = {}, type = {} }},
|
||||
_legacy_overlay = { fields = { res_x = {}, res_y = {}, data = {}, update = {} }},
|
||||
cancel_timer = {},
|
||||
get_osd_margins = {},
|
||||
input_define_section = {},
|
||||
input_disable_section = {},
|
||||
input_enable_section = {},
|
||||
input_set_section_mouse_area = {},
|
||||
keep_running = {},
|
||||
log = {},
|
||||
raw_abort_async_command = {},
|
||||
raw_command_native_async = {},
|
||||
raw_hook_add = {},
|
||||
raw_hook_continue = {},
|
||||
raw_observe_property = {},
|
||||
raw_unobserve_property = {},
|
||||
raw_wait_event = {},
|
||||
request_event = {},
|
||||
script_name = {},
|
||||
use_suspend = {},
|
||||
wait_event = {},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std = "min+mp"
|
||||
stds = { mp = { read_globals = mp_globals } }
|
||||
-- mp_internal seems to be merged with mp for other files too...
|
||||
files["player/lua/defaults.lua"] = { globals = mp_internal }
|
||||
files["player/lua/auto_profiles.lua"] = { globals = { "p", "get" } }
|
||||
files["player/lua/select.lua"] = { globals = { "p", "get" } }
|
||||
max_line_length = 100
|
||||
@@ -1,23 +0,0 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: check-case-conflict
|
||||
- id: check-executables-have-shebangs
|
||||
- id: check-illegal-windows-names
|
||||
- id: check-json
|
||||
- id: check-shebang-scripts-are-executable
|
||||
- id: check-xml
|
||||
exclude: ^TOOLS/mpv-osd-symbols.sfdir/font.props$
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
exclude: ^TOOLS/osxbundle/mpv.app/Contents/PkgInfo$
|
||||
- id: fix-byte-order-marker
|
||||
- id: mixed-line-ending
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.3.0
|
||||
hooks:
|
||||
- id: codespell
|
||||
args: ["--ignore-words-list", "ALS,als,datas,DNE,enew,HDA,numer,ontop,optionA,Paeth,pathc,inout,requestor"]
|
||||
exclude: ^(etc/menu.conf|misc/language.c)$
|
||||
@@ -1,10 +0,0 @@
|
||||
disabled_rules:
|
||||
- identifier_name
|
||||
- line_length
|
||||
- large_tuple
|
||||
- void_function_in_ternary
|
||||
- function_body_length
|
||||
- cyclomatic_complexity
|
||||
- file_length
|
||||
- type_body_length
|
||||
strict: true
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
language: c
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
env:
|
||||
matrix:
|
||||
- LIBAV=libav-stable
|
||||
- LIBAV=libav-git
|
||||
- LIBAV=ffmpeg-stable
|
||||
- LIBAV=ffmpeg-git
|
||||
global:
|
||||
# Coverity token
|
||||
- secure: "H21mSRlMhk4BKS0xHZvCFGJxteCP0hRVUxTuNfM2Z9HBsyutuLEYMtViLO86VtM+Tqla3xXPzUdS4ozLwI72Ax/5ZUDXACROj73yW6QhFB5D6rLut12+FjqC7M33Qv2hl0xwgNBmR5dsm1ToP37+Wn+ecJQNvN8fkTXF+HVzOEw="
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- ci
|
||||
- coverity_scan
|
||||
|
||||
matrix:
|
||||
exclude:
|
||||
- os: osx
|
||||
env: LIBAV=libav-stable
|
||||
- os: osx
|
||||
env: LIBAV=libav-git
|
||||
- os: osx
|
||||
env: LIBAV=ffmpeg-git
|
||||
- os: osx
|
||||
compiler: gcc
|
||||
- os: linux
|
||||
env: LIBAV=ffmpeg-stable
|
||||
- os: linux
|
||||
compiler: clang
|
||||
|
||||
before_install: ./travis-deps libass-stable $LIBAV
|
||||
script:
|
||||
- ./bootstrap.py
|
||||
- ./waf configure
|
||||
- ./waf build
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
irc:
|
||||
channels:
|
||||
- "irc.freenode.org#mpv-devel"
|
||||
on_success: change
|
||||
on_failure: always
|
||||
|
||||
addons:
|
||||
coverity_scan:
|
||||
project:
|
||||
name: "mpv-player/mpv"
|
||||
description: "Build submitted via Travis CI"
|
||||
notification_email: mpv-team@googlegroups.com
|
||||
build_command_prepend: "./bootstrap.py && ./waf configure"
|
||||
build_command: "./waf build"
|
||||
branch_pattern: coverity_scan
|
||||
@@ -0,0 +1,32 @@
|
||||
Reporting bugs
|
||||
==============
|
||||
|
||||
- State your platform and mpv version.
|
||||
- Make sure you're actually using the latest mpv release. Linux distributions
|
||||
in particular love redistributing ancient and unmaintained mpv releases.
|
||||
- Attach a log file made with ``-v`` or ``--log-file=output.txt``.
|
||||
- Avoid attaching text files packed in archive files (zip/rar/...), unless
|
||||
explicitly asked so. There are better means, such as using http://sprunge.us
|
||||
- If you think this is file specific, upload a sample file and link it.
|
||||
- Don't report multiple unrelated/barely related bugs in one issue.
|
||||
- If you don't get a reply after days, be sure to post a new message to the
|
||||
issue - it could have been overlooked or forgotten.
|
||||
- Read: https://mpv.io/bug-reports/
|
||||
|
||||
Asking questions
|
||||
================
|
||||
|
||||
Preferably, asking questions should be done via IRC (#mpv on irc.freenode.net),
|
||||
but asking questions by opening a github issue is also barely tolerated.
|
||||
|
||||
When asking on IRC (#mpv on irc.freenode.net), don't ask to ask, just state
|
||||
your problem. Stay long enough until someone gets a chance to reply. Sometimes
|
||||
it can take hours.
|
||||
|
||||
Sending patches
|
||||
===============
|
||||
|
||||
See: https://github.com/mpv-player/mpv/blob/master/DOCS/contribute.md
|
||||
|
||||
In particular, be aware that all changes to GPL code must come with the
|
||||
implicit agreement that they might be LGPLv2.1+ relicensed at a later point.
|
||||
@@ -1,78 +1,30 @@
|
||||
mpv is a fork of mplayer2, which is a fork of MPlayer.
|
||||
|
||||
mpv as a whole is licensed under the GNU General Public License GPL version 2
|
||||
or later (called GPLv2+ in this document, see LICENSE.GPL for full license
|
||||
text) by default. The mpv program is licensed the GNU Lesser General Public
|
||||
License LGPL version 2 or later (LGPLv2.1+ in this document, see LICENSE.LGPL
|
||||
for full license text) if built without using any GPL only files.
|
||||
The -Dgpl=false configure switch is provided as a convenience for excluding
|
||||
the GPL only files listed below from the build process.
|
||||
mpv as a whole is licensed as GPL version 2 or later (see LICENSE). Most source
|
||||
files are GPLv2+, but some files are available under a more liberal license,
|
||||
such as LGPLv2.1+, BSD, MIT, ISC, and possibly others. Look at the copyright
|
||||
header of each source file, and grep the sources for "Copyright" if you need
|
||||
to know details. Files without Copyright notice are licensed as LGPLv2.1+.
|
||||
|
||||
However, do note that the build system is provided "as is" and using the
|
||||
-Dgpl=false configure switch does not in itself create a LGPLv2.1+ license
|
||||
grant.
|
||||
All new contributions must be LGPLv2.1+ licensed, or if the changes are done on
|
||||
GPL code, must come with the implicit agreement that the project can relicense
|
||||
the code to LGPLv2.1+ at a later point without asking the contributor. (This
|
||||
is a safeguard for making potential relicensing of the project to LGPLv2.1+
|
||||
easier.) Using a more liberal license compatible to LGPLv2.1+ is also ok.
|
||||
|
||||
Additionally, some non-program parts, such as the documentation and some config
|
||||
files listed below, are still built and licensed under their respective licenses
|
||||
even when -Dgpl=false is used. Please consult GPLv2+ and LGPLv2.1+ license texts
|
||||
for further details on how to distribute these files.
|
||||
|
||||
Most source files are LGPLv2.1+ or GPLv2+, but some files are available under
|
||||
more liberal licenses, such as BSD, MIT, ISC, and possibly others. Look at the
|
||||
copyright header of each source file, and grep the sources for "Copyright" if
|
||||
you need to know details. C source files without Copyright notice are usually
|
||||
licensed as LGPLv2.1+. Also see the list of files with specific licenses below
|
||||
(not all files can have a standard license header).
|
||||
|
||||
All new contributions must be LGPLv2.1+ licensed. Using a more liberal license
|
||||
compatible to LGPLv2.1+ is also ok.
|
||||
|
||||
Changes done to GPL code must come with the implicit/explicit agreement that the
|
||||
project can relicense the changes to LGPLv2.1+ at a later point without asking
|
||||
the contributor. This is a safeguard for making potential relicensing of
|
||||
remaining GPL code to LGPLv2.1+ easier.
|
||||
|
||||
See DOCS/contribute.md for binding rules wrt. licensing for contributions.
|
||||
Some GPLv3 or LGPLv3 code in mpv can be enabled by building with --enable-gpl3,
|
||||
and in this case, the resulting binaries must be distributed under GPLv3.
|
||||
|
||||
For information about authors and contributors, consult the git log, which
|
||||
contains the complete SVN and CVS history as well.
|
||||
|
||||
mpv can be built as LGPLv2.1+ without using any GPL only files. To add a
|
||||
LGPL mode to mpv, MPlayer code had to be relicensed from GPLv2+ to LGPLv2.1+ by
|
||||
asking the MPlayer authors for permission. Since permission could not be
|
||||
obtained from everyone, LGPL mode disables the following features, some of them
|
||||
quite central:
|
||||
- Linux X11 video output
|
||||
- BSD audio output via OSS
|
||||
- NVIDIA/Linux hardware decoding (vdpau, although nvdec usually works)
|
||||
- minor features: jack, DVD, CDDA, DVB, CACA, legacy direct3d VO
|
||||
Some of these will be fixed in the future. The intended use for LGPL mode is
|
||||
with libmpv, and currently it's not recommended to build mpv CLI in LGPL mode
|
||||
at all.
|
||||
Note that mplayer2 as a whole is licensed under GPLv3+. This is because it uses
|
||||
a copy of talloc (part of Samba), which is LGPLv3+, and the next compatible
|
||||
license for this mix is GPLv3+.
|
||||
|
||||
The following files are still GPL only (-Dgpl=false disables them):
|
||||
MPlayer as a whole is licensed under GPLv2 (incompatible to GPLv3!), because
|
||||
some files are licensed to GPLv2 (and _not_ any later version of the license).
|
||||
In particular, this affects the file libmpdemux/demux_ty_osd.c. It is disabled
|
||||
under mplayer2, and has been removed from mpv.
|
||||
|
||||
audio/out/ao_jack.c will stay GPL
|
||||
audio/out/ao_oss.c will stay GPL
|
||||
stream/dvb* must stay GPL
|
||||
stream/stream_cdda.c unknown
|
||||
stream/stream_dvb.* must stay GPL
|
||||
stream/stream_dvdnav.c unknown
|
||||
video/out/vo_caca.c unknown
|
||||
video/out/vo_direct3d.c unknown
|
||||
video/out/vo_vaapi.c probably impossible (some company's code)
|
||||
video/out/vo_vdpau.c probably impossible (nVidia's code)
|
||||
video/out/vo_x11.c probably impossible
|
||||
video/out/vo_xv.c probably impossible
|
||||
video/out/x11_common.* probably impossible
|
||||
video/vdpau.c hard (GPL-only parts must be ifdefed)
|
||||
video/vdpau.h unknown
|
||||
video/vdpau_mixer.* actual code must be rewritten
|
||||
DOCS/man/ GPLv2+
|
||||
etc/mplayer-input.conf unknown license, probably GPLv2+
|
||||
etc/mpv.desktop unknown license, probably GPLv2+
|
||||
etc/restore-old-bindings.conf unknown license, probably GPLv2+
|
||||
|
||||
None of the cases listed above affect the final binary if it's built as
|
||||
LGPL. Linked libraries still can affect the final license (for example if
|
||||
FFmpeg was built as GPL).
|
||||
"v2.1+" in this context means "version 2.1 or later".
|
||||
+3
-177
@@ -16,7 +16,7 @@ The version number is the same as used for MPV_CLIENT_API_VERSION (see
|
||||
``client.h`` how to convert between major/minor version numbers and the flat
|
||||
32 bit integer).
|
||||
|
||||
Also, read the section ``Compatibility`` in ``client.h``, and compatibility.rst.
|
||||
Also, read the section ``Compatibility`` in ``client.h``.
|
||||
|
||||
Options, commands, properties
|
||||
=============================
|
||||
@@ -32,181 +32,6 @@ API changes
|
||||
|
||||
::
|
||||
|
||||
--- mpv 0.40.0 ---
|
||||
2.5 - Deprecate MPV_RENDER_PARAM_AMBIENT_LIGHT. no replacement.
|
||||
--- mpv 0.39.0 ---
|
||||
2.4 - mpv_render_param with the MPV_RENDER_PARAM_ICC_PROFILE argument no
|
||||
longer has incorrect assumptions about memory allocation and can be
|
||||
correctly used.
|
||||
--- mpv 0.38.0 ---
|
||||
2.3 - partially revert the changes from API version 1.27, remove libmpv as
|
||||
the default VO and move it to the bottom of the auto-probing order.
|
||||
This restores the prior behavior on all platforms other than macOS,
|
||||
but still auto selects libmpv/cocoa-cb on macOS if it was built with
|
||||
support for cocoa-cb.
|
||||
--- mpv 0.37.0 ---
|
||||
2.2 - add mpv_time_ns()
|
||||
--- mpv 0.36.0 ---
|
||||
2.1 - add mpv_del_property()
|
||||
--- mpv 0.35.0 ---
|
||||
2.0 - remove headers/functions of the obsolete opengl_cb API
|
||||
- remove mpv_opengl_init_params.extra_exts field
|
||||
- remove deprecated mpv_detach_destroy. Use mpv_destroy instead.
|
||||
- remove obsolete mpv_suspend and mpv_resume
|
||||
- remove deprecated SCRIPT_INPUT_DISPATCH, PAUSE and UNPAUSE, TRACKS_CHANGED
|
||||
TRACK_SWITCHED, METADATA_UPDATE, CHAPTER_CHANGE events
|
||||
--- mpv 0.33.0 ---
|
||||
1.109 - add MPV_RENDER_API_TYPE_SW and related (software rendering API)
|
||||
- deactivate the opengl_cb API (always fails to initialize now)
|
||||
The opengl_cb API was deprecated over 2 years ago. Use the render API
|
||||
instead.
|
||||
1.108 - Deprecate MPV_EVENT_IDLE
|
||||
- add mpv_event_start_file
|
||||
- add the following fields to mpv_event_end_file: playlist_entry_id,
|
||||
playlist_insert_id, playlist_insert_num_entries
|
||||
- add mpv_event_to_node()
|
||||
- add mpv_client_id()
|
||||
1.107 - Remove the deprecated qthelper.hpp. This was obviously not part of the
|
||||
libmpv API, only an "additionally" provided helper, thus this is not
|
||||
considered an API change. If you are maintaining a project that relies
|
||||
on this header, you can simply download this file and adjust the
|
||||
include statement to use it instead:
|
||||
|
||||
https://raw.githubusercontent.com/mpv-player/mpv/v0.32.0/libmpv/qthelper.hpp
|
||||
|
||||
It is a good idea to write better wrappers for your use, though.
|
||||
--- mpv 0.31.0 ---
|
||||
1.107 - Deprecate MPV_EVENT_TICK
|
||||
--- mpv 0.30.0 ---
|
||||
1.106 - Add cancel_fn to mpv_stream_cb_info
|
||||
1.105 - Fix deadlock problems with MPV_RENDER_PARAM_ADVANCED_CONTROL and if
|
||||
the "vd-lavc-dr" option is enabled (which it is by default).
|
||||
There were no actual API changes.
|
||||
API users on older API versions and mpv releases should set
|
||||
"vd-lavc-dr" to "no" to avoid these issues.
|
||||
API users must still adhere to the tricky rules documented in render.h
|
||||
to avoid other deadlocks.
|
||||
1.104 - Deprecate struct mpv_opengl_drm_params. Replaced by mpv_opengl_drm_params_v2
|
||||
- Deprecate MPV_RENDER_PARAM_DRM_DISPLAY. Replaced by MPV_RENDER_PARAM_DRM_DISPLAY_V2.
|
||||
1.103 - redo handling of async commands
|
||||
- add mpv_event_command and make it possible to return values from
|
||||
commands issued with mpv_command_async() or mpv_command_node_async()
|
||||
- add mpv_abort_async_command()
|
||||
1.102 - rename struct mpv_opengl_drm_osd_size to mpv_opengl_drm_draw_surface_size
|
||||
- rename MPV_RENDER_PARAM_DRM_OSD_SIZE to MPV_RENDER_PARAM_DRM_DRAW_SURFACE_SIZE
|
||||
--- mpv 0.29.0 ---
|
||||
1.101 - add MPV_RENDER_PARAM_ADVANCED_CONTROL and related API
|
||||
- add MPV_RENDER_PARAM_NEXT_FRAME_INFO and related symbols
|
||||
- add MPV_RENDER_PARAM_BLOCK_FOR_TARGET_TIME
|
||||
- add MPV_RENDER_PARAM_SKIP_RENDERING
|
||||
- add mpv_render_context_get_info()
|
||||
1.100 - bump API number to avoid confusion with mpv release versions
|
||||
- actually apply the GL_MP_MPGetNativeDisplay change for the new render
|
||||
API. This also means compatibility for anything but x11 and wayland
|
||||
through the old opengl-cb GL_MP_MPGetNativeDisplay method is now
|
||||
unsupported.
|
||||
- deprecate mpv_get_wakeup_pipe(). It's complex, but easy to replace
|
||||
using normal API (just set a wakeup callback to a function which
|
||||
writes to a pipe).
|
||||
- add a 1st class hook API, which replaces the hacky mpv_command()
|
||||
based one. The old API is deprecated and will be removed soon. The
|
||||
old API was never meant to be stable, while the new API is.
|
||||
1.29 - the behavior of mpv_terminate_destroy() and mpv_detach_destroy()
|
||||
changes subtly (see documentation in the header file). In particular,
|
||||
mpv_detach_destroy() will not leave the player running in all
|
||||
situations anymore (it gets closer to refcounting).
|
||||
- rename mpv_detach_destroy() to mpv_destroy() (the old function will
|
||||
remain valid as deprecated alias)
|
||||
- add mpv_create_weak_client(), which makes use of above changes
|
||||
- MPV_EVENT_SHUTDOWN is now returned exactly once if a mpv_handle
|
||||
should terminate, instead of spamming the event queue with this event
|
||||
1.28 - deprecate the render opengl_cb API, and replace it with render.h
|
||||
and render_gl.h. The goal is allowing support for APIs other than
|
||||
OpenGL. The old API is emulated with the new API.
|
||||
Likewise, the "opengl-cb" VO is renamed to "libmpv".
|
||||
mpv_get_sub_api() is deprecated along the opengl_cb API.
|
||||
The new API is relatively similar, but not the same. The rough
|
||||
equivalents are:
|
||||
mpv_opengl_cb_init_gl => mpv_render_context_create
|
||||
mpv_opengl_cb_set_update_callback => mpv_render_context_set_update_callback
|
||||
mpv_opengl_cb_draw => mpv_render_context_render
|
||||
mpv_opengl_cb_report_flip => mpv_render_context_report_swap
|
||||
mpv_opengl_cb_uninit_gl => mpv_render_context_free
|
||||
The VO opengl-cb is also renamed to "libmpv".
|
||||
Also, the GL_MP_MPGetNativeDisplay pseudo extension is not used by the
|
||||
render API anymore, and the old opengl-cb API only handles the "x11"
|
||||
and "wl" names anymore. Support for everything else has been removed.
|
||||
The new render API uses proper API parameters, e.g. for X11 you pass
|
||||
MPV_RENDER_PARAM_X11_DISPLAY directly.
|
||||
- deprecate the qthelper.hpp header file. This provided some C++ helper
|
||||
utility functions for Qt with use of libmpv. There is no reason to
|
||||
keep this in the mpv git repository, nor to make it part of the libmpv
|
||||
API. If you're using this header, you can safely copy it into your
|
||||
project - it uses only libmpv public API. Alternatively, it could be
|
||||
maintained in a separate repository by interested parties.
|
||||
1.27 - make opengl-cb the default VO. This causes a subtle behavior change
|
||||
if the API user called mpv_opengl_cb_init_gl(), but does not set
|
||||
the "vo" option. Before, it would still have used another VO (like
|
||||
on the CLI, e.g. vo=gpu). Now it'll behave as if vo=opengl-cb was
|
||||
used.
|
||||
--- mpv 0.28.0 ---
|
||||
1.26 - remove glMPGetNativeDisplay("drm") support
|
||||
- add mpv_opengl_cb_window_pos and mpv_opengl_cb_drm_params and
|
||||
support via glMPGetNativeDisplay() for using it
|
||||
- make --stop-playback-on-init-failure=no the default in libmpv (just
|
||||
like in mpv CLI)
|
||||
--- mpv 0.27.0 ---
|
||||
1.25 - remove setting "no-" options via mpv_set_option*(). (See corresponding
|
||||
deprecation in 0.23.0.)
|
||||
--- mpv 0.25.0 ---
|
||||
1.24 - add a MPV_ENABLE_DEPRECATED preprocessor symbol, which can be defined
|
||||
by the user to exclude deprecated API symbols from the C headers
|
||||
--- mpv 0.23.0 ---
|
||||
1.24 - the deprecated mpv_suspend() and mpv_resume() APIs now do nothing.
|
||||
--- mpv 0.22.0 ---
|
||||
1.23 - deprecate setting "no-" options via mpv_set_option*(). For example,
|
||||
instead of "no-video=" you should set "video=no".
|
||||
- do not override the SIGPIPE signal handler anymore. This was done as
|
||||
workaround for the FFmpeg TLS code, which has been fixed long ago.
|
||||
- deprecate mpv_suspend() and mpv_resume(). They will be stubbed out
|
||||
in mpv 0.23.0.
|
||||
- make mpv_set_property() work to some degree before mpv_initialize().
|
||||
It can now be used instead of mpv_set_option().
|
||||
- semi-deprecate mpv_set_option()/mpv_set_option_string(). You should
|
||||
use mpv_set_property() instead. There are some deprecated properties
|
||||
which conflict with some options (see client.h remarks on
|
||||
mpv_set_option()), for which mpv_set_option() might still be required.
|
||||
In future mpv releases, the conflicting deprecated options/properties
|
||||
will be removed, and mpv_set_option() will internally translate API
|
||||
calls to mpv_set_property().
|
||||
- qthelper.hpp: deprecate get_property_variant, set_property_variant,
|
||||
set_option_variant, command_variant, and replace them with
|
||||
get_property, set_property, command.
|
||||
--- mpv 0.19.0 ---
|
||||
1.22 - add stream_cb API for custom protocols
|
||||
--- mpv 0.18.1 ---
|
||||
---- - remove "status" log level from mpv_request_log_messages() docs. This
|
||||
is 100% equivalent to "v". The behavior is still the same, thus no
|
||||
actual API change.
|
||||
--- mpv 0.18.0 ---
|
||||
1.21 - mpv_set_property() changes behavior with MPV_FORMAT_NODE. Before this
|
||||
change it rejected mpv_nodes with format==MPV_FORMAT_STRING if the
|
||||
property was not a string or did not have special mechanisms in place
|
||||
the function failed. Now it always invokes the option string parser,
|
||||
and mpv_node with a basic data type works exactly as if the function
|
||||
is invoked with that type directly. This new behavior is equivalent
|
||||
to mpv_set_option().
|
||||
This also affects the mp.set_property_native() Lua function.
|
||||
- generally, setting choice options/properties with "yes"/"no" options
|
||||
can now be set as MPV_FORMAT_FLAG
|
||||
- reading a choice property as MPV_FORMAT_NODE will now return a
|
||||
MPV_FORMAT_FLAG value if the choice is "yes" (true) or "no" (false)
|
||||
This implicitly affects Lua and JSON IPC interfaces as well.
|
||||
- big changes to vo-cmdline on vo_opengl and vo_opengl_hq (but not
|
||||
vo_opengl_cb): options are now normally not reset, but applied on top
|
||||
of the current options. The special undocumented value "-" still
|
||||
works, but now resets all options to before any vo-cmdline command
|
||||
has been called.
|
||||
--- mpv 0.12.0 ---
|
||||
1.20 - deprecate "GL_MP_D3D_interfaces"/"glMPGetD3DInterface", and introduce
|
||||
"GL_MP_MPGetNativeDisplay"/"glMPGetNativeDisplay" (this is a
|
||||
@@ -285,6 +110,7 @@ API changes
|
||||
- extend the "--start" option; a leading "+", which was previously
|
||||
insignificant is now significant
|
||||
- add "cache-free" and "cache-used" properties
|
||||
- macOS: the "coreaudio" AO spdif code is split into a separate AO
|
||||
- OSX: the "coreaudio" AO spdif code is split into a separate AO
|
||||
--- mpv 0.4.0 ---
|
||||
1.0 - the API is declared stable
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
CLI and API compatibility policy
|
||||
================================
|
||||
|
||||
Human users and API users rely on the mpv/libmpv/scripting/IPC interface not
|
||||
breaking their use case. On the other hand, active development occasionally
|
||||
requires breaking things, such as removing old options or changing options in
|
||||
a way that may break.
|
||||
|
||||
This document lists rules when, what, and how incompatible changes can be made.
|
||||
It's interesting both for mpv developers, who want to change user-visible parts,
|
||||
and mpv users, who want to know what is guaranteed to remain stable.
|
||||
|
||||
Any of the rules below may be overridden by statements in more specific
|
||||
documentation (for example, if the manpage says that a particular option may be
|
||||
removed any time, it means that, and the option probably won't even go through
|
||||
deprecation).
|
||||
|
||||
Additions
|
||||
---------
|
||||
|
||||
Additions are basically always allowed. API users etc. are supposed to deal with
|
||||
the possibility that for example new API functions are added. Some parts of the
|
||||
API may document how they are extended.
|
||||
|
||||
Options, commands, properties, events, hooks (command interface)
|
||||
----------------------------------------------------------------
|
||||
|
||||
All of these are important for interfacing both with end users and API users
|
||||
(which include Lua scripts, libmpv, and the JSON IPC). As such, they constitute
|
||||
a large part of the user interface and APIs.
|
||||
|
||||
Certain options and commands may have documented default values. These default
|
||||
values are considered a part of the API since scripts may already rely on these
|
||||
documented behaviors. Changing these defaults are considered incompatible
|
||||
changes and must be documented. Undocumented default values do not subject to
|
||||
this requirement, and it is recommended to discourage such usage in the related
|
||||
documentations if there is a need to frequently change such defaults.
|
||||
|
||||
All incompatible changes to this must be declared in interface-changes.rst,
|
||||
which include the types of changes, the impact of these changes, and suggested
|
||||
actions to address such impact so that the incompatibility is alleviated.
|
||||
(This may also list compatible additions, but it's not a requirement.)
|
||||
|
||||
Degrees of importance and compatibility preservation
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Critical and central parts of the command interface have the strictest
|
||||
requirements. It may not be reasonable to break them, and other means to achieve
|
||||
some change have to be found. For example, the "seek" command is a bit of a
|
||||
mess, but since changing it would likely affect almost every user, it may be
|
||||
impossible to break at least the commonly used syntax. If changed anyway, there
|
||||
should be a deprecation period of at least 1 year, during which the command
|
||||
still works, and possibly a warning should remain even after this.
|
||||
|
||||
Important/often used parts must be deprecated for at least 2 releases before
|
||||
they can be broken. There must be at least 1 release where the deprecated
|
||||
functionality still works, and a replacement is available (if technically
|
||||
reasonable). For example, a feature deprecated in mpv 0.30.0 may be removed in
|
||||
mpv 0.32.0. Minor releases do not count towards this.
|
||||
|
||||
Under extraordinary circumstances, such as missed incompatible changes that are
|
||||
already included in a release, critical security fixes, or a severe shortage of
|
||||
developer time to address the known incompatible changes, important/often used
|
||||
parts may be broken immediately, but the change must be extensively documented:
|
||||
all of the related documentations (including manpage, interface-changes.rst,
|
||||
etc., retrospectively modified if applicable) must clearly state the following:
|
||||
the fact that the change is a breaking change; the version when the breaking
|
||||
change happened; and the reason, impact, and suggested remedy actions.
|
||||
|
||||
Less useful parts can be broken immediately, but must come with some sort of
|
||||
removal warning.
|
||||
|
||||
Parts for debugging and testing may be removed any time, potentially even
|
||||
without any sort of documentation.
|
||||
|
||||
Currently, the importance of a part is not documented and not even well-defined,
|
||||
which is probably a mistake.
|
||||
|
||||
Renaming or removing options
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Typically, renaming an option can be done in a compatible way with OPT_REPLACED.
|
||||
You may need to check whether the corresponding properties still work (including
|
||||
messy details like observing properties for changes).
|
||||
|
||||
OPT_REMOVED can be used to inform the user of alternatives or reasons for the
|
||||
removal, which is better than an option not found error. Likewise,
|
||||
m_option.deprecation_message should be set to something helpful.
|
||||
|
||||
Both OPT_REPLACED and OPT_REMOVED can remain in the code for a long time, since
|
||||
they're unintrusive and hopefully make incompatible changes less painful for
|
||||
users.
|
||||
|
||||
Scripting APIs
|
||||
--------------
|
||||
|
||||
This affects internal scripting APIs (currently Lua and JavaScript).
|
||||
|
||||
Vaguely the same rules as with the command interface apply. Since there is a
|
||||
large number of scripts, an effort should be made to provide compatibility
|
||||
for old scripts, but it does not need to be stronger than that of the command
|
||||
interface.
|
||||
|
||||
Undocumented parts of the scripting APIs are _not_ guaranteed for compatibility.
|
||||
This applies especially for internals. Languages like Lua do not have strict
|
||||
access control (nor does the mpv code try to emulate any), so if a script
|
||||
accesses private parts, and breaks on the next mpv release, it's not mpv's
|
||||
problem.
|
||||
|
||||
JSON IPC
|
||||
--------
|
||||
|
||||
The JSON IPC is a thin protocol wrapping the libmpv API and the command
|
||||
interface. Compatibility-wise, it's about the same as the scripting APIs.
|
||||
The JSON protocol commands should remain as compatible as possible, and it
|
||||
should probably accept the current way commands are delimited (line breaks)
|
||||
forever.
|
||||
|
||||
The protocol may accept non-standard JSON extensions, but only standard JSON
|
||||
(possibly with restrictions) is guaranteed for compatibility. Clients which want
|
||||
to remain compatible should not use any extensions.
|
||||
|
||||
CLI
|
||||
---
|
||||
|
||||
Things such as default key bindings do not necessarily require compatibility.
|
||||
However, the release notes should be extremely clear on changes to "important"
|
||||
key bindings. Bindings which restore the old behavior should be added to
|
||||
restore-old-bindings.conf and restore-osc-bindings.conf.
|
||||
|
||||
Some option parsing is CLI-only and not available from libmpv or scripting. No
|
||||
compatibility guarantees come with them. However, the rules which mpv uses to
|
||||
distinguish between options and filenames must remain consistent (if the
|
||||
non-deprecated options syntax is used).
|
||||
|
||||
Terminal and log output
|
||||
-----------------------
|
||||
|
||||
There are no compatibility guarantees for the terminal output, or the text
|
||||
logged via ``MPV_EVENT_LOG_MESSAGE`` and similar APIs. In particular, scripts
|
||||
invoking mpv CLI are extremely discouraged from trying to parse text output,
|
||||
and should use other mechanisms such as the JSON IPC.
|
||||
|
||||
Protocols, filters, demuxers, etc.
|
||||
----------------------------------
|
||||
|
||||
Which of these are present is generally not guaranteed, and can even depend
|
||||
on compile time settings.
|
||||
|
||||
The filter list and their sub-options are considered part of the
|
||||
command-interface.
|
||||
|
||||
libmpv C API
|
||||
------------
|
||||
|
||||
The libmpv client API (such as ``<mpv/client.h>``) mostly gives access to
|
||||
the command interface. The API itself (if looked at as a component separate
|
||||
from the command interface) is intended to be extremely stable.
|
||||
|
||||
All API changes are documented in client-api-changes.rst.
|
||||
|
||||
API compatibility
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
The API is *always* compatible. Incompatible changes are only allowed on major
|
||||
API version changes (see ``MPV_CLIENT_API_VERSION``). A major version change is
|
||||
an extremely rare event, which means usually no API symbols are ever removed.
|
||||
|
||||
Essentially removing API functions by making them always return an error, or
|
||||
making it do nothing is allowed in cases where it is unlikely to break most
|
||||
clients, but requires a deprecation period of 2 releases. (This has happened to
|
||||
``mpv_suspend()`` for example.)
|
||||
|
||||
API symbols can be deprecated. This should be clearly marked in the doxygen
|
||||
with ``@deprecated``, and if possible, the affected API symbols should not be
|
||||
visible if the API user defines ``MPV_ENABLE_DEPRECATED`` to 0.
|
||||
|
||||
ABI compatibility
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
The ABI must never be broken, except on major API version changes. For example,
|
||||
constants don't change their values.
|
||||
|
||||
Structs are tricky. If a struct can be allocated by a user (such as ``mpv_node``),
|
||||
no fields can be added. (Unless it's an union, and the addition does not change
|
||||
the offset or alignment of any of the fields or the struct itself. This has
|
||||
happened to ``mpv_node`` in the past.) If a struct is allocated by libmpv only,
|
||||
new fields can be appended to the end (for example ``mpv_event``).
|
||||
|
||||
The ABI is only backward compatible. This means if a host application is linked
|
||||
to an older libmpv, and libmpv is updated to a newer version, it will still
|
||||
work (as in not causing any undefined behavior).
|
||||
|
||||
Forward compatibility (an application would work with an older libmpv than it
|
||||
was linked to) is not required.
|
||||
+160
-244
@@ -1,284 +1,200 @@
|
||||
# Compiling for Windows
|
||||
Compiling for Windows
|
||||
=====================
|
||||
|
||||
Compiling for Windows is supported using GNU-like compilers (GCC/Clang). Clang
|
||||
is compatible with both the ``w64-windows-gnu`` [MinGW-w64](https://www.mingw-w64.org/)
|
||||
and ``pc-windows-msvc`` [Windows SDK](https://developer.microsoft.com/windows/downloads/windows-sdk)
|
||||
targets. It supports the production of both 32-bit and 64-bit binaries and is
|
||||
suitable for building on Windows as well as cross-compiling from Linux and Cygwin.
|
||||
Compiling for Windows is supported with MinGW-w64. This can be used to produce
|
||||
both 32-bit and 64-bit executables, and it works for building on Windows and
|
||||
cross-compiling from Linux and Cygwin. MinGW-w64 is available from:
|
||||
http://mingw-w64.sourceforge.net.
|
||||
|
||||
Although it is possible to build a complete MinGW-w64 toolchain yourself, there
|
||||
are build environments and scripts available to simplify the process, such as
|
||||
MSYS2 on Windows or a packaged toolchain provided by your favorite Linux
|
||||
distribution. Note that MinGW-w64 environments included in Linux distributions
|
||||
can vary in versions. As a general guideline, mpv only supports the MinGW-w64
|
||||
toolchain version included in the latest Ubuntu LTS release.
|
||||
While building a complete MinGW-w64 toolchain yourself is possible, there are a
|
||||
few build environments and scripts to help ease the process, such as MSYS2 and
|
||||
MXE. Note that MinGW environments included in Linux distributions are often
|
||||
broken, outdated and useless, and usually don't use MinGW-w64.
|
||||
|
||||
mpv employs Meson for building, and the process is the same as any standard Meson
|
||||
compilation.
|
||||
**Warning**: the original MinGW (http://www.mingw.org) is unsupported.
|
||||
|
||||
For the most up-to-date reference on build scripts, you can refer to
|
||||
[build.yml](https://github.com/mpv-player/mpv/blob/master/.github/workflows/build.yml),
|
||||
which builds and tests all supported configurations: ``MinGW-w64``, ``Windows SDK``,
|
||||
and ``MSYS2`` builds.
|
||||
Cross-compilation
|
||||
=================
|
||||
|
||||
## Cross-compilation
|
||||
When cross-compiling, you have to run mpv's configure with these arguments:
|
||||
|
||||
When cross-compiling, it is recommended to use a Meson ``--cross-file`` to set up the
|
||||
cross-compiling environment. For a basic example, please refer to
|
||||
[Cross-compilation](https://mesonbuild.com/Cross-compilation.html).
|
||||
|
||||
Alternatively, consider using [mpv-winbuild-cmake](https://github.com/shinchiro/mpv-winbuild-cmake),
|
||||
which bootstraps a MinGW-w64 toolchain and builds mpv along with its dependencies.
|
||||
|
||||
### Example with Meson
|
||||
|
||||
1. Create ``cross-file.txt`` with definitions for your toolchain and target platform.
|
||||
Refer to [x86_64-w64-mingw32.txt](https://mesonbuild.com/Cross-compilation.html)
|
||||
as a directly usable example.
|
||||
- **Important**: Beware of pkg-config usage. By default, it uses build machine
|
||||
files for dependency detection, even when ``--cross-file`` is used. It must
|
||||
be configured correctly. Refer to ``pkg_config_libdir`` and ``sys_root``
|
||||
in the [documentation](https://mesonbuild.com/Cross-compilation.html#defining-the-environment)
|
||||
for proper setup. **In this example pkg-config is not used/required.**
|
||||
2. Initialize subprojects. This step is optional; other methods are also
|
||||
available to provide the necessary dependencies.
|
||||
|
||||
``` bash
|
||||
# Update the subprojects database from Meson's WrapDB.
|
||||
meson wrap update-db
|
||||
|
||||
# Explicitly download wraps as nested projects may have older versions of them.
|
||||
meson wrap install expat
|
||||
meson wrap install harfbuzz
|
||||
meson wrap install libpng
|
||||
meson wrap install zlib
|
||||
|
||||
# Add wraps for mpv's required dependencies
|
||||
mkdir -p subprojects
|
||||
|
||||
cat <<EOF > subprojects/libplacebo.wrap
|
||||
[wrap-git]
|
||||
url = https://github.com/haasn/libplacebo
|
||||
revision = master
|
||||
depth = 1
|
||||
clone-recursive = true
|
||||
EOF
|
||||
|
||||
cat <<EOF > subprojects/libass.wrap
|
||||
[wrap-git]
|
||||
revision = master
|
||||
url = https://github.com/libass/libass
|
||||
depth = 1
|
||||
EOF
|
||||
|
||||
# For FFmpeg, use Meson's build system port; alternatively, you can compile
|
||||
# the upstream version yourself. See https://trac.ffmpeg.org/wiki/CompilationGuide
|
||||
cat <<EOF > subprojects/ffmpeg.wrap
|
||||
[wrap-git]
|
||||
url = https://gitlab.freedesktop.org/gstreamer/meson-ports/ffmpeg.git
|
||||
revision = meson-8.1
|
||||
depth = 1
|
||||
[provide]
|
||||
libavcodec = libavcodec_dep
|
||||
libavdevice = libavdevice_dep
|
||||
libavfilter = libavfilter_dep
|
||||
libavformat = libavformat_dep
|
||||
libavutil = libavutil_dep
|
||||
libswresample = libswresample_dep
|
||||
libswscale = libswscale_dep
|
||||
EOF
|
||||
```
|
||||
|
||||
3. Build
|
||||
|
||||
``` bash
|
||||
meson setup -Ddefault_library=static -Dprefer_static=true \
|
||||
-Dc_link_args='-static' -Dcpp_link_args='-static' \
|
||||
--cross-file cross-file.txt build
|
||||
|
||||
ninja -C build mpv.exe mpv.com
|
||||
```
|
||||
|
||||
This will produce fully portabiel, statically linked, ``mpv.exe`` and ``mpv.com``
|
||||
binaries.
|
||||
|
||||
#### Building libmpv
|
||||
|
||||
- To also build ``libmpv``, execute the following commands:
|
||||
|
||||
``` bash
|
||||
# For a static library
|
||||
meson configure build -Dlibmpv=true -Ddefault_library=static
|
||||
ninja -C build libmpv.a
|
||||
|
||||
# For a shared library
|
||||
meson configure build -Dlibmpv=true -Ddefault_library=shared
|
||||
ninja -C build libmpv-2.dll
|
||||
```
|
||||
|
||||
- Depending on the use case, you might want to use ``-Dgpl=false`` and review
|
||||
similar options for subprojects.
|
||||
- If any of Meson's subprojects are not linked statically, you might need to
|
||||
specify options like the following example for ffmpeg:
|
||||
``-Dffmpeg:default_library=static``.
|
||||
|
||||
#### Enabling more mpv features
|
||||
|
||||
The process above produces a basic mpv build. You can enable additional features.
|
||||
Check the Meson
|
||||
[WrapDB packages](https://mesonbuild.com/Wrapdb-projects.html) for available
|
||||
dependencies or by providing them through other means.
|
||||
|
||||
Enhancing mpv with more features is as simple as adding more arguments to the
|
||||
Meson setup command, for example:
|
||||
|
||||
``` bash
|
||||
-Dlua=enabled -Djavascript=enabled -Dlcms2=enabled -Dlibplacebo:lcms=enabled
|
||||
```bash
|
||||
DEST_OS=win32 TARGET=i686-w64-mingw32 ./waf configure
|
||||
```
|
||||
|
||||
they will be automatically downloaded and built by Meson.
|
||||
[MXE](http://mxe.cc) makes it very easy to bootstrap a complete MingGW-w64
|
||||
environment from a Linux machine. See a working example below.
|
||||
|
||||
## Native Compilation with Clang (Windows SDK Build)
|
||||
Alternatively, you can try [mingw-w64-cmake](https://github.com/lachs0r/mingw-w64-cmake),
|
||||
which bootstraps a MinGW-w64 environment and builds mpv and dependencies.
|
||||
|
||||
1. Install [Build Tools for Visual Studio](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022)
|
||||
or the full [Visual Studio](https://visualstudio.microsoft.com/downloads/#visual-studio-community-2022):
|
||||
- From the installer, select the necessary components:
|
||||
- Clang compiler for Windows
|
||||
- C++ CMake tools for Windows
|
||||
- Windows SDK
|
||||
- Activate the developer shell. The target and host architecture must match
|
||||
(e.g. `amd64` for x86_64, `arm64` for ARM64):
|
||||
```
|
||||
& "<Visual Studio Path>\Common7\Tools\Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation | Out-Null
|
||||
```
|
||||
2. Install the remaining build tools that are not part of the Visual Studio installer:
|
||||
- [Meson](https://mesonbuild.com/Getting-meson.html), the build system.
|
||||
- [NASM](https://www.nasm.us/), required to assemble the hand-written assembly
|
||||
in FFmpeg, dav1d and aom. Make sure it is in `PATH`.
|
||||
- [Rust](https://www.rust-lang.org/tools/install) (via `rustup`), required to
|
||||
build mpv's Rust components and the `subrandr` subproject. A **nightly**
|
||||
toolchain is needed, as the build relies on Cargo's unstable `-C` option:
|
||||
Example with MXE
|
||||
----------------
|
||||
|
||||
```powershell
|
||||
rustup default nightly
|
||||
```
|
||||
```bash
|
||||
# Before starting, make sure you install MXE prerequisites. MXE will download
|
||||
# and build all target dependencies, but no host dependencies. For example,
|
||||
# you need a working compiler, or MXE can't build the crosscompiler.
|
||||
#
|
||||
# Refer to
|
||||
#
|
||||
# http://mxe.cc/#requirements
|
||||
#
|
||||
# Scroll down for disto/OS-specific instructions to install them.
|
||||
|
||||
3. The following build script utilizes the Meson subprojects system to build mpv and its dependencies.
|
||||
To make sure all dependency versions are up-to-date, update the subprojects database from Meson's WrapDB.
|
||||
Also explicitly download several wraps as some nested projects may pull older versions of them.
|
||||
```
|
||||
meson wrap update-db
|
||||
# Download MXE. Note that compiling the required packages requires about 1.4 GB
|
||||
# or more!
|
||||
|
||||
meson wrap install expat
|
||||
meson wrap install harfbuzz
|
||||
meson wrap install libpng
|
||||
meson wrap install zlib
|
||||
```
|
||||
4. Set environment variables so Meson uses the Clang/LLVM toolchain, or pass an
|
||||
equivalent `--native-file` to Meson.
|
||||
```powershell
|
||||
$env:CC = 'clang'
|
||||
$env:CXX = 'clang++'
|
||||
$env:CC_LD = 'lld-link'
|
||||
$env:CXX_LD = 'lld-link'
|
||||
$env:RUST_LD = 'lld-link'
|
||||
$env:WINDRES = 'llvm-rc'
|
||||
```
|
||||
Note that some dependencies (e.g. LuaJIT) may require `sed` to configure. Fortunately, it is already bundled in
|
||||
[Git for Windows](https://www.git-scm.com/download/win):
|
||||
```powershell
|
||||
$env:PATH += ';<Git Path>\usr\bin'
|
||||
```
|
||||
5. Execute [ci\build-win32.ps1](https://github.com/mpv-player/mpv/blob/master/ci/build-win32.ps1). Refer to the script for more details.
|
||||
cd /opt
|
||||
git clone https://github.com/mxe/mxe mxe
|
||||
cd mxe
|
||||
|
||||
This process will produce a fully static ``mpv.exe`` and ``mpv.com``, as well as
|
||||
a static ``libmpv.a``.
|
||||
# Set build options.
|
||||
|
||||
## Native Compilation with MSYS2
|
||||
# The JOBS environment variable controls threads to use when building. DO NOT
|
||||
# use the regular `make -j4` option with MXE as it will slow down the build.
|
||||
# Alternatively, you can set this in the make command by appending "JOBS=4"
|
||||
# to the end of command:
|
||||
echo "JOBS := 4" >> settings.mk
|
||||
|
||||
For Windows developers seeking a quick setup, MSYS2 is an effective tool for
|
||||
compiling mpv natively on a Windows machine. The MSYS2 repositories provide
|
||||
binary packages for most of mpv's dependencies, simplifying the process to
|
||||
primarily involve building mpv itself.
|
||||
# The MXE_TARGET environment variable builds MinGW-w64 for 32 bit targets.
|
||||
# Alternatively, you can specify this in the make command by appending
|
||||
# "MXE_TARGETS=i686-w64-mingw32" to the end of command:
|
||||
echo "MXE_TARGETS := i686-w64-mingw32.static" >> settings.mk
|
||||
|
||||
### Installing MSYS2
|
||||
# If you want to build 64 bit version, use this:
|
||||
# echo "MXE_TARGETS := x86_64-w64-mingw32.static" >> settings.mk
|
||||
|
||||
1. Follow the installation steps from [MSYS2](https://www.msys2.org/).
|
||||
2. Initiate one of the [Environments](https://www.msys2.org/docs/environments/),
|
||||
with the CLANG64 (``clang64.exe``) being the recommended option.
|
||||
**Note:** This environment is distinct from the MSYS2 shell that opens
|
||||
automatically after the final installation dialog. You must close that
|
||||
initial shell and open a new one for the appropriate environment.
|
||||
# Build required packages. The following provide a minimum required to build
|
||||
# a reasonable mpv binary (though not an absolute minimum).
|
||||
|
||||
### Updating MSYS2
|
||||
make gcc ffmpeg libass jpeg lua
|
||||
|
||||
For guidance on updating MSYS2, please refer to the official documentation:
|
||||
[Updating MSYS2](https://www.msys2.org/docs/updating/).
|
||||
# Add MXE binaries to $PATH
|
||||
export PATH=/opt/mxe/usr/bin/:$PATH
|
||||
|
||||
### Installing mpv Dependencies
|
||||
# Build mpv. The target will be used to automatically select the name of the
|
||||
# build tools involved (e.g. it will use i686-w64-mingw32.static-gcc).
|
||||
|
||||
``` bash
|
||||
# Install pacboy and git
|
||||
pacman -S pactoys git
|
||||
cd ..
|
||||
git clone https://github.com/mpv-player/mpv.git
|
||||
cd mpv
|
||||
python ./bootstrap.py
|
||||
DEST_OS=win32 TARGET=i686-w64-mingw32.static ./waf configure
|
||||
# Or, if 64 bit version,
|
||||
# DEST_OS=win32 TARGET=x86_64-w64-mingw32.static ./waf configure
|
||||
./waf build
|
||||
```
|
||||
|
||||
Native compilation with MSYS2
|
||||
=============================
|
||||
|
||||
For Windows developers looking to get started quickly, MSYS2 can be used to
|
||||
compile mpv natively on a Windows machine. The MSYS2 repositories have binary
|
||||
packages for most of mpv's dependencies, so the process should only involve
|
||||
building mpv itself.
|
||||
|
||||
To build 64-bit mpv on Windows:
|
||||
|
||||
Installing MSYS2
|
||||
----------------
|
||||
|
||||
1. Download an installer from https://msys2.github.io/
|
||||
|
||||
It doesn't matter whether the i686 or the x86_64 version is used. Both can
|
||||
build 32-bit and 64-bit binaries when running on a 64-bit version of Windows.
|
||||
|
||||
2. Start a MinGW-w64 shell (``mingw64_shell.bat``). Note that this is different
|
||||
from the MSYS2 shell that is started from the final installation dialog.
|
||||
|
||||
For a 32-bit build, use ``mingw32_shell.bat``.
|
||||
|
||||
Updating MSYS2
|
||||
--------------
|
||||
|
||||
To prevent errors during post-install, the MSYS2 core runtime must be updated
|
||||
separately.
|
||||
|
||||
```bash
|
||||
# Check for core updates. If instructed, close the shell window and reopen it
|
||||
# before continuing.
|
||||
update-core
|
||||
|
||||
# Update everything else
|
||||
pacman -Su
|
||||
```
|
||||
|
||||
Installing mpv dependencies
|
||||
---------------------------
|
||||
|
||||
```bash
|
||||
# Install MSYS2 build dependencies and a MinGW-w64 compiler
|
||||
pacboy -S python pkgconf cc meson
|
||||
pacman -S git mingw-w64-x86_64-pkg-config python mingw-w64-x86_64-gcc
|
||||
|
||||
# Install key dependencies. libass and lcms2 are also included as dependencies
|
||||
# of ffmpeg.
|
||||
pacboy -S ffmpeg libjpeg-turbo libplacebo luajit vulkan-headers
|
||||
# Install the most important MinGW-w64 dependencies. libass, libbluray and
|
||||
# lcms2 are also pulled in as dependencies of ffmpeg.
|
||||
pacman -S mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-lua51
|
||||
|
||||
# Install additional (optional) dependencies
|
||||
pacman -S mingw-w64-x86_64-libdvdnav mingw-w64-x86_64-libguess mingw-w64-x86_64-angleproject-git
|
||||
```
|
||||
|
||||
### Building mpv
|
||||
For a 32-bit build, install ``mingw-w64-i686-*`` packages instead.
|
||||
|
||||
To compile and install mpv, execute the following commands.
|
||||
The binaries will be installed in the directory ``/$MSYSTEM_PREFIX/bin``.
|
||||
Building mpv
|
||||
------------
|
||||
|
||||
Clone the latest mpv from git and install waf:
|
||||
|
||||
```bash
|
||||
# Set up the build directory with the desired configuration
|
||||
meson setup build -Dlibmpv=true --prefix=$MSYSTEM_PREFIX
|
||||
|
||||
# Compile
|
||||
meson compile -C build
|
||||
|
||||
# Optionally, install the compiled binaries
|
||||
meson install -C build
|
||||
git clone https://github.com/mpv-player/mpv.git && cd mpv
|
||||
./bootstrap.py
|
||||
```
|
||||
|
||||
## Running mpv
|
||||
|
||||
Depending on your build configuration, ``mpv.exe`` may rely on external
|
||||
libraries. To create a portable package, you will need to include these
|
||||
dependencies as well. The quickest way to determine which libraries are needed
|
||||
is to run ``mpv.exe`` and note any error messages that list the required ``.dll``
|
||||
files. You can find these libraries in the sysroot used for compilation, such as
|
||||
``/clang64/bin/`` in MSYS2.
|
||||
|
||||
## Linking libmpv with MSVC Programs
|
||||
|
||||
Building mpv/libmpv directly with the MSVC compiler (cl.exe) is not supported
|
||||
due to differences in compiler flags. Our build system is designed specifically
|
||||
for GNU-like compiler drivers. However, you can still build programs in
|
||||
Visual Studio and link them with libmpv.
|
||||
|
||||
When ``libmpv`` is built with the recommended Clang/``lld-link`` toolchain,
|
||||
``lld-link`` emits an import library (``mpv.lib``) next to the DLL in the build
|
||||
directory. Add that ``mpv.lib`` to your MSVC project.
|
||||
|
||||
To generate an import library from a DLL yourself, first create a ``.def`` file
|
||||
listing its exports. There are several ways to do this. One is ``gendef``, which
|
||||
writes a ``.def``, based on DLL.
|
||||
Finally, compile and install mpv. Binaries will be installed to
|
||||
``/mingw64/bin``.
|
||||
|
||||
```bash
|
||||
gendef libmpv-2.dll
|
||||
# For a 32-bit build, use --prefix=/mingw32 instead
|
||||
./waf configure CC=gcc.exe --check-c-compiler=gcc --prefix=/mingw64
|
||||
./waf install
|
||||
```
|
||||
|
||||
Then build the import library from it. ``/name`` must match the DLL filename, and
|
||||
``/machine`` must match the DLL's architecture (e.g. ``x64`` or ``arm64``):
|
||||
Or, compile and install both libmpv and mpv:
|
||||
|
||||
```bash
|
||||
lib /def:libmpv-2.def /name:libmpv-2.dll /out:mpv.lib /machine:x64
|
||||
./waf configure CC=gcc.exe --check-c-compiler=gcc --enable-libmpv-shared --prefix=/mingw64
|
||||
./waf install
|
||||
|
||||
# waf installs libmpv to the wrong directory, so fix it up
|
||||
mv -f /mingw64/bin/pkgconfig/mpv.pc /mingw64/lib/pkgconfig/
|
||||
mv -f /mingw64/bin/libmpv.dll.a /mingw64/lib/
|
||||
sed -i 's_/mingw64/bin_/mingw64/lib_' /mingw64/lib/pkgconfig/mpv.pc
|
||||
rmdir /mingw64/bin/pkgconfig
|
||||
```
|
||||
|
||||
**Note:** Static linking is only feasible with matching compilers. For instance,
|
||||
if you build with Clang in Visual Studio, static linking is possible.
|
||||
Running mpv
|
||||
-----------
|
||||
|
||||
If you want to run mpv from the MinGW-w64 shell, you will find the experience
|
||||
much more pleasant if you use the ``winpty`` utility
|
||||
|
||||
```bash
|
||||
pacman -S winpty
|
||||
winpty mpv.com ToS-4k-1920.mov
|
||||
```
|
||||
|
||||
If you want to move / copy ``mpv.exe`` and ``mpv.com`` to somewhere other than
|
||||
``/mingw64/bin/`` for use outside the MinGW-w64 shell, they will still depend on
|
||||
DLLs in that folder. The simplest solution is to add ``C:\msys64\mingw64\bin``
|
||||
to the windows system ``%PATH%``. Beware though that this can cause problems or
|
||||
confusion in Cygwin if that is also installed on the machine.
|
||||
|
||||
Use of the ANGLE OpenGL backend requires a copy of ``d3dcompiler_43.dll`` (yes,
|
||||
exactly 43) in the path or in the same folder as mpv. It must be of the same
|
||||
architecture (x86_64 / i686) as the mpv you compiled. You can find a copy in the
|
||||
official mpv builds:
|
||||
|
||||
https://mpv.srsfckn.biz/mpv-x86_64-20160118.7z
|
||||
|
||||
https://mpv.srsfckn.biz/mpv-i686-20160118.7z
|
||||
+42
-199
@@ -5,61 +5,27 @@ General
|
||||
-------
|
||||
|
||||
The main contact for mpv development is IRC, specifically #mpv
|
||||
and #mpv-devel on Libera.chat. GitHub is used for code review and
|
||||
long term discussions.
|
||||
and #mpv-devel on Freenode.
|
||||
|
||||
Sending patches
|
||||
---------------
|
||||
|
||||
- Make a GitHub pull request, or send a link to a plaintext patch created with
|
||||
``git format-patch``.
|
||||
- Plain diffs posted as pastebins are not acceptable! (Especially if the http
|
||||
link returns HTML.) They only cause extra work for everyone, because they lack
|
||||
commit message and authorship information.
|
||||
- Never send patches to any of the developers email addresses.
|
||||
- If your changes are not supposed to be merged immediately, mark them as
|
||||
"[RFC]" in the commit message or the pull request title.
|
||||
- Be sure to test your changes. If you didn't, please say so in the commit
|
||||
message and the pull request text.
|
||||
|
||||
Copyright of contributions
|
||||
--------------------------
|
||||
|
||||
- The copyright belongs to contributors. The project is a collaborative work. By
|
||||
sending your changes, you agree to license your contributions according to the
|
||||
requirements of this project.
|
||||
- Make a github pull request, or send a link to a plaintext patch created with
|
||||
``git format-patch``. diffs posted as pastebins (especially if the http link
|
||||
returns HTML) just cause extra work for everyone, because they lack commit
|
||||
message and authorship information.
|
||||
- All new code must be LGPLv2.1+ licensed, or come with the implicit agreement
|
||||
that it will be relicensed to LGPLv2.1+ later (see ``Copyright`` in the
|
||||
repository root directory).
|
||||
- 100% compatible licenses are allowed too.
|
||||
- Changes in files with more liberal licenses (such as BSD, MIT, or ISC) are
|
||||
assumed to be dual-licensed under LGPLv2.1+ and the license indicated in the
|
||||
file header.
|
||||
- You must be either the exclusive author of the patch, or acknowledge all
|
||||
authors involved in the commit message. If you take 3rd party code, authorship
|
||||
and copyright must be properly acknowledged. If you're making changes on
|
||||
behalf of your employer, and the employer owns the copyright, you must mention
|
||||
this. If the license of the code is not LGPLv2.1+, you must mention this.
|
||||
- These license statements are legally binding.
|
||||
- Don't use fake names (something that looks like an actual name, and may be
|
||||
someone else's name, but is not your legal name). Using a pseudonym is
|
||||
allowed if it can be used to identify or contact you, even if whatever
|
||||
account you used to submit the patch dies.
|
||||
- Do not add your name to the license header. This convention is not used by
|
||||
this project, and neither copyright law nor any of the used licenses require
|
||||
it.
|
||||
|
||||
Write good commit messages
|
||||
--------------------------
|
||||
|
||||
- When creating pull requests, be sure to test your changes. If you didn't,
|
||||
please say so in the pull request message.
|
||||
- Write informative commit messages. Use present tense to describe the
|
||||
situation with the patch applied, and past tense for the situation before
|
||||
the change.
|
||||
- The subject line (the first line in a commit message) must contain a
|
||||
- The subject line (the first line in a commit message) should contain a
|
||||
prefix identifying the sub system, followed by a short description what
|
||||
impact this commit has. This subject line and the commit message body
|
||||
must not be longer than 72 characters per line, because it messes up the
|
||||
output of many git tools otherwise.
|
||||
impact this commit has. This subject line shouldn't be longer than 72
|
||||
characters, because it messes up the output of many git tools otherwise.
|
||||
|
||||
For example, you fixed a crash in af_volume.c:
|
||||
|
||||
@@ -68,16 +34,7 @@ Write good commit messages
|
||||
|
||||
Having a prefix gives context, and is especially useful when trying to find
|
||||
a specific change by looking at the history, or when running ``git blame``.
|
||||
|
||||
Sample prefixes: ``vo_gpu: ...``, ``command: ...``, ``DOCS/input: ...``,
|
||||
``TOOLS/osxbundle: ...``, ``osc.lua: ...``, etc. You can always check the git
|
||||
log for commits which modify specific files to see which prefixes are used.
|
||||
|
||||
- The first word after the ``:`` is lower case.
|
||||
- Don't end the subject line with a ``.``.
|
||||
- Put an empty line between the subject line and the commit message.
|
||||
If this is missing, it will break display in common git tools.
|
||||
- The body of the commit message (everything else after the subject line) must
|
||||
- The body of the commit message (everything else after the subject line) should
|
||||
be as informative as possible and contain everything that isn't obvious. Don't
|
||||
hesitate to dump as much information as you can - it doesn't cost you
|
||||
anything. Put some effort into it. If someone finds a bug months or years
|
||||
@@ -86,81 +43,32 @@ Write good commit messages
|
||||
information to test the original bug. The old bug might be reintroduced while
|
||||
fixing the new bug.
|
||||
|
||||
The commit message must be wrapped on 72 characters per line, because git
|
||||
The commit message should be wrapped on 72 characters per line, because git
|
||||
tools usually do not break text automatically. On the other hand, you do not
|
||||
need to break text that would be unnatural to break (like data for test cases,
|
||||
or long URLs).
|
||||
- Another summary of good conventions: https://chris.beams.io/posts/git-commit/
|
||||
|
||||
Split changes into multiple commits
|
||||
-----------------------------------
|
||||
|
||||
- Follow git good practices, and split independent changes into several commits.
|
||||
It's usually OK to put them into a single pull request.
|
||||
Important: put an empty line between the subject line and the commit message.
|
||||
If this is missing, it will break display in common git tools.
|
||||
- Try to separate cosmetic and functional changes. It's ok to make a few
|
||||
additional cosmetic changes in the same file you're working on. But don't do
|
||||
something like reformatting a whole file, and hiding an actual functional
|
||||
change in the same commit.
|
||||
- Splitting changes does _not_ mean that you should make them as fine-grained
|
||||
as possible. Commits should form logical steps in development. The way you
|
||||
split changes is important for code review and analyzing bugs.
|
||||
|
||||
Always squash fixup commits when making changes to pull requests
|
||||
----------------------------------------------------------------
|
||||
|
||||
- If you make fixup commits to your pull request, you should generally squash
|
||||
them with "git rebase -i". We prefer to have pull requests in a merge
|
||||
ready state.
|
||||
- We don't squash-merge (nor do we use GitHub's feature that does this) because
|
||||
pull requests with multiple commits are perfectly legitimate, and the only
|
||||
thing that makes sense in non-trivial cases.
|
||||
- With complex pull requests, it *may* make sense to keep them separate, but
|
||||
they should be clearly marked as such. Reviewing commits is generally easier
|
||||
with fixups squashed.
|
||||
- Reviewers are encouraged to look at individual commits instead of GitHub's
|
||||
"changes from all commits" view (which just encourages bad git and review
|
||||
practices).
|
||||
|
||||
Touching user-visible parts may require updating the mpv docs
|
||||
-------------------------------------------------------------
|
||||
|
||||
- Most user-visible things are normally documented in DOCS/man/. If your commit
|
||||
touches documented behavior, list of sub-options, etc., you need to adjust the
|
||||
documentation.
|
||||
- These changes usually go into the same commit that changes the code.
|
||||
- Changes to command line options (addition/modification/removal) must be
|
||||
documented in options.rst.
|
||||
- Changes to input properties or input commands must be documented in input.rst.
|
||||
- Changes to the libmpv API must be reflected in the libmpv's headers doxygen,
|
||||
and in client-api-changes.rst.
|
||||
|
||||
Interface change policy
|
||||
-----------------------
|
||||
|
||||
- All incompatible changes to the user interface (options, properties, commands)
|
||||
must be documented by making a new text file with a txt extension containing a
|
||||
small note in the DOCS/interface-changes directory.
|
||||
- The name of the file should be brief and related to the commit that makes the
|
||||
change. The content of the file should begin with the type of the change
|
||||
(add, remove, deprecate, change, rename, etc.). If the file contains multiple
|
||||
changes, the change which causes the most serious compatibility issues should
|
||||
be placed first.
|
||||
- Grouping multiple related changes in the same file is also OK. Just be sure to
|
||||
put each separate change on a different line.
|
||||
- Documenting additions in DOCS/interface-changes is optional but encouraged.
|
||||
- interface-changes.rst is never directly updated except when making new major
|
||||
releases.
|
||||
- See DOCS/interface-changes/example.txt for an example.
|
||||
- If you add a new command line option, document it in options.rst. If you
|
||||
add a new input property, document it in input.rst. Changes to the user
|
||||
interface (options, properties, commands) should be documented in
|
||||
interface-changes.rst. Changes to libmpv should be documented in
|
||||
client-api-changes.rst.
|
||||
|
||||
Code formatting
|
||||
---------------
|
||||
|
||||
mpv uses C11 with K&R formatting, with some exceptions.
|
||||
mpv uses C99 with K&R formatting, with some exceptions.
|
||||
|
||||
- Use the K&R indent style.
|
||||
- Use 4 spaces of indentation, never use tabs (except in Makefiles).
|
||||
- Add a single space between keywords and binary operators. There are some other
|
||||
cases where spaces must be added. Example:
|
||||
cases where spaces should be added. Example:
|
||||
|
||||
```C
|
||||
if ((a * b) > c) {
|
||||
@@ -168,9 +76,9 @@ mpv uses C11 with K&R formatting, with some exceptions.
|
||||
some_function(a, b, c);
|
||||
}
|
||||
```
|
||||
- Break lines on 80 columns. There is a hard limit of 100 columns. You may ignore
|
||||
- Break lines on 80 columns. There is a hard limit of 85 columns. You may ignore
|
||||
this limit if there's a strong case that not breaking the line will increase
|
||||
readability. Going over 100 columns might provoke endless discussions about
|
||||
readability. Going over 85 columns might provoke endless discussions about
|
||||
whether such a limit is needed or not, so avoid it.
|
||||
- If the body of an if/for/while statement has more than 1 physical lines, then
|
||||
always add braces, even if they're technically redundant.
|
||||
@@ -193,16 +101,18 @@ mpv uses C11 with K&R formatting, with some exceptions.
|
||||
do_something();
|
||||
}
|
||||
```
|
||||
- If the if has an else branch, both branches must use braces, even if they're
|
||||
technically redundant.
|
||||
- If the body of an if statement uses braces, the else branch should also
|
||||
use braces (and reverse).
|
||||
|
||||
Example:
|
||||
|
||||
```C
|
||||
if (a) {
|
||||
one_line();
|
||||
// do something
|
||||
something();
|
||||
something_else();
|
||||
} else {
|
||||
one_other_line();
|
||||
one_line();
|
||||
}
|
||||
```
|
||||
- If an if condition spans multiple physical lines, then put the opening brace
|
||||
@@ -220,95 +130,28 @@ mpv uses C11 with K&R formatting, with some exceptions.
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
(If the if body is simple enough, this rule can be skipped.)
|
||||
- Remove any trailing whitespace.
|
||||
- Do not make stray whitespaces changes.
|
||||
|
||||
Header #include statement order
|
||||
-------------------------------
|
||||
|
||||
The order of ``#include`` statements in the source code is not very consistent.
|
||||
New code must follow the following conventions:
|
||||
|
||||
- Put standard includes (``#include <stdlib.h>`` etc.) on the top,
|
||||
- then after a blank line, add library includes (``#include <zlib.h>`` etc.)
|
||||
- then after a blank line, add internal includes (``#include "player/core.h"``)
|
||||
- sort them alphabetically within these sections
|
||||
- If the file you're editing uses formatting different from from what is
|
||||
described here, it's probably an old file from times when nobody followed a
|
||||
consistent style. You're free to use the existing style, or the new style, or
|
||||
to send a patch to reformat the file to the new style before making functional
|
||||
changes.
|
||||
|
||||
General coding
|
||||
--------------
|
||||
|
||||
- Use C11. Also freely make use of C11 features if it's appropriate, but do not
|
||||
use VLA and complex number types.
|
||||
- Don't use non-standard language (such as GNU C-only features). In some cases
|
||||
they may be warranted, if they are optional (such as attributes enabling
|
||||
printf-like format string checks). "#pragma once" is allowed as an exception.
|
||||
But in general, standard C11 must be used.
|
||||
- Use C99. Also freely make use of C99 features if it's appropriate, such as
|
||||
stdbool.h.
|
||||
- Don't use GNU-only features. In some cases they may be warranted, if they
|
||||
are optional (such as attributes enabling printf-like format string checks).
|
||||
But in general, standard C99 should be used.
|
||||
- The same applies to libc functions. We have to be Windows-compatible too. Use
|
||||
functions guaranteed by C11 or POSIX only, unless your use is guarded by a
|
||||
configure check. Be mindful of MinGW-specifics since C11 support is not always
|
||||
guaranteed.
|
||||
functions guaranteed by C99 or POSIX only, unless your use is guarded by a
|
||||
configure check.
|
||||
- Prefer fusing declaration and initialization, rather than putting declarations
|
||||
on the top of a block. Obvious data flow is more important than avoiding
|
||||
mixing declarations and statements, which is just a C90 artifact.
|
||||
- tech-overview.txt might help to get an overview how mpv is structured.
|
||||
- If you add features that require intrusive changes, discuss them on the dev
|
||||
channel first. There might be a better way to add a feature and it can avoid
|
||||
wasted work.
|
||||
- Newly added code for any Apple Platform (macOS, iOS, etc), that uses Cocoa or
|
||||
any other object-oriented Framework or API, should be written in Swift instead
|
||||
of Objective-C. This also includes complete rewrites/refactors of existing
|
||||
code. Plain C API usages may stay as C, but can be written in Swift. Existing
|
||||
Objective-C code can stay as is, though Swift rewrites are welcome.
|
||||
|
||||
AI-assisted Contributions
|
||||
-------------------------
|
||||
|
||||
If you have used an AI/LLM for your contribution, you must disclose this in the
|
||||
PR description. Such contributions are not forbidden, but the submitter takes
|
||||
full responsibility for the code changes. This includes having full
|
||||
understanding of the code (knowing what was changed and why) and the ability to
|
||||
participate in the code review process with human-written responses. This also
|
||||
includes confirming that the code can be submitted under the same license as the
|
||||
relevant files (usually LGPLv2 or GPLv2).
|
||||
|
||||
Clearly vibe-coded patches will not be considered.
|
||||
|
||||
Code of Conduct
|
||||
---------------
|
||||
|
||||
Please note that this project is released with a Contributor Code of Conduct.
|
||||
By participating in this project you agree to abide by its terms.
|
||||
The Contributor Code of Conduct can be found here:
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct/
|
||||
|
||||
Rules for git push access
|
||||
-------------------------
|
||||
|
||||
Push access to the main git repository is handed out on an arbitrary basis. If
|
||||
you got access, the following rules must be followed:
|
||||
|
||||
- You are expected to follow the general development rules as outlined in this
|
||||
whole document.
|
||||
- You must be present on the IRC dev channel when you push something.
|
||||
- Anyone can push small fixes: typo corrections, small/obvious/uncontroversial
|
||||
bug fixes, edits to the user documentation or code comments, and so on.
|
||||
- You can freely make changes to parts of the code which you maintain. For
|
||||
larger changes, it's recommended to let others review the changes first.
|
||||
- You automatically maintain code if you wrote or modified most of it before
|
||||
(e.g. you made larger changes to it before, did partial or full rewrites, did
|
||||
major bug fixes, or you're the original author of the code). If there is more
|
||||
than one maintainer, you may need to come to an agreement with the others how
|
||||
to handle this to avoid conflict.
|
||||
- If you make a pull requests (especially if it's to code you maintain), and you
|
||||
want reviews, explicitly ping the people from which you expect reviews.
|
||||
- As a maintainer, you can approve pull requests by others to "your" code.
|
||||
- If you approve or merge 3rd party changes, make sure they follow the general
|
||||
development rules.
|
||||
- Changes to user interface and public API must always be approved by the
|
||||
project leader.
|
||||
- Seasoned project members are allowed to revert commits that broke the build,
|
||||
or broke basic functionality in a catastrophic way, and the developer who
|
||||
broke it is unavailable. (Depending on severity.)
|
||||
- Adhere to the CoC.
|
||||
- The project leader is not bound by these rules.
|
||||
+4
-282
@@ -51,8 +51,7 @@ The rest of the lines belong to one of these classes:
|
||||
1) An empty or commented line. A comment starts with ``#``, which must be the
|
||||
first character in the line. The rest of the line (up until the next line
|
||||
break) is ignored. An empty line has 0 bytes between two line feed bytes.
|
||||
2) A header entry if the line starts with ``!``.
|
||||
3) A segment entry in all other cases.
|
||||
2) A segment entry in all other cases.
|
||||
|
||||
Each segment entry consists of a list of named or unnamed parameters.
|
||||
Parameters are separated with ``,``. Named parameters consist of a name,
|
||||
@@ -64,8 +63,8 @@ Syntax::
|
||||
segment_entry ::= <param> ( <param> ',' )*
|
||||
param ::= [ <name> '=' ] ( <value> | '%' <number> '%' <valuebytes> )
|
||||
|
||||
The ``name`` string can consist of any characters, except ``=%,;\n!``. The
|
||||
``value`` string can consist of any characters except of ``,;\n!``.
|
||||
The ``name`` string can consist of any characters, except ``=%,;\n``. The
|
||||
``value`` string can consist of any characters except of ``,;\n``.
|
||||
|
||||
The construct starting with ``%`` allows defining any value with arbitrary
|
||||
contents inline, where ``number`` is an integer giving the number of bytes in
|
||||
@@ -95,235 +94,6 @@ to ``20``, ``param3`` to ``value,escaped``, ``param4`` to ``value2``.
|
||||
Instead of line breaks, the character ``;`` can be used. Line feed bytes and
|
||||
``;`` are treated equally.
|
||||
|
||||
Header entries start with ``!`` as first character after a line break. Header
|
||||
entries affect all other file entries in the EDL file. Their format is highly
|
||||
implementation specific. They should generally follow the file header, and come
|
||||
before any file entries.
|
||||
|
||||
Disabling chapter generation and copying
|
||||
========================================
|
||||
|
||||
By default, chapters from the source ranges are copied to the virtual file's
|
||||
chapters. Also, a chapter is inserted after each range. This can be disabled
|
||||
with the ``no_chapters`` header.
|
||||
|
||||
Example::
|
||||
|
||||
!no_chapters
|
||||
|
||||
|
||||
MP4 DASH
|
||||
========
|
||||
|
||||
This is a header that helps implementing DASH, although it only provides a low
|
||||
level mechanism.
|
||||
|
||||
If this header is set, the given url designates an mp4 init fragment. It's
|
||||
downloaded, and every URL in the EDL is prefixed with the init fragment on the
|
||||
byte stream level. This is mostly for use by mpv's internal ytdl support. The
|
||||
ytdl script will call youtube-dl, which in turn actually processes DASH
|
||||
manifests. It may work only for this very specific purpose and fail to be
|
||||
useful in other scenarios. It can be removed or changed in incompatible ways
|
||||
at any times.
|
||||
|
||||
Example::
|
||||
|
||||
!mp4_dash,init=url
|
||||
|
||||
The ``url`` is encoded as parameter value as defined in the general EDL syntax.
|
||||
It's expected to point to an "initialization fragment", which will be prefixed
|
||||
to every entry in the EDL on the byte stream level.
|
||||
|
||||
The current implementation will
|
||||
|
||||
- ignore stream start times
|
||||
- use durations as hint for seeking only
|
||||
- not adjust source timestamps
|
||||
- open and close segments (i.e. fragments) as needed
|
||||
- not add segment boundaries as chapter points
|
||||
- require full compatibility between all segments (same codec etc.)
|
||||
|
||||
Another header part of this mechanism is ``no_clip``. This header is similar
|
||||
to ``mp4_dash``, but does not include on-demand opening/closing of segments,
|
||||
and does not support init segments. It also exists solely to support internal
|
||||
ytdl requirements. Using ``no_clip`` with segments is not recommended and
|
||||
probably breaks. ``mp4_dash`` already implicitly does a variant of ``no_clip``.
|
||||
|
||||
The ``mp4_dash`` and ``no_clip`` headers are not part of the core EDL format.
|
||||
They may be changed or removed at any time, depending on mpv's internal
|
||||
requirements.
|
||||
|
||||
Separate files for tracks
|
||||
=========================
|
||||
|
||||
The special ``new_stream`` header lets you specify separate parts and time
|
||||
offsets for separate tracks. This can for example be used to source audio and
|
||||
video track from separate files.
|
||||
|
||||
Example::
|
||||
|
||||
# mpv EDL v0
|
||||
video.mkv
|
||||
!new_stream
|
||||
audio.mkv
|
||||
|
||||
This adds all tracks from both files to the virtual track list. Upon playback,
|
||||
the tracks will be played at the same time, instead of appending them. The files
|
||||
can contain more than 1 stream; the apparent effect is the same as if the second
|
||||
part after the ``!new_stream`` part were in a separate ``.edl`` file and added
|
||||
with ``--external-file``.
|
||||
|
||||
Note that all metadata between the stream sets created by ``new_stream`` is
|
||||
disjoint. Global metadata is taken from the first part only.
|
||||
|
||||
In context of mpv, this is redundant to the ``--audio-file`` and
|
||||
``--external-file`` options, but (as of this writing) has the advantage that
|
||||
this will use a unified cache for all streams.
|
||||
|
||||
The ``new_stream`` header is not part of the core EDL format. It may be changed
|
||||
or removed at any time, depending on mpv's internal requirements.
|
||||
|
||||
If the first ``!new_stream`` is redundant, it is ignored. This is the same
|
||||
example as above::
|
||||
|
||||
# mpv EDL v0
|
||||
!new_stream
|
||||
video.mkv
|
||||
!new_stream
|
||||
audio.mkv
|
||||
|
||||
Note that ``!new_stream`` must be the first header. Whether the parser accepts
|
||||
(i.e. ignores) or rejects other headers before that is implementation specific.
|
||||
|
||||
Track metadata
|
||||
==============
|
||||
|
||||
The special ``track_meta`` header can set some specific metadata fields of the
|
||||
current ``!new_stream`` partition. The tags are applied to all tracks within
|
||||
the partition. It is not possible to set the metadata for individual tracks (the
|
||||
feature was needed only for single-track media).
|
||||
|
||||
It provides following parameters change track metadata:
|
||||
|
||||
``lang``
|
||||
Set the language tag.
|
||||
|
||||
``title``
|
||||
Set the title tag.
|
||||
|
||||
``byterate``
|
||||
Number of bytes per second this stream uses. (Purely informational.)
|
||||
|
||||
``program_id``
|
||||
Assign this track to a program (integer, default: -1 meaning unset).
|
||||
|
||||
``index``
|
||||
The numeric index of the track this should map to (default: -1). This is
|
||||
the 0-based index of the virtual stream as seen by the player, enumerating
|
||||
all audio/video/subtitle streams. If nothing matches, this is silently
|
||||
discarded. The special index -1 (the default) has two meanings: if there
|
||||
was a previous meta data entry (either ``!track_meta`` or ``!delay_open``
|
||||
element since the last ``!new_stream``), then this element manipulates
|
||||
the previous meta data entry. If there was no previous entry, a new meta
|
||||
data entry that matches all streams is created.
|
||||
|
||||
Example::
|
||||
|
||||
# mpv EDL v0
|
||||
!track_meta,lang=bla,title=blabla
|
||||
file.mkv
|
||||
!new_stream
|
||||
!track_meta,title=ducks
|
||||
sub.srt
|
||||
|
||||
If ``file.mkv`` has an audio and a video stream, both will use ``blabla`` as
|
||||
title. The subtitle stream will use ``ducks`` as title.
|
||||
|
||||
The ``track_meta`` header is not part of the core EDL format. It may be changed
|
||||
or removed at any time, depending on mpv's internal requirements.
|
||||
|
||||
Global metadata
|
||||
===============
|
||||
|
||||
The special ``global_tags`` header can set metadata fields (aka tags) of the EDL
|
||||
file. This metadata is supposed to be informational, much like for example ID3
|
||||
tags in audio files. Due to lack of separation of different kinds of metadata it
|
||||
is unspecified what names are allowed, how they are interpreted, and whether
|
||||
some of them affect playback functionally. (Much of this is unfortunately
|
||||
inherited from FFmpeg. Another consequence of this is that FFmpeg "normalized"
|
||||
tags are recognized, or stuff like replaygain tags.)
|
||||
|
||||
Example::
|
||||
|
||||
!global_tags,title=bla,something_arbitrary=even_more_arbitrary
|
||||
|
||||
Any parameter names are allowed. Repeated use of this adds to the tag list. If
|
||||
``!new_stream`` is used, the location doesn't matter.
|
||||
|
||||
May possibly be ignored in some cases, such as delayed media opening.
|
||||
|
||||
Delayed media opening
|
||||
=====================
|
||||
|
||||
The special ``delay_open`` header can be used to open the media URL of the
|
||||
stream only when the track is selected for the first time. This is supposed to
|
||||
be an optimization to speed up opening of a remote stream if there are many
|
||||
tracks for whatever reasons.
|
||||
|
||||
This has various tricky restrictions, and also will defer failure to open a
|
||||
stream to "later". By design, it's supposed to be used for single-track streams.
|
||||
|
||||
Using multiple segments requires you to specify all offsets and durations (also
|
||||
it was never tested whether it works at all). Interaction with ``mp4_dash`` may
|
||||
be strange.
|
||||
|
||||
You can describe multiple sub-tracks by using multiple ``delay_open`` headers
|
||||
before the same source URL. (If there are multiple sub-tracks of the same media
|
||||
type, then the mapping to the real stream is probably rather arbitrary.) If the
|
||||
source contains tracks not described, a warning is logged when the delayed
|
||||
opening happens, and the track is hidden.
|
||||
|
||||
This has the following parameters:
|
||||
|
||||
``media_type``
|
||||
Required. Must be set to ``video``, ``audio``, or ``sub``. (Other tracks in
|
||||
the opened URL are ignored.)
|
||||
|
||||
``codec``
|
||||
The mpv codec name that is expected. Although mpv tries to initialize a
|
||||
decoder with it currently (and will fail track selection if it does not
|
||||
initialize successfully), it is not used for decoding - decoding still uses
|
||||
the information retrieved from opening the actual media information, and may
|
||||
be a different codec (you should try to avoid this, of course). Defaults to
|
||||
``null``.
|
||||
|
||||
Above also applies for similar fields such as ``w``. These fields are
|
||||
mostly to help with user track pre-selection.
|
||||
|
||||
``flags``
|
||||
A ``+`` separated list of boolean flags. Currently defined flags:
|
||||
|
||||
``default``
|
||||
Set the default track flag.
|
||||
|
||||
``forced``
|
||||
Set the forced track flag.
|
||||
|
||||
Other values are ignored after triggering a warning.
|
||||
|
||||
``w``, ``h``
|
||||
For video codecs: expected video size. See ``codec`` for details.
|
||||
|
||||
``fps``
|
||||
For video codecs: expected video framerate, as integer. (The rate is usually
|
||||
only crudely reported, and it makes no sense to expect exact values.)
|
||||
|
||||
``samplerate``
|
||||
For audio codecs: expected sample rate, as integer.
|
||||
|
||||
The ``delay_open`` header is not part of the core EDL format. It may be changed
|
||||
or removed at any time, depending on mpv's internal requirements.
|
||||
|
||||
Timestamp format
|
||||
================
|
||||
|
||||
@@ -331,8 +101,7 @@ Currently, time values are floating point values in seconds.
|
||||
|
||||
As an extension, you can set the ``timestamps=chapters`` option. If this option
|
||||
is set, timestamps have to be integers, and refer to chapter numbers, starting
|
||||
with 0. The default value for this parameter is ``seconds``, which means the
|
||||
time is as described in the previous paragraph.
|
||||
with 0.
|
||||
|
||||
Example::
|
||||
|
||||
@@ -341,53 +110,6 @@ Example::
|
||||
|
||||
Plays chapter 3 and ends with the start of chapter 7 (4 chapters later).
|
||||
|
||||
Implicit chapters
|
||||
=================
|
||||
|
||||
mpv will add one chapter per segment entry to the virtual timeline.
|
||||
|
||||
By default, the chapter's titles will match the entries' filenames.
|
||||
You can override set the ``title`` option to override the chapter title for
|
||||
that segment.
|
||||
|
||||
Example::
|
||||
|
||||
# mpv EDL v0
|
||||
cap.ts,5,240
|
||||
OP.mkv,0,90,title=Show Opening
|
||||
|
||||
The virtual timeline will have two chapters, one called "cap.ts" from 0-240s
|
||||
and a second one called "Show Opening" from 240-330s.
|
||||
|
||||
Entry which defines the track layout
|
||||
====================================
|
||||
|
||||
Normally, you're supposed to put only files with compatible layouts into an EDL
|
||||
file. However, at least the mpv implementation accepts entries that use
|
||||
different codecs, or even have a different number of audio/video/subtitle
|
||||
tracks. In this case, it's not obvious, which virtual tracks the EDL show should
|
||||
expose when being played.
|
||||
|
||||
Currently, mpv will apply an arbitrary heuristic which tracks the EDL file
|
||||
should expose.
|
||||
|
||||
You can set the ``layout`` option to ``this`` to make a specific entry define
|
||||
the track layout.
|
||||
|
||||
Example::
|
||||
|
||||
# mpv EDL v0
|
||||
file_with_2_streams.ts,5,240
|
||||
file_with_5_streams.mkv,0,90,layout=this
|
||||
|
||||
The way the different virtual EDL tracks are associated with the per-segment
|
||||
ones is highly implementation-defined, and uses a heuristic. If a segment is
|
||||
missing a track, there will be a "hole", and bad behavior may result. Improving
|
||||
this is subject to further development (due to being fringe cases, they don't
|
||||
have a high priority).
|
||||
|
||||
If future versions of mpv change this again, this option may be ignored.
|
||||
|
||||
Syntax of EDL URIs
|
||||
==================
|
||||
|
||||
|
||||
+53
-55
@@ -3,26 +3,27 @@ General usage
|
||||
|
||||
::
|
||||
|
||||
mpv infile --o=outfile [--of=outfileformat] [--ofopts=formatoptions] [--orawts] \
|
||||
mpv infile -o outfile [-of outfileformat] [-ofopts formatoptions] \
|
||||
[-ofps outfps | -oautofps] [-oharddup] [-ocopyts | -orawts] [-oneverdrop] \
|
||||
[(any other mpv options)] \
|
||||
--ovc=outvideocodec [--ovcopts=outvideocodecoptions] \
|
||||
--oac=outaudiocodec [--oacopts=outaudiocodecoptions]
|
||||
-ovc outvideocodec [-ovcopts outvideocodecoptions] \
|
||||
-oac outaudiocodec [-oacopts outaudiocodecoptions]
|
||||
|
||||
Help for these options is provided if giving help as parameter, as in::
|
||||
|
||||
mpv --ovc=help
|
||||
mpv -ovc help
|
||||
|
||||
The suboptions of these generally are identical to ffmpeg's (as option parsing
|
||||
is simply delegated to ffmpeg). The option --ocopyts enables copying timestamps
|
||||
is simply delegated to ffmpeg). The option -ocopyts enables copying timestamps
|
||||
from the source as-is, instead of fixing them to match audio playback time
|
||||
(note: this doesn't work with all output container formats); --orawts even turns
|
||||
(note: this doesn't work with all output container formats); -orawts even turns
|
||||
off discontinuity fixing.
|
||||
|
||||
Note that if neither --ofps nor --oautofps is specified, VFR encoding is assumed
|
||||
and the time base is 24000fps. --oautofps sets --ofps to a guessed fps number
|
||||
Note that if neither -ofps nor -oautofps is specified, VFR encoding is assumed
|
||||
and the time base is 24000fps. -oautofps sets -ofps to a guessed fps number
|
||||
from the input video. Note that not all codecs and not all formats support VFR
|
||||
encoding, and some which do have bugs when a target bitrate is specified - use
|
||||
--ofps or --oautofps to force CFR encoding in these cases.
|
||||
-ofps or -oautofps to force CFR encoding in these cases.
|
||||
|
||||
Of course, the options can be stored in a profile, like this .config/mpv/mpv.conf
|
||||
section::
|
||||
@@ -30,23 +31,21 @@ section::
|
||||
[myencprofile]
|
||||
vf-add = scale=480:-2
|
||||
ovc = libx264
|
||||
ovcopts-add = preset=medium
|
||||
ovcopts-add = tune=fastdecode
|
||||
ovcopts-add = preset=medium,tune=fastdecode
|
||||
ovcopts-add = crf=23
|
||||
ovcopts-add = maxrate=1500k
|
||||
ovcopts-add = bufsize=1000k
|
||||
ovcopts-add = rc_init_occupancy=900k
|
||||
ovcopts-add = refs=2
|
||||
ovcopts-add = maxrate=1500k,bufsize=1000k,rc_init_occupancy=900k,refs=2
|
||||
ovcopts-add = profile=baseline
|
||||
oac = aac
|
||||
oacopts-add = b=96k
|
||||
|
||||
It's also possible to define default encoding options by putting them into
|
||||
the section named ``[encoding]``.
|
||||
the section named ``[encoding]``. (This behavior changed after mpv 0.3.x. In
|
||||
mpv 0.3.x, config options in the default section / no section were applied
|
||||
to encoding. This is not the case anymore.)
|
||||
|
||||
One can then encode using this profile using the command::
|
||||
|
||||
mpv infile --o=outfile.mp4 --profile=myencprofile
|
||||
mpv infile -o outfile.mp4 -profile myencprofile
|
||||
|
||||
Some example profiles are provided in a file
|
||||
etc/encoding-profiles.conf; as for this, see below.
|
||||
@@ -60,33 +59,33 @@ for.
|
||||
|
||||
Typical MPEG-4 Part 2 ("ASP", "DivX") encoding, AVI container::
|
||||
|
||||
mpv infile --o=outfile.avi \
|
||||
--vf=fps=25 \
|
||||
--ovc=mpeg4 --ovcopts=qscale=4 \
|
||||
--oac=libmp3lame --oacopts=b=128k
|
||||
mpv infile -o outfile.avi \
|
||||
-ofps 25 \
|
||||
-ovc mpeg4 -ovcopts qscale=4 \
|
||||
-oac libmp3lame -oacopts ab=128k
|
||||
|
||||
Note: AVI does not support variable frame rate, so the fps filter must be used.
|
||||
The frame rate should ideally match the input (25 for PAL, 24000/1001 or
|
||||
30000/1001 for NTSC)
|
||||
Note: AVI does not support variable frame rate, so -ofps must be used. The
|
||||
frame rate should ideally match the input (25 for PAL, 24000/1001 or 30000/1001
|
||||
for NTSC)
|
||||
|
||||
Typical MPEG-4 Part 10 ("AVC", "H.264") encoding, Matroska (MKV) container::
|
||||
|
||||
mpv infile --o=outfile.mkv \
|
||||
--ovc=libx264 --ovcopts=preset=medium,crf=23,profile=baseline \
|
||||
--oac=libopus --oacopts=qscale=3
|
||||
mpv infile -o outfile.mkv \
|
||||
-ovc libx264 -ovcopts preset=medium,crf=23,profile=baseline \
|
||||
-oac libvorbis -oacopts qscale=3
|
||||
|
||||
Typical MPEG-4 Part 10 ("AVC", "H.264") encoding, MPEG-4 (MP4) container::
|
||||
|
||||
mpv infile --o=outfile.mp4 \
|
||||
--ovc=libx264 --ovcopts=preset=medium,crf=23,profile=baseline \
|
||||
--oac=aac --oacopts=b=128k
|
||||
mpv infile -o outfile.mp4 \
|
||||
-ovc libx264 -ovcopts preset=medium,crf=23,profile=baseline \
|
||||
-oac aac -oacopts ab=128k
|
||||
|
||||
Typical VP8 encoding, WebM (restricted Matroska) container::
|
||||
|
||||
mpv infile -o outfile.mkv \
|
||||
--of=webm \
|
||||
--ovc=libvpx --ovcopts=qmin=6,b=1000000k \
|
||||
--oac=libopus --oacopts=qscale=3
|
||||
-of webm \
|
||||
-ovc libvpx -ovcopts qmin=6,b=1000000k \
|
||||
-oac libvorbis -oacopts qscale=3
|
||||
|
||||
|
||||
Device targets
|
||||
@@ -95,29 +94,28 @@ Device targets
|
||||
As the options for various devices can get complex, profiles can be used.
|
||||
|
||||
An example profile file for encoding is provided in
|
||||
etc/encoding-profiles.conf in the source tree. mpv will read any file
|
||||
named ``encoding-profiles.conf`` in either the local or system
|
||||
configuration directories.
|
||||
etc/encoding-profiles.conf in the source tree. This file is installed and loaded
|
||||
by default (if libavfilter is enabled at compilation). If you want to modify
|
||||
it, you can replace and it with your own copy by doing::
|
||||
|
||||
Keep in mind that the default profile is the playback one. If you want to add
|
||||
options that apply only in encoding mode, put them into a ``[encoding]``
|
||||
section.
|
||||
mkdir -p ~/.mpv
|
||||
cp /etc/mpv/encoding-profiles.conf ~/.mpv/encoding-profiles.conf
|
||||
|
||||
Refer to the top of that file for more comments - in a nutshell, the following
|
||||
options are added by it::
|
||||
|
||||
--profile=enc-to-dvdpal # DVD-Video PAL, use dvdauthor -v pal+4:3 -a ac3+en
|
||||
--profile=enc-to-dvdntsc # DVD-Video NTSC, use dvdauthor -v ntsc+4:3 -a ac3+en
|
||||
--profile=enc-to-bb-9000 # MP4 for Blackberry Bold 9000
|
||||
--profile=enc-to-nok-6300 # 3GP for Nokia 6300
|
||||
--profile=enc-to-psp # MP4 for PlayStation Portable
|
||||
--profile=enc-to-iphone # MP4 for iPhone
|
||||
--profile=enc-to-iphone-4 # MP4 for iPhone 4 (double res)
|
||||
--profile=enc-to-iphone-5 # MP4 for iPhone 5 (even larger res)
|
||||
-profile enc-to-dvdpal DVD-Video PAL, use dvdauthor -v pal+4:3 -a ac3+en
|
||||
-profile enc-to-dvdntsc DVD-Video NTSC, use dvdauthor -v ntsc+4:3 -a ac3+en
|
||||
-profile enc-to-bb-9000 MP4 for Blackberry Bold 9000
|
||||
-profile enc-to-nok-6300 3GP for Nokia 6300
|
||||
-profile enc-to-psp MP4 for PlayStation Portable
|
||||
-profile enc-to-iphone MP4 for iPhone
|
||||
-profile enc-to-iphone-4 MP4 for iPhone 4 (double res)
|
||||
-profile enc-to-iphone-5 MP4 for iPhone 5 (even larger res)
|
||||
|
||||
You can encode using these with a command line like::
|
||||
|
||||
mpv infile --o=outfile.mp4 --profile=enc-to-bb-9000
|
||||
mpv infile -o outfile.mp4 -profile enc-to-bb-9000
|
||||
|
||||
Of course, you are free to override options set by these profiles by specifying
|
||||
them after the -profile option.
|
||||
@@ -127,20 +125,20 @@ What works
|
||||
==========
|
||||
|
||||
* Encoding at variable frame rate (default)
|
||||
* Encoding at constant frame rate using --vf=fps=RATE
|
||||
* 2-pass encoding (specify flags=+pass1 in the first pass's --ovcopts, specify
|
||||
* Encoding at constant frame rate using -ofps framerate -oharddup
|
||||
* 2-pass encoding (specify flags=+pass1 in the first pass's -ovcopts, specify
|
||||
flags=+pass2 in the second pass)
|
||||
* Hardcoding subtitles using vobsub, ass or srt subtitle rendering (just
|
||||
configure mpv for the subtitles as usual)
|
||||
* Hardcoding any other mpv OSD (e.g. time codes, using --osdlevel=3 and
|
||||
--vf=expand=::::1)
|
||||
* Hardcoding any other mpv OSD (e.g. time codes, using -osdlevel 3 and -vf
|
||||
expand=::::1)
|
||||
* Encoding directly from a DVD, network stream, webcam, or any other source
|
||||
mpv supports
|
||||
* Using x264 presets/tunings/profiles (by using profile=, tune=, preset= in the
|
||||
--ovcopts)
|
||||
-ovcopts)
|
||||
* Deinterlacing/Inverse Telecine with any of mpv's filters for that
|
||||
* Audio file converting: mpv --o=outfile.m4a infile.flac --no-video
|
||||
--oac=aac --oacopts=b=320k
|
||||
* Audio file converting: mpv -o outfile.mp3 infile.flac -no-video -oac
|
||||
libmp3lame -oacopts ab=320k
|
||||
|
||||
What does not work yet
|
||||
======================
|
||||
|
||||
+1
-1191
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
||||
change `ytdl_hook-all_formats` default to `yes`
|
||||
@@ -1 +0,0 @@
|
||||
make `--autocreate-playlist` only activate for regular files
|
||||
@@ -1 +0,0 @@
|
||||
make the `metadata/by-key` property writable
|
||||
@@ -1 +0,0 @@
|
||||
'command-list' now also returns a default value and available choices where applicable for each command argument.
|
||||
@@ -1 +0,0 @@
|
||||
make `mpv_command_node` accept `_name` for command name
|
||||
@@ -1 +0,0 @@
|
||||
add `--demuxer-hysteresis-bytes`
|
||||
@@ -1,2 +0,0 @@
|
||||
add `--input-builtin-drag-and-drop` option
|
||||
add `dropped-file` property
|
||||
@@ -1 +0,0 @@
|
||||
remove the deprecated `error` field from `end-file`
|
||||
@@ -1 +0,0 @@
|
||||
add `env` property that can be used to retrieve environment variables
|
||||
@@ -1 +0,0 @@
|
||||
deprecate `--foo`, instead use `--bar=foo` as a replacement
|
||||
@@ -1 +0,0 @@
|
||||
the `expand-properties` command modifier also applies to string lists now
|
||||
@@ -1 +0,0 @@
|
||||
`--geometry` x/y position is now applied only on initial window creation, unless `--force-window-position=yes` is set.
|
||||
@@ -1 +0,0 @@
|
||||
add libcurl-based stream backend (http, https, ftp, ftps), with new options `--curl-enabled`, `--curl-http-version`, `--curl-max-redirects`, `--curl-max-retries`, `--curl-connect-timeout`, `--curl-buffer-size` and `--curl-max-request-size`
|
||||
@@ -1 +0,0 @@
|
||||
add `libplacebo-version` property
|
||||
@@ -1 +0,0 @@
|
||||
the `loadfile` and `loadlist` commands can now take multiple flags (i.e. `append+play`)
|
||||
@@ -1 +0,0 @@
|
||||
deprecate `mp.input.log_error()`
|
||||
@@ -1 +0,0 @@
|
||||
stop searching the deprecated `lua-settings` directory for script config files
|
||||
@@ -1 +0,0 @@
|
||||
add `user-data/mpv/context-menu/open` sub-property
|
||||
@@ -1,4 +0,0 @@
|
||||
`mp.input.get()` `complete` callbacks are now passed a second argument,
|
||||
a function which can be passed the completion values, which allows generating
|
||||
completions asynchronously. The old method of returning completions from
|
||||
the callback is now deprecated.
|
||||
@@ -1 +0,0 @@
|
||||
add `console_opt_overrides` argument to `mp.input.get()` and `mp.input.select()`
|
||||
@@ -1,2 +0,0 @@
|
||||
add `mp.utils.terminal_display_width()` function that measures the width of
|
||||
a string in terminal cells
|
||||
@@ -1 +0,0 @@
|
||||
add `on_loaded` hook
|
||||
@@ -1 +0,0 @@
|
||||
add `audioonlyscreen` script option to osc
|
||||
@@ -1,2 +0,0 @@
|
||||
add `boxwidth` script option to osc
|
||||
add `slimboxwidth` script option to osc
|
||||
@@ -1,2 +0,0 @@
|
||||
add `skip_{backward,forward}_mbtn_*_down_command` script-opt for osc
|
||||
add `{close,minimize,maximize}_mbtn_*_command` script-opt for osc
|
||||
@@ -1 +0,0 @@
|
||||
add `osc-icon_style` option
|
||||
@@ -1,3 +0,0 @@
|
||||
add `osc-dynamic_margins` option
|
||||
add `osc-sub-margin` option
|
||||
add `osc-osd-margin` option
|
||||
@@ -1 +0,0 @@
|
||||
add `osc-windowcontrols_independent` script-opt
|
||||
@@ -1 +0,0 @@
|
||||
remove `windowcontrols_title` script-opt from osc, use `title` mpv option instead
|
||||
@@ -1 +0,0 @@
|
||||
make `player-operation-mode` readable as a property
|
||||
@@ -1 +0,0 @@
|
||||
add `preserve-options` flag to `playlist-play-index`
|
||||
@@ -1,6 +0,0 @@
|
||||
``track-list`` is now filtered by the currently selected edition
|
||||
add ``edition-list/N/metadata`` sub-property
|
||||
add ``program_id`` support to EDL ``!track_meta`` header
|
||||
add ``--flatten-editions`` option to disable program-based edition grouping
|
||||
add ``track-list/N/program-ids`` sub-property
|
||||
deprecate ``track-list/N/program-id`` in favor of ``track-list/N/program-ids``
|
||||
@@ -1 +0,0 @@
|
||||
change `%tX` format specifier of `--screenshot-template` option to only accept C11 strftime specifiers or `%s` specifier
|
||||
@@ -1 +0,0 @@
|
||||
add `--target-trc=scrgb`
|
||||
@@ -1,2 +0,0 @@
|
||||
``track-list`` now hides dependent tracks (e.g. tile sub-streams, IAMF audio element layers, LCEVC enhancement streams) by default
|
||||
add ``--show-dependent-tracks`` option to expose them
|
||||
@@ -1 +0,0 @@
|
||||
effective `--image-display-duration` takes `--speed` into consideration now
|
||||
@@ -1,2 +0,0 @@
|
||||
add `track_info_selected_only` script option for stats
|
||||
add `track-list/N/demux-duration` property
|
||||
@@ -1 +0,0 @@
|
||||
add `sub-lines` and `secondary-sub-lines` properties
|
||||
@@ -1 +0,0 @@
|
||||
`--target-gamut` now accepts custom CIE xy primaries as comma-separated values (Rx,Ry,Gx,Gy,Bx,By,Wx,Wy) in addition to named primary sets
|
||||
@@ -1 +0,0 @@
|
||||
remove the deprecated `time-start` property
|
||||
@@ -1 +0,0 @@
|
||||
change `--tls-verify` default to `yes`
|
||||
@@ -1,2 +0,0 @@
|
||||
add `update-clipboard` command
|
||||
change `clipboard` property to require `update-clipboard` command when clipboard monitoring is disabled
|
||||
@@ -1 +0,0 @@
|
||||
add `--vf=amf_frc`
|
||||
@@ -1 +0,0 @@
|
||||
rename `d3d11vpp=mode=ivctc` to `d3d11vpp=mode=ivtc`
|
||||
@@ -1 +0,0 @@
|
||||
deprecate `--vf=format=sig-peak`
|
||||
@@ -1 +0,0 @@
|
||||
deprecate `--vo=vaapi`
|
||||
@@ -1 +0,0 @@
|
||||
add support for (a subset of) tunable parameter for `vo=gpu`
|
||||
@@ -1,2 +0,0 @@
|
||||
add `--wayland-session=<string>`
|
||||
restore the mpv window on wayland using xdg-session-management-v1
|
||||
@@ -0,0 +1,14 @@
|
||||
Client API (libmpv) documentation and examples
|
||||
==============================================
|
||||
|
||||
libmpv lets you embed mpv as a library. It is meant to enable development of
|
||||
GUI frontends.
|
||||
|
||||
Since libmpv merely allows access to underlying mechanisms that can control
|
||||
mpv, documentation is spread over a few places:
|
||||
|
||||
- https://github.com/mpv-player/mpv/blob/master/libmpv/client.h
|
||||
- http://mpv.io/manual/master/#options
|
||||
- http://mpv.io/manual/master/#list-of-input-commands
|
||||
- http://mpv.io/manual/master/#properties
|
||||
- https://github.com/mpv-player/mpv-examples/tree/master/libmpv
|
||||
+284
-93
@@ -4,11 +4,8 @@ AUDIO FILTERS
|
||||
Audio filters allow you to modify the audio stream and its properties. The
|
||||
syntax is:
|
||||
|
||||
``--af=...``
|
||||
Setup a chain of audio filters. See ``--vf`` (`VIDEO FILTERS`_) for the
|
||||
full syntax.
|
||||
|
||||
This is an object settings list option. See `List Options`_ for details.
|
||||
``--af=<filter1[=parameter1:parameter2:...],filter2,...>``
|
||||
Setup a chain of audio filters.
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -18,15 +15,62 @@ syntax is:
|
||||
wrapper, which gives you access to most of libavfilter's filters. This
|
||||
includes all filters that have been ported from MPlayer to libavfilter.
|
||||
|
||||
The ``--vf`` description describes how libavfilter can be used and how to
|
||||
workaround deprecated mpv filters.
|
||||
You can also set defaults for each filter. The defaults are applied before the
|
||||
normal filter parameters.
|
||||
|
||||
See ``--vf`` group of options for info on how ``--af-add``, ``--af-pre``,
|
||||
``--af-clr``, and possibly others work.
|
||||
``--af-defaults=<filter1[=parameter1:parameter2:...],filter2,...>``
|
||||
Set defaults for each filter.
|
||||
|
||||
Audio filters are managed in lists. There are a few commands to manage the
|
||||
filter list:
|
||||
|
||||
``--af-add=<filter1[,filter2,...]>``
|
||||
Appends the filters given as arguments to the filter list.
|
||||
|
||||
``--af-pre=<filter1[,filter2,...]>``
|
||||
Prepends the filters given as arguments to the filter list.
|
||||
|
||||
``--af-del=<index1[,index2,...]>``
|
||||
Deletes the filters at the given indexes. Index numbers start at 0,
|
||||
negative numbers address the end of the list (-1 is the last).
|
||||
|
||||
``--af-clr``
|
||||
Completely empties the filter list.
|
||||
|
||||
Available filters are:
|
||||
|
||||
``lavcac3enc[=options]``
|
||||
``lavrresample[=option1:option2:...]``
|
||||
This filter uses libavresample (or libswresample, depending on the build)
|
||||
to change sample rate, sample format, or channel layout of the audio stream.
|
||||
This filter is automatically enabled if the audio output does not support
|
||||
the audio configuration of the file being played.
|
||||
|
||||
It supports only the following sample formats: u8, s16, s32, float.
|
||||
|
||||
``filter-size=<length>``
|
||||
Length of the filter with respect to the lower sampling rate. (default:
|
||||
16)
|
||||
``phase-shift=<count>``
|
||||
Log2 of the number of polyphase entries. (..., 10->1024, 11->2048,
|
||||
12->4096, ...) (default: 10->1024)
|
||||
``cutoff=<cutoff>``
|
||||
Cutoff frequency (0.0-1.0), default set depending upon filter length.
|
||||
``linear``
|
||||
If set then filters will be linearly interpolated between polyphase
|
||||
entries. (default: no)
|
||||
``no-detach``
|
||||
Do not detach if input and output audio format/rate/channels match.
|
||||
(If you just want to set defaults for this filter that will be used
|
||||
even by automatically inserted lavrresample instances, you should
|
||||
prefer setting them with ``--af-defaults=lavrresample:...``.)
|
||||
``normalize=<yes|no|auto>``
|
||||
Whether to normalize when remixing channel layouts (default: auto).
|
||||
``auto`` uses the value set by ``--audio-normalize-downmix``.
|
||||
``o=<string>``
|
||||
Set AVOptions on the SwrContext or AVAudioResampleContext. These should
|
||||
be documented by FFmpeg or Libav.
|
||||
|
||||
``lavcac3enc[=tospdif[:bitrate[:minch]]]``
|
||||
Encode multi-channel audio to AC-3 at runtime using libavcodec. Supports
|
||||
16-bit native-endian input format, maximum 6 channels. The output is
|
||||
big-endian when outputting a raw AC-3 stream, native-endian when
|
||||
@@ -59,11 +103,82 @@ Available filters are:
|
||||
If the input channel number is less than ``<minch>``, the filter will
|
||||
detach itself (default: 3).
|
||||
|
||||
``encoder=<name>``
|
||||
Select the libavcodec encoder used. Currently, this should be an AC-3
|
||||
encoder, and using another codec will fail horribly.
|
||||
``equalizer=g1:g2:g3:...:g10``
|
||||
10 octave band graphic equalizer, implemented using 10 IIR band-pass
|
||||
filters. This means that it works regardless of what type of audio is
|
||||
being played back. The center frequencies for the 10 bands are:
|
||||
|
||||
``format=format:srate:channels:out-srate:out-channels``
|
||||
=== ==========
|
||||
No. frequency
|
||||
=== ==========
|
||||
0 31.25 Hz
|
||||
1 62.50 Hz
|
||||
2 125.00 Hz
|
||||
3 250.00 Hz
|
||||
4 500.00 Hz
|
||||
5 1.00 kHz
|
||||
6 2.00 kHz
|
||||
7 4.00 kHz
|
||||
8 8.00 kHz
|
||||
9 16.00 kHz
|
||||
=== ==========
|
||||
|
||||
If the sample rate of the sound being played is lower than the center
|
||||
frequency for a frequency band, then that band will be disabled. A known
|
||||
bug with this filter is that the characteristics for the uppermost band
|
||||
are not completely symmetric if the sample rate is close to the center
|
||||
frequency of that band. This problem can be worked around by upsampling
|
||||
the sound using a resampling filter before it reaches this filter.
|
||||
|
||||
``<g1>:<g2>:<g3>:...:<g10>``
|
||||
floating point numbers representing the gain in dB for each frequency
|
||||
band (-12-12)
|
||||
|
||||
.. admonition:: Example
|
||||
|
||||
``mpv --af=equalizer=11:11:10:5:0:-12:0:5:12:12 media.avi``
|
||||
Would amplify the sound in the upper and lower frequency region
|
||||
while canceling it almost completely around 1 kHz.
|
||||
|
||||
``channels=nch[:routes]``
|
||||
Can be used for adding, removing, routing and copying audio channels. If
|
||||
only ``<nch>`` is given, the default routing is used. It works as follows:
|
||||
If the number of output channels is greater than the number of input
|
||||
channels, empty channels are inserted (except when mixing from mono to
|
||||
stereo; then the mono channel is duplicated). If the number of output
|
||||
channels is less than the number of input channels, the exceeding
|
||||
channels are truncated.
|
||||
|
||||
``<nch>``
|
||||
number of output channels (1-8)
|
||||
``<routes>``
|
||||
List of ``,`` separated routes, in the form ``from1-to1,from2-to2,...``.
|
||||
Each pair defines where to route each channel. There can be at most
|
||||
8 routes. Without this argument, the default routing is used. Since
|
||||
``,`` is also used to separate filters, you must quote this argument
|
||||
with ``[...]`` or similar.
|
||||
|
||||
.. admonition:: Examples
|
||||
|
||||
``mpv --af=channels=4:[0-1,1-0,2-2,3-3] media.avi``
|
||||
Would change the number of channels to 4 and set up 4 routes that
|
||||
swap channel 0 and channel 1 and leave channel 2 and 3 intact.
|
||||
Observe that if media containing two channels were played back,
|
||||
channels 2 and 3 would contain silence but 0 and 1 would still be
|
||||
swapped.
|
||||
|
||||
``mpv --af=channels=6:[0-0,0-1,0-2,0-3] media.avi``
|
||||
Would change the number of channels to 6 and set up 4 routes that
|
||||
copy channel 0 to channels 0 to 3. Channel 4 and 5 will contain
|
||||
silence.
|
||||
|
||||
.. note::
|
||||
|
||||
You should probably not use this filter. If you want to change the
|
||||
output channel layout, try the ``format`` filter, which can make mpv
|
||||
automatically up- and downmix standard channel layouts.
|
||||
|
||||
``format=format:srate:channels:out-format:out-srate:out-channels``
|
||||
Does not do any format conversion itself. Rather, it may cause the
|
||||
filter system to insert necessary conversion filters before or after this
|
||||
filter if needed. It is primarily useful for controlling the audio format
|
||||
@@ -92,6 +207,8 @@ Available filters are:
|
||||
Force mixing to a specific channel layout. See ``--audio-channels`` option
|
||||
for possible values.
|
||||
|
||||
``<out-format>``
|
||||
|
||||
``<out-srate>``
|
||||
|
||||
``<out-channels>``
|
||||
@@ -100,9 +217,151 @@ Available filters are:
|
||||
used to do conversion itself, unlike this one which lets the filter system
|
||||
handle the conversion.
|
||||
|
||||
``volume[=<volumedb>[:...]]``
|
||||
Implements software volume control. Use this filter with caution since it
|
||||
can reduce the signal to noise ratio of the sound. In most cases it is
|
||||
best to use the *Master* volume control of your sound card or the volume
|
||||
knob on your amplifier.
|
||||
|
||||
*NOTE*: This filter is not reentrant and can therefore only be enabled
|
||||
once for every audio stream.
|
||||
|
||||
``<volumedb>``
|
||||
Sets the desired gain in dB for all channels in the stream from -200 dB
|
||||
to +60 dB, where -200 dB mutes the sound completely and +60 dB equals a
|
||||
gain of 1000 (default: 0).
|
||||
``replaygain-track``
|
||||
Adjust volume gain according to the track-gain replaygain value stored
|
||||
in the file metadata.
|
||||
``replaygain-album``
|
||||
Like replaygain-track, but using the album-gain value instead.
|
||||
``replaygain-preamp``
|
||||
Pre-amplification gain in dB to apply to the selected replaygain gain
|
||||
(default: 0).
|
||||
``replaygain-clip=yes|no``
|
||||
Prevent clipping caused by replaygain by automatically lowering the
|
||||
gain (default). Use ``replaygain-clip=no`` to disable this.
|
||||
``replaygain-fallback``
|
||||
Gain in dB to apply if the file has no replay gain tags. This option
|
||||
is always applied if the replaygain logic is somehow inactive. If this
|
||||
is applied, no other replaygain options are applied.
|
||||
``softclip``
|
||||
Turns soft clipping on. Soft-clipping can make the
|
||||
sound more smooth if very high volume levels are used. Enable this
|
||||
option if the dynamic range of the loudspeakers is very low.
|
||||
|
||||
*WARNING*: This feature creates distortion and should be considered a
|
||||
last resort.
|
||||
``s16``
|
||||
Force S16 sample format if set. Lower quality, but might be faster
|
||||
in some situations.
|
||||
``detach``
|
||||
Remove the filter if the volume is not changed at audio filter config
|
||||
time. Useful with replaygain: if the current file has no replaygain
|
||||
tags, then the filter will be removed if this option is enabled.
|
||||
(If ``--softvol=yes`` is used and the player volume controls are used
|
||||
during playback, a different volume filter will be inserted.)
|
||||
|
||||
.. admonition:: Example
|
||||
|
||||
``mpv --af=volume=10.1 media.avi``
|
||||
Would amplify the sound by 10.1 dB and hard-clip if the sound level
|
||||
is too high.
|
||||
|
||||
``pan=n:[<matrix>]``
|
||||
Mixes channels arbitrarily. Basically a combination of the volume and the
|
||||
channels filter that can be used to down-mix many channels to only a few,
|
||||
e.g. stereo to mono, or vary the "width" of the center speaker in a
|
||||
surround sound system. This filter is hard to use, and will require some
|
||||
tinkering before the desired result is obtained. The number of options for
|
||||
this filter depends on the number of output channels. An example how to
|
||||
downmix a six-channel file to two channels with this filter can be found
|
||||
in the examples section near the end.
|
||||
|
||||
``<n>``
|
||||
Number of output channels (1-8).
|
||||
``<matrix>``
|
||||
A list of values ``[L00,L01,L02,...,L10,L11,L12,...,Ln0,Ln1,Ln2,...]``,
|
||||
where each element ``Lij`` means how much of input channel i is mixed
|
||||
into output channel j (range 0-1). So in principle you first have n
|
||||
numbers saying what to do with the first input channel, then n numbers
|
||||
that act on the second input channel etc. If you do not specify any
|
||||
numbers for some input channels, 0 is assumed.
|
||||
Note that the values are separated by ``,``, which is already used
|
||||
by the option parser to separate filters. This is why you must quote
|
||||
the value list with ``[...]`` or similar.
|
||||
|
||||
.. admonition:: Examples
|
||||
|
||||
``mpv --af=pan=1:[0.5,0.5] media.avi``
|
||||
Would downmix from stereo to mono.
|
||||
|
||||
``mpv --af=pan=3:[1,0,0.5,0,1,0.5] media.avi``
|
||||
Would give 3 channel output leaving channels 0 and 1 intact, and mix
|
||||
channels 0 and 1 into output channel 2 (which could be sent to a
|
||||
subwoofer for example).
|
||||
|
||||
.. note::
|
||||
|
||||
If you just want to force remixing to a certain output channel layout,
|
||||
it is easier to use the ``format`` filter. For example,
|
||||
``mpv '--af=format=channels=5.1' '--audio-channels=5.1'`` would always force
|
||||
remixing audio to 5.1 and output it like this.
|
||||
|
||||
``delay[=[ch1,ch2,...]]``
|
||||
Delays the sound to the loudspeakers such that the sound from the
|
||||
different channels arrives at the listening position simultaneously. It is
|
||||
only useful if you have more than 2 loudspeakers.
|
||||
|
||||
``[ch1,ch2,...]``
|
||||
The delay in ms that should be imposed on each channel (floating point
|
||||
number between 0 and 1000).
|
||||
|
||||
To calculate the required delay for the different channels, do as follows:
|
||||
|
||||
1. Measure the distance to the loudspeakers in meters in relation to your
|
||||
listening position, giving you the distances s1 to s5 (for a 5.1
|
||||
system). There is no point in compensating for the subwoofer (you will
|
||||
not hear the difference anyway).
|
||||
|
||||
2. Subtract the distances s1 to s5 from the maximum distance, i.e.
|
||||
``s[i] = max(s) - s[i]; i = 1...5``.
|
||||
|
||||
3. Calculate the required delays in ms as ``d[i] = 1000*s[i]/342; i =
|
||||
1...5``.
|
||||
|
||||
.. admonition:: Example
|
||||
|
||||
``mpv --af=delay=[10.5,10.5,0,0,7,0] media.avi``
|
||||
Would delay front left and right by 10.5 ms, the two rear channels
|
||||
and the subwoofer by 0 ms and the center channel by 7 ms.
|
||||
|
||||
``drc[=method:target]``
|
||||
Applies dynamic range compression. This maximizes the volume by compressing
|
||||
the audio signal's dynamic range. (Formerly called ``volnorm``.)
|
||||
|
||||
``<method>``
|
||||
Sets the used method.
|
||||
|
||||
1
|
||||
Use a single sample to smooth the variations via the standard
|
||||
weighted mean over past samples (default).
|
||||
2
|
||||
Use several samples to smooth the variations via the standard
|
||||
weighted mean over past samples.
|
||||
|
||||
``<target>``
|
||||
Sets the target amplitude as a fraction of the maximum for the sample
|
||||
type (default: 0.25).
|
||||
|
||||
.. note::
|
||||
|
||||
This filter can cause distortion with audio signals that have a very
|
||||
large dynamic range.
|
||||
|
||||
``scaletempo[=option1:option2:...]``
|
||||
Scales audio tempo without altering pitch, optionally synced to playback
|
||||
speed.
|
||||
speed (default).
|
||||
|
||||
This works by playing 'stride' ms of audio at normal speed then consuming
|
||||
'stride*scale' ms of input audio. It pieces the strides together by
|
||||
@@ -118,8 +377,8 @@ Available filters are:
|
||||
cause noticeable skips at high scale amounts and an echo at low scale
|
||||
amounts. Very low values will alter pitch. Increasing improves
|
||||
performance. (default: 60)
|
||||
``overlap=<factor>``
|
||||
Factor of stride to overlap. Decreasing improves performance.
|
||||
``overlap=<percent>``
|
||||
Percentage of stride to overlap. Decreasing improves performance.
|
||||
(default: .20)
|
||||
``search=<amount>``
|
||||
Length in milliseconds to search for best overlap position. Decreasing
|
||||
@@ -159,77 +418,29 @@ Available filters are:
|
||||
``mpv --af=scaletempo=stride=30:overlap=.50:search=10 media.ogg``
|
||||
Would tweak the quality and performance parameters.
|
||||
|
||||
``mpv --af=format=float,scaletempo media.ogg``
|
||||
Would make scaletempo use float code. Maybe faster on some
|
||||
platforms.
|
||||
|
||||
``mpv --af=scaletempo=scale=1.2:speed=pitch audio.ogg``
|
||||
Would play media at 1.2x normal speed, with audio at normal pitch.
|
||||
Changing playback speed would change pitch, leaving audio tempo at
|
||||
1.2x.
|
||||
|
||||
``scaletempo2[=option1:option2:...]``
|
||||
Scales audio tempo without altering pitch.
|
||||
The algorithm is ported from chromium and uses the
|
||||
Waveform Similarity Overlap-and-add (WSOLA) method.
|
||||
It seems to achieves higher audio quality than scaletempo, and rubberband R2
|
||||
engine, or ``engine=faster``. This filter is inserted automatically if
|
||||
``audio-pitch-correction`` option is used (on by default) when the playback
|
||||
speed is changed.
|
||||
|
||||
By default, the ``search-interval`` and ``window-size`` parameters
|
||||
have the same values as in chromium.
|
||||
|
||||
``min-speed=<speed>``
|
||||
Mute audio if the playback speed is below ``<speed>``. (default: 0.25)
|
||||
|
||||
``max-speed=<speed>``
|
||||
Mute audio if the playback speed is above ``<speed>``
|
||||
and ``<speed> != 0``. (default: 8.0)
|
||||
|
||||
``search-interval=<amount>``
|
||||
Length in milliseconds to search for best overlap position. (default: 40)
|
||||
|
||||
``window-size=<amount>``
|
||||
Length in milliseconds of the overlap-and-add window. (default: 12)
|
||||
|
||||
``rubberband``
|
||||
High quality pitch correction with librubberband. This can be used in place
|
||||
of ``scaletempo`` and ``scaletempo2``, and will be used to adjust audio pitch
|
||||
when playing at speed different from normal. It can also be used to adjust
|
||||
audio pitch without changing playback speed.
|
||||
of ``scaletempo``, and will be used to adjust audio pitch when playing
|
||||
at speed different from normal.
|
||||
|
||||
``pitch-scale=<amount>``
|
||||
Sets the pitch scaling factor. Frequencies are multiplied by this value.
|
||||
(default: 1.0)
|
||||
|
||||
``engine=<faster|finer>``
|
||||
Select the core Rubberband engine to be used. There are two available:
|
||||
|
||||
:Faster: This is the Rubberband R2 engine. It uses significantly less
|
||||
CPU than the Finer (R3) engine.
|
||||
:Finer: This is the Rubberband R3 engine. This engine is only available
|
||||
with librubberband version 3 or newer. This produces significantly
|
||||
higher quality output, at the cost of higher CPU usage. (Default
|
||||
if available)
|
||||
|
||||
This filter has a number of additional sub-options. You can list them with
|
||||
This filter has a number of sub-options. You can list them with
|
||||
``mpv --af=rubberband=help``. This will also show the default values
|
||||
for each option. The options are not documented here, because they are
|
||||
merely passed to librubberband. Look at the librubberband documentation
|
||||
to learn what each option does:
|
||||
https://breakfastquay.com/rubberband/code-doc/classRubberBand_1_1RubberBandStretcher.html
|
||||
Do note that certain options are only applicable to one of R2 (faster) and
|
||||
R3 (finer) engines.
|
||||
http://breakfastquay.com/rubberband/code-doc/classRubberBand_1_1RubberBandStretcher.html
|
||||
(The mapping of the mpv rubberband filter sub-option names and values to
|
||||
those of librubberband follows a simple pattern: ``"Option" + Name + Value``.)
|
||||
|
||||
This filter supports the following ``af-command`` commands:
|
||||
|
||||
``set-pitch``
|
||||
Set the ``<pitch-scale>`` argument dynamically. This can be used to
|
||||
change the playback pitch at runtime. Note that speed is controlled
|
||||
using the standard ``speed`` property, not ``af-command``.
|
||||
|
||||
``multiply-pitch <factor>``
|
||||
Multiply the current value of ``<pitch-scale>`` dynamically.
|
||||
|
||||
``lavfi=graph``
|
||||
Filter audio using FFmpeg's libavfilter.
|
||||
|
||||
@@ -244,23 +455,3 @@ Available filters are:
|
||||
|
||||
``o=<string>``
|
||||
AVOptions.
|
||||
|
||||
``fix-pts=<yes|no>``
|
||||
Determine PTS based on sample count (default: no). If this is enabled,
|
||||
the player won't rely on libavfilter passing through PTS accurately.
|
||||
Instead, it pass a sample count as PTS to libavfilter, and compute the
|
||||
PTS used by mpv based on that and the input PTS. This helps with filters
|
||||
which output a recomputed PTS instead of the original PTS (including
|
||||
filters which require the PTS to start at 0). mpv normally expects
|
||||
filters to not touch the PTS (or only to the extent of changing frame
|
||||
boundaries), so this is not the default, but it will be needed to use
|
||||
broken filters. In practice, these broken filters will either cause slow
|
||||
A/V desync over time (with some files), or break playback completely if
|
||||
you seek or start playback from the middle of a file.
|
||||
|
||||
``drop``
|
||||
This filter drops or repeats audio frames to adapt to playback speed. It
|
||||
always operates on full audio frames, because it was made to handle SPDIF
|
||||
(compressed audio passthrough). This is used automatically if the
|
||||
``--video-sync=display-adrop`` option is used. Do not use this filter (or
|
||||
the given option); they are extremely low quality.
|
||||
+158
-161
@@ -4,52 +4,56 @@ AUDIO OUTPUT DRIVERS
|
||||
Audio output drivers are interfaces to different audio output facilities. The
|
||||
syntax is:
|
||||
|
||||
``--ao=<driver1,driver2,...[,]>``
|
||||
``--ao=<driver1[:suboption1[=value]:...],driver2,...[,]>``
|
||||
Specify a priority list of audio output drivers to be used.
|
||||
|
||||
If the list has a trailing ',', mpv will fall back on drivers not contained
|
||||
in the list.
|
||||
in the list. Suboptions are optional and can mostly be omitted.
|
||||
|
||||
This is an object settings list option. See `List Options`_ for details.
|
||||
You can also set defaults for each driver. The defaults are applied before the
|
||||
normal driver parameters.
|
||||
|
||||
``--ao-defaults=<driver1[:parameter1:parameter2:...],driver2,...>``
|
||||
Set defaults for each driver.
|
||||
|
||||
.. note::
|
||||
|
||||
See ``--ao=help`` for a list of compiled-in audio output drivers sorted by
|
||||
autoprobe order.
|
||||
See ``--ao=help`` for a list of compiled-in audio output drivers. The
|
||||
driver ``--ao=alsa`` is preferred. ``--ao=pulse`` is preferred on systems
|
||||
where PulseAudio is used. On BSD systems, ``--ao=oss`` or ``--ao=sndio``
|
||||
may work (the latter being experimental).
|
||||
|
||||
Note that the default audio output driver is subject to change, and must
|
||||
not be relied upon. If a certain AO needs to be used, it must be
|
||||
explicitly specified.
|
||||
.. admonition:: Examples
|
||||
|
||||
- ``--ao=alsa,oss,`` Try the ALSA driver, then the OSS driver, then others.
|
||||
- ``--ao=alsa:resample=yes:device=[plughw:0,3]`` Lets ALSA resample and
|
||||
sets the device-name as first card, fourth device.
|
||||
|
||||
Available audio output drivers are:
|
||||
|
||||
``alsa``
|
||||
ALSA audio output driver.
|
||||
``alsa`` (Linux only)
|
||||
ALSA audio output driver
|
||||
|
||||
The following global options are supported by this audio output:
|
||||
|
||||
``--alsa-resample=yes``
|
||||
``device=<device>``
|
||||
Sets the device name. For ac3 output via S/PDIF, use an "iec958" or
|
||||
"spdif" device, unless you really know how to set it correctly.
|
||||
``resample=yes``
|
||||
Enable ALSA resampling plugin. (This is disabled by default, because
|
||||
some drivers report incorrect audio delay in some cases.)
|
||||
|
||||
``--alsa-mixer-device=<device>``
|
||||
Set the mixer device used with ``ao-volume`` (default: ``default``).
|
||||
|
||||
``--alsa-mixer-name=<name>``
|
||||
``mixer-device=<device>``
|
||||
Set the mixer device used with ``--no-softvol`` (default: ``default``).
|
||||
``mixer-name=<name>``
|
||||
Set the name of the mixer element (default: ``Master``). This is for
|
||||
example ``PCM`` or ``Master``.
|
||||
|
||||
``--alsa-mixer-index=<number>``
|
||||
``mixer-index=<number>``
|
||||
Set the index of the mixer channel (default: 0). Consider the output of
|
||||
"``amixer scontrols``", then the index is the number that follows the
|
||||
name of the element.
|
||||
|
||||
``--alsa-non-interleaved``
|
||||
``non-interleaved``
|
||||
Allow output of non-interleaved formats (if the audio decoder uses
|
||||
this format). Currently disabled by default, because some popular
|
||||
ALSA plugins are utterly broken with non-interleaved formats.
|
||||
|
||||
``--alsa-ignore-chmap``
|
||||
``ignore-chmap``
|
||||
Don't read or set the channel map of the ALSA device - only request the
|
||||
required number of channels, and then pass the audio as-is to it. This
|
||||
option most likely should not be used. It can be useful for debugging,
|
||||
@@ -58,29 +62,50 @@ Available audio output drivers are:
|
||||
or it will work only for files which use the layout implicit to your
|
||||
ALSA device).
|
||||
|
||||
``--alsa-buffer-time=<microseconds>``
|
||||
Set the requested buffer time in microseconds. A value of 0 skips requesting
|
||||
anything from the ALSA API. This and the ``--alsa-periods`` option uses the
|
||||
ALSA ``near`` functions to set the requested parameters. If doing so results
|
||||
in an empty configuration set, setting these parameters is skipped.
|
||||
.. note::
|
||||
|
||||
Both options control the buffer size. A low buffer size can lead to higher
|
||||
CPU usage and audio dropouts, while a high buffer size can lead to higher
|
||||
latency in volume changes and other filtering.
|
||||
MPlayer and mplayer2 required you to replace any ',' with '.' and
|
||||
any ':' with '=' in the ALSA device name. mpv does not do this anymore.
|
||||
Instead, quote the device name:
|
||||
|
||||
``--alsa-periods=<number>``
|
||||
Number of periods requested from the ALSA API. See ``--alsa-buffer-time``
|
||||
for further remarks.
|
||||
``--ao=alsa:device=[plug:surround50]``
|
||||
|
||||
Note that the ``[`` and ``]`` simply quote the device name. With some
|
||||
shells (like zsh), you have to quote the option string to prevent the
|
||||
shell from interpreting the brackets instead of passing them to mpv.
|
||||
|
||||
Actually, you should use the ``--audio-device`` option, instead of
|
||||
setting the device directly.
|
||||
|
||||
.. warning::
|
||||
|
||||
To get multichannel/surround audio, use ``--audio-channels=auto``. The
|
||||
default for this option is ``auto-safe``, which makes this audio output
|
||||
explicitly reject multichannel output, as there is no way to detect
|
||||
whether a certain channel layout is actually supported.
|
||||
Handling of multichannel/surround audio changed in mpv 0.8.0 from the
|
||||
behavior in MPlayer/mplayer2 and older versions of mpv.
|
||||
|
||||
You can also try `using the upmix plugin
|
||||
<https://github.com/mpv-player/mpv/wiki/ALSA-Surround-Sound-and-Upmixing>`_.
|
||||
The old behavior is that the player always downmixed to stereo by
|
||||
default. The ``--audio-channels`` (or ``--channels`` before that) option
|
||||
had to be set to get multichannel audio. Then playing stereo would
|
||||
use the ``default`` device (which typically allows multiple programs
|
||||
to play audio at the same time via dmix), while playing anything with
|
||||
more channels would open one of the hardware devices, e.g. via the
|
||||
``surround51`` alias (typically with exclusive access). Whether the
|
||||
player would use exclusive access or not would depend on the file
|
||||
being played.
|
||||
|
||||
The new behavior since mpv 0.8.0 always enables multichannel audio,
|
||||
i.e. ``--audio-channels=auto`` is the default. However, since ALSA
|
||||
provides no good way to play multichannel audio in a non-exclusive
|
||||
way (without blocking other applications from using audio), the player
|
||||
is restricted to the capabilities of the ``default`` device by default,
|
||||
which means it supports only stereo and mono (at least with current
|
||||
typical ALSA configurations). But if a hardware device is selected,
|
||||
then multichannel audio will typically work.
|
||||
|
||||
The short story is: if you want multichannel audio with ALSA, use
|
||||
``--audio-device`` to select the device (use ``--audio-device=help``
|
||||
to get a list of all devices and their mpv name).
|
||||
|
||||
You can also try `using the upmix plugin <http://git.io/vfuAy>`_.
|
||||
This setup enables multichannel audio on the ``default`` device
|
||||
with automatic upmixing with shared access, so playing stereo
|
||||
and multichannel audio at the same time will work as expected.
|
||||
@@ -88,24 +113,31 @@ Available audio output drivers are:
|
||||
``oss``
|
||||
OSS audio output driver
|
||||
|
||||
``<dsp-device>``
|
||||
Sets the audio output device (default: ``/dev/dsp``).
|
||||
``<mixer-device>``
|
||||
Sets the audio mixer device (default: ``/dev/mixer``).
|
||||
``<mixer-channel>``
|
||||
Sets the audio mixer channel (default: ``pcm``). Other valid values
|
||||
include **vol, pcm, line**. For a complete list of options look for
|
||||
``SOUND_DEVICE_NAMES`` in ``/usr/include/linux/soundcard.h``.
|
||||
|
||||
``jack``
|
||||
JACK (Jack Audio Connection Kit) audio output driver.
|
||||
JACK (Jack Audio Connection Kit) audio output driver
|
||||
|
||||
The following global options are supported by this audio output:
|
||||
|
||||
``--jack-port=<name>``
|
||||
``port=<name>``
|
||||
Connects to the ports with the given name (default: physical ports).
|
||||
``--jack-name=<client>``
|
||||
``name=<client>``
|
||||
Client name that is passed to JACK (default: ``mpv``). Useful
|
||||
if you want to have certain connections established automatically.
|
||||
``--jack-autostart=<yes|no>``
|
||||
``(no-)autostart``
|
||||
Automatically start jackd if necessary (default: disabled). Note that
|
||||
this tends to be unreliable and will flood stdout with server messages.
|
||||
``--jack-connect=<yes|no>``
|
||||
``(no-)connect``
|
||||
Automatically create connections to output ports (default: enabled).
|
||||
When enabled, the maximum number of output channels will be limited to
|
||||
the number of available output ports.
|
||||
``--jack-std-channel-layout=<waveext|any>``
|
||||
``std-channel-layout=waveext|any``
|
||||
Select the standard channel layout (default: waveext). JACK itself has no
|
||||
notion of channel layouts (i.e. assigning which speaker a given
|
||||
channel is supposed to map to) - it just takes whatever the application
|
||||
@@ -118,16 +150,14 @@ Available audio output drivers are:
|
||||
mode is probably not very useful, other than for debugging or when used
|
||||
with fixed setups.
|
||||
|
||||
``coreaudio`` (macOS only)
|
||||
Native macOS audio output driver using AudioUnits and the CoreAudio
|
||||
``coreaudio`` (Mac OS X only)
|
||||
Native Mac OS X audio output driver using AudioUnits and the CoreAudio
|
||||
sound server.
|
||||
|
||||
Automatically redirects to ``coreaudio_exclusive`` when playing compressed
|
||||
formats.
|
||||
|
||||
The following global options are supported by this audio output:
|
||||
|
||||
``--coreaudio-change-physical-format=<yes|no>``
|
||||
``change-physical-format=<yes|no>``
|
||||
Change the physical format to one similar to the requested audio format
|
||||
(default: no). This has the advantage that multichannel audio output
|
||||
will actually work. The disadvantage is that it will change the
|
||||
@@ -135,189 +165,156 @@ Available audio output drivers are:
|
||||
setting in the ``Audio Devices`` dialog in the ``Audio MIDI Setup``
|
||||
utility. Note that this does not affect the selected speaker setup.
|
||||
|
||||
``--coreaudio-spdif-hack=<yes|no>``
|
||||
Try to pass through AC3/DTS data as PCM. This is useful for drivers
|
||||
which do not report AC3 support. It converts the AC3 data to float,
|
||||
and assumes the driver will do the inverse conversion, which means
|
||||
a typical A/V receiver will pick it up as compressed IEC framed AC3
|
||||
stream, ignoring that it's marked as PCM. This disables normal AC3
|
||||
passthrough (even if the device reports it as supported). Use with
|
||||
extreme care.
|
||||
``exclusive``
|
||||
Use exclusive mode access. This merely redirects to
|
||||
``coreaudio_exclusive``, but should be preferred over using that AO
|
||||
directly.
|
||||
|
||||
``coreaudio_exclusive`` (macOS only)
|
||||
Native macOS audio output driver using direct device access and
|
||||
``coreaudio_exclusive`` (Mac OS X only)
|
||||
Native Mac OS X audio output driver using direct device access and
|
||||
exclusive mode (bypasses the sound server).
|
||||
|
||||
``avfoundation`` (macOS only)
|
||||
Native macOS audio output driver using ``AVSampleBufferAudioRenderer``
|
||||
in AVFoundation, which supports `spatial audio
|
||||
<https://support.apple.com/en-us/HT211775>`_.
|
||||
|
||||
.. warning::
|
||||
|
||||
Turning on spatial audio may hang the playback
|
||||
if mpv is not started out of the bundle,
|
||||
though playback with spatial audio off always works.
|
||||
|
||||
``audiounit`` (iOS only)
|
||||
Native iOS audio output driver using ``AudioUnits`` and AudioToolbox.
|
||||
|
||||
``openal``
|
||||
OpenAL audio output driver.
|
||||
Experimental OpenAL audio output driver
|
||||
|
||||
``--openal-num-buffers=<2-128>``
|
||||
Specify the number of audio buffers to use. Lower values are better for
|
||||
lower CPU usage. Default: 4.
|
||||
|
||||
``--openal-num-samples=<256-32768>``
|
||||
Specify the number of complete samples to use for each buffer. Higher
|
||||
values are better for lower CPU usage. Default: 8192.
|
||||
|
||||
``--openal-direct-channels=<yes|no>``
|
||||
Enable OpenAL Soft's direct channel extension when available to avoid
|
||||
tinting the sound with ambisonics or HRTF. Default: yes.
|
||||
.. note:: This driver is not very useful. Playing multi-channel audio with
|
||||
it is slow.
|
||||
|
||||
``pulse``
|
||||
PulseAudio audio output driver
|
||||
|
||||
The following global options are supported by this audio output:
|
||||
``[<host>][:<output sink>]``
|
||||
Specify the host and optionally output sink to use. An empty <host>
|
||||
string uses a local connection, "localhost" uses network transfer
|
||||
(most likely not what you want).
|
||||
|
||||
``--pulse-host=<host>``
|
||||
Specify the host to use. An empty <host> string uses a local connection,
|
||||
"localhost" uses network transfer (most likely not what you want).
|
||||
|
||||
``--pulse-buffer=<1-2000|native>``
|
||||
``buffer=<1-2000|native>``
|
||||
Set the audio buffer size in milliseconds. A higher value buffers
|
||||
more data, and has a lower probability of buffer underruns. A smaller
|
||||
value makes the audio stream react faster, e.g. to playback speed
|
||||
changes. "native" lets the sound server determine buffers.
|
||||
changes. Default: 250.
|
||||
|
||||
``--pulse-latency-hacks=<yes|no>``
|
||||
Enable hacks to workaround PulseAudio timing bugs (default: yes). If
|
||||
``latency-hacks=<yes|no>``
|
||||
Enable hacks to workaround PulseAudio timing bugs (default: no). If
|
||||
enabled, mpv will do elaborate latency calculations on its own. If
|
||||
disabled, it will use PulseAudio automatically updated timing
|
||||
information. Disabling this might help with e.g. networked audio or
|
||||
some plugins, while enabling it might help in some unknown situations
|
||||
(it is currently enabled due to known bugs with PulseAudio 16.0).
|
||||
(it used to be required to get good behavior on old PulseAudio versions).
|
||||
|
||||
``--pulse-allow-suspended=<yes|no>``
|
||||
Allow mpv to use PulseAudio even if the sink is suspended (default: no).
|
||||
Can be useful if PulseAudio is running as a bridge to jack and mpv has its sink-input set to the one jack is using.
|
||||
|
||||
``pipewire``
|
||||
PipeWire audio output driver
|
||||
|
||||
The following global options are supported by this audio output:
|
||||
|
||||
``--pipewire-buffer=<1-2000|native>``
|
||||
Set the audio buffer size in milliseconds. A higher value buffers
|
||||
more data, and has a lower probability of buffer underruns. A smaller
|
||||
value makes the audio stream react faster, e.g. to playback speed
|
||||
changes. "native" lets the sound server determine buffers.
|
||||
|
||||
``--pipewire-remote=<remote>``
|
||||
Specify the PipeWire remote daemon name to connect to via local UNIX
|
||||
sockets.
|
||||
An empty <remote> string uses the default remote named ``pipewire-0``.
|
||||
|
||||
``--pipewire-volume-mode=<channel|global>``
|
||||
Specify if the ``ao-volume`` property should apply to the channel
|
||||
volumes or the global volume.
|
||||
By default the channel volumes are used.
|
||||
If you have stuttering video when using pulse, try to enable this
|
||||
option. (Or try to update PulseAudio.)
|
||||
|
||||
``sdl``
|
||||
SDL 2.0+ audio output driver. Should work on any platform supported by SDL
|
||||
2.0, but may require the ``SDL_AUDIODRIVER`` environment variable to be set
|
||||
SDL 1.2+ audio output driver. Should work on any platform supported by SDL
|
||||
1.2, but may require the ``SDL_AUDIODRIVER`` environment variable to be set
|
||||
appropriately for your system.
|
||||
|
||||
.. note:: This driver is for compatibility with extremely foreign
|
||||
environments, such as systems where none of the other drivers
|
||||
are available.
|
||||
|
||||
The following global options are supported by this audio output:
|
||||
|
||||
``--sdl-buflen=<length>``
|
||||
``buflen=<length>``
|
||||
Sets the audio buffer length in seconds. Is used only as a hint by the
|
||||
sound system. Playing a file with ``-v`` will show the requested and
|
||||
obtained exact buffer size. A value of 0 selects the sound system
|
||||
default.
|
||||
|
||||
``bufcnt=<count>``
|
||||
Sets the number of extra audio buffers in mpv. Usually needs not be
|
||||
changed.
|
||||
|
||||
``null``
|
||||
Produces no audio output but maintains video playback speed. You can use
|
||||
``--ao=null --ao-null-untimed`` for benchmarking.
|
||||
Produces no audio output but maintains video playback speed. Use
|
||||
``--ao=null:untimed`` for benchmarking.
|
||||
|
||||
The following global options are supported by this audio output:
|
||||
|
||||
``--ao-null-untimed``
|
||||
``untimed``
|
||||
Do not simulate timing of a perfect audio device. This means audio
|
||||
decoding will go as fast as possible, instead of timing it to the
|
||||
system clock.
|
||||
|
||||
``--ao-null-buffer``
|
||||
``buffer``
|
||||
Simulated buffer length in seconds.
|
||||
|
||||
``--ao-null-outburst``
|
||||
``outburst``
|
||||
Simulated chunk size in samples.
|
||||
|
||||
``--ao-null-speed``
|
||||
``speed``
|
||||
Simulated audio playback speed as a multiplier. Usually, a real audio
|
||||
device will not go exactly as fast as the system clock. It will deviate
|
||||
just a little, and this option helps to simulate this.
|
||||
|
||||
``--ao-null-latency``
|
||||
``latency``
|
||||
Simulated device latency. This is additional to EOF.
|
||||
|
||||
``--ao-null-broken-eof``
|
||||
``broken-eof``
|
||||
Simulate broken audio drivers, which always add the fixed device
|
||||
latency to the reported audio playback position.
|
||||
|
||||
``--ao-null-broken-delay``
|
||||
``broken-delay``
|
||||
Simulate broken audio drivers, which don't report latency correctly.
|
||||
|
||||
``--ao-null-channel-layouts``
|
||||
``channel-layouts``
|
||||
If not empty, this is a ``,`` separated list of channel layouts the
|
||||
AO allows. This can be used to test channel layout selection.
|
||||
|
||||
``--ao-null-format``
|
||||
Force the audio output format the AO will accept. If unset accepts any.
|
||||
|
||||
``pcm``
|
||||
Raw PCM/WAVE file writer audio output
|
||||
|
||||
The following global options are supported by this audio output:
|
||||
|
||||
``--ao-pcm-waveheader=<yes|no>``
|
||||
``(no-)waveheader``
|
||||
Include or do not include the WAVE header (default: included). When
|
||||
not included, raw PCM will be generated.
|
||||
``--ao-pcm-file=<filename>``
|
||||
``file=<filename>``
|
||||
Write the sound to ``<filename>`` instead of the default
|
||||
``audiodump.wav``. If ``no-waveheader`` is specified, the default is
|
||||
``audiodump.pcm``.
|
||||
``--ao-pcm-append=<yes|no>``
|
||||
``(no-)append``
|
||||
Append to the file, instead of overwriting it. Always use this with the
|
||||
``no-waveheader`` option - with ``waveheader`` it's broken, because
|
||||
it will write a WAVE header every time the file is opened.
|
||||
|
||||
``rsound``
|
||||
Audio output to an RSound daemon
|
||||
|
||||
.. note:: Completely useless, unless you intend to run RSound. Not to be
|
||||
confused with RoarAudio, which is something completely
|
||||
different.
|
||||
|
||||
``host=<name/path>``
|
||||
Set the address of the server (default: localhost). Can be either a
|
||||
network hostname for TCP connections or a Unix domain socket path
|
||||
starting with '/'.
|
||||
``port=<number>``
|
||||
Set the TCP port used for connecting to the server (default: 12345).
|
||||
Not used if connecting to a Unix domain socket.
|
||||
|
||||
``sndio``
|
||||
Audio output to the OpenBSD sndio sound system
|
||||
|
||||
.. note:: Experimental. There are known bugs and issues.
|
||||
|
||||
(Note: only supports mono, stereo, 4.0, 5.1 and 7.1 channel
|
||||
layouts.)
|
||||
|
||||
``device=<device>``
|
||||
sndio device to use (default: ``$AUDIODEVICE``, resp. ``snd0``).
|
||||
|
||||
``wasapi``
|
||||
Audio output to the Windows Audio Session API.
|
||||
|
||||
The following global options are supported by this audio output:
|
||||
``exclusive``
|
||||
Requests exclusive, direct hardware access. By definition prevents
|
||||
sound playback of any other program until mpv exits.
|
||||
``device=<id>``
|
||||
Uses the requested endpoint instead of the system's default audio
|
||||
endpoint. Both an ordinal number (0,1,2,...) and the GUID
|
||||
String are valid; the GUID string is guaranteed to not change
|
||||
unless the driver is uninstalled.
|
||||
|
||||
``--wasapi-exclusive-buffer=<default|min|1-2000000>``
|
||||
Set buffer duration in exclusive mode (i.e., with
|
||||
``--audio-exclusive=yes``). ``default`` and ``min`` use the default and
|
||||
minimum device period reported by WASAPI, respectively. You can also
|
||||
directly specify the buffer duration in microseconds, in which case a
|
||||
duration shorter than the minimum device period will be rounded up to
|
||||
the minimum period.
|
||||
Also supports searching active devices by human-readable name. If more
|
||||
than one device matches the name, refuses loading it.
|
||||
|
||||
The default buffer duration should provide robust playback in most
|
||||
cases, but reportedly on some devices there are glitches following
|
||||
stream resets under the default setting. In such cases, specifying a
|
||||
shorter duration might help.
|
||||
This option is mostly deprecated in favour of the more general
|
||||
``--audio-device`` option. That said, ``--audio-device=help`` will give
|
||||
a list of valid device GUIDs (prefixed with ``wasapi/``), as well as
|
||||
their human readable names, which should work here.
|
||||
@@ -8,12 +8,6 @@ There is no real changelog, but you can look at the following things:
|
||||
|
||||
https://github.com/mpv-player/mpv/releases
|
||||
* The git log, which is the "real" changelog
|
||||
* The file https://github.com/mpv-player/mpv/blob/master/DOCS/interface-changes.rst
|
||||
documents changes to the command and user interface, such as options and
|
||||
properties.
|
||||
* C API changes are listed in
|
||||
https://github.com/mpv-player/mpv/blob/master/DOCS/client-api-changes.rst
|
||||
* The file ``mplayer-changes.rst`` in the ``DOCS`` sub directory on the git
|
||||
repository, which used to be in place of this section. It documents some
|
||||
changes that happened since mplayer2 forked off MPlayer. (Not updated
|
||||
anymore.)
|
||||
changes that happened since mplayer2 forked off MPlayer.
|
||||
@@ -1,58 +0,0 @@
|
||||
COMMANDS
|
||||
========
|
||||
|
||||
This script allows running and completing input commands in the console
|
||||
interactively, and also adds mpv's log to the console's log.
|
||||
|
||||
Keybindings
|
||||
-----------
|
||||
|
||||
\`
|
||||
Open the console to enter commands.
|
||||
|
||||
Commands
|
||||
--------
|
||||
|
||||
``script-binding commands/open``
|
||||
|
||||
Open the console to enter commands.
|
||||
|
||||
``script-message-to commands type <text> [<cursor_pos>]``
|
||||
Show the console and pre-fill it with the provided text, optionally
|
||||
specifying the initial cursor position as a positive integer starting from
|
||||
1. The console is automatically closed after running the command.
|
||||
|
||||
.. admonition:: Examples for input.conf
|
||||
|
||||
``% script-message-to commands type "seek absolute-percent" 6``
|
||||
Enter a percent position to seek to.
|
||||
|
||||
``Ctrl+o script-message-to commands type "loadfile ''" 11``
|
||||
Enter a file or URL to play, with autocompletion of paths in the
|
||||
filesystem.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
This script can be customized through a config file ``script-opts/commands.conf``
|
||||
placed in mpv's user directory and through the ``--script-opts`` command-line
|
||||
option. The configuration syntax is described in `mp.options functions`_.
|
||||
|
||||
Configurable Options
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``persist_history``
|
||||
Default: no
|
||||
|
||||
Whether to save the command history to a file and load it.
|
||||
|
||||
``history_path``
|
||||
Default: ``~~state/command_history.txt``
|
||||
|
||||
The file path for ``persist_history`` (see `FILES`_).
|
||||
|
||||
``remember_input``
|
||||
Default: yes
|
||||
|
||||
Whether to remember the input line and cursor position when closing the
|
||||
console, and prefill it the next time it is opened.
|
||||
@@ -1,239 +0,0 @@
|
||||
CONSOLE
|
||||
=======
|
||||
|
||||
This script provides the ability to process the user's textual input to other
|
||||
scripts through the ``mp.input`` API. It can be displayed on both the video
|
||||
window and the terminal. It can be disabled entirely using the
|
||||
``--load-console=no`` option.
|
||||
|
||||
Console can either process free-form text or select from a predefined list of
|
||||
items.
|
||||
|
||||
Free-form text mode keybindings
|
||||
-------------------------------
|
||||
|
||||
ESC and Ctrl+[
|
||||
Hide the console.
|
||||
|
||||
ENTER, Ctrl+j and Ctrl+m
|
||||
Select the first completion if one wasn't already manually selected, and run
|
||||
the typed command.
|
||||
|
||||
Shift+ENTER
|
||||
Type a literal newline character.
|
||||
|
||||
LEFT and Ctrl+b
|
||||
Move the cursor to the previous character.
|
||||
|
||||
RIGHT and Ctrl+f
|
||||
Move the cursor to the next character.
|
||||
|
||||
Ctrl+LEFT and Alt+b
|
||||
Move the cursor to the beginning of the current word, or if between words,
|
||||
to the beginning of the previous word.
|
||||
|
||||
Ctrl+RIGHT and Alt+f
|
||||
Move the cursor to the end of the current word, or if between words, to the
|
||||
end of the next word.
|
||||
|
||||
HOME and Ctrl+a
|
||||
Move the cursor to the start of the current line.
|
||||
|
||||
END and Ctrl+e
|
||||
Move the cursor to the end of the current line.
|
||||
|
||||
BACKSPACE and Ctrl+h
|
||||
Delete the previous character.
|
||||
|
||||
Ctrl+d
|
||||
Hide the console if the current line is empty, otherwise delete the next
|
||||
character.
|
||||
|
||||
Ctrl+BACKSPACE and Ctrl+w
|
||||
Delete text from the cursor to the beginning of the current word, or if
|
||||
between words, to the beginning of the previous word.
|
||||
|
||||
Ctrl+DEL and Alt+d
|
||||
Delete text from the cursor to the end of the current word, or if between
|
||||
words, to the end of the next word.
|
||||
|
||||
Ctrl+u
|
||||
Delete text from the cursor to the beginning of the current line.
|
||||
|
||||
Ctrl+k
|
||||
Delete text from the cursor to the end of the current line.
|
||||
|
||||
Ctrl+c
|
||||
Clear the current line.
|
||||
|
||||
UP and Ctrl+p
|
||||
Move back in the command history.
|
||||
|
||||
DOWN and Ctrl+n
|
||||
Move forward in the command history.
|
||||
|
||||
PGUP
|
||||
Go to the first command in the history.
|
||||
|
||||
PGDN
|
||||
Stop navigating the command history.
|
||||
|
||||
Ctrl+r
|
||||
Search the command history. See `SELECT`_ for the key bindings in this mode.
|
||||
|
||||
Shift+UP
|
||||
Scroll the log one line up.
|
||||
|
||||
Shift+DOWN
|
||||
Scroll the log one line down.
|
||||
|
||||
INSERT
|
||||
Toggle insert mode.
|
||||
|
||||
Ctrl+v
|
||||
Paste text (uses the clipboard on X11 and Wayland).
|
||||
|
||||
Shift+INSERT
|
||||
Paste text (uses the primary selection on X11 and Wayland).
|
||||
|
||||
Ctrl+y
|
||||
Copy the current line to the clipboard.
|
||||
|
||||
TAB and Ctrl+i
|
||||
Cycle through completions.
|
||||
|
||||
Shift+TAB
|
||||
Cycle through the completions backwards.
|
||||
|
||||
Ctrl+l
|
||||
Clear all log messages from the console.
|
||||
|
||||
MBTN_MID
|
||||
Paste text (uses the primary selection on X11 and Wayland).
|
||||
|
||||
WHEEL_UP
|
||||
Move back in the command history.
|
||||
|
||||
WHEEL_DOWN
|
||||
Move forward in the command history.
|
||||
|
||||
Known issues
|
||||
------------
|
||||
|
||||
- Non-ASCII keyboard input has restrictions
|
||||
- The cursor keys move between Unicode code-points, not grapheme clusters
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
This script can be customized through a config file ``script-opts/console.conf``
|
||||
placed in mpv's user directory and through the ``--script-opts`` command-line
|
||||
option. The configuration syntax is described in `mp.options functions`_.
|
||||
|
||||
Note that ``mp.input`` clients can selectively override these options.
|
||||
|
||||
Configurable Options
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``monospace_font``
|
||||
Default: platform dependent
|
||||
|
||||
The monospace font used when there are completions to align in a grid.
|
||||
|
||||
When there are no completions, ``--osd-font`` is used.
|
||||
|
||||
``font_size``
|
||||
Default: 24
|
||||
|
||||
The font size. This will be multiplied by ``display-hidpi-scale`` when the
|
||||
console is not scaled with the window.
|
||||
|
||||
``border_size``
|
||||
Default: 1.65
|
||||
|
||||
The font border size.
|
||||
|
||||
``background_alpha``
|
||||
Default: 80
|
||||
|
||||
The transparency of the menu's background. Ranges from 0 (opaque) to 255
|
||||
(fully transparent).
|
||||
|
||||
``gap``
|
||||
Default: 0.2
|
||||
|
||||
The gap between menu items, specified as a percentage the font size.
|
||||
|
||||
``padding``
|
||||
Default: 10
|
||||
|
||||
The padding of the menu.
|
||||
|
||||
``menu_outline_size``
|
||||
Default: 0
|
||||
|
||||
The size of the menu's border.
|
||||
|
||||
``menu_outline_color``
|
||||
Default: #FFFFFF
|
||||
|
||||
The color of the menu's border.
|
||||
|
||||
``corner_radius``
|
||||
Default: 8
|
||||
|
||||
The radius of the menu's corners.
|
||||
|
||||
``margin_x``
|
||||
Default: same as ``--osd-margin-x``
|
||||
|
||||
The margin from the left of the window.
|
||||
|
||||
``margin_y``
|
||||
Default: same as ``--osd-margin-y``
|
||||
|
||||
The margin from the bottom of the window.
|
||||
|
||||
``scale_with_window``
|
||||
Default: ``auto``
|
||||
|
||||
Whether to scale the console with the window height. Can be ``yes``, ``no``,
|
||||
or ``auto``, which follows the value of ``--osd-scale-by-window``.
|
||||
|
||||
``focused_color``
|
||||
Default: ``#222222``
|
||||
|
||||
The color of the focused item.
|
||||
|
||||
``focused_back_color``
|
||||
Default: ``#FFFFFF``
|
||||
|
||||
The background color of the focused item.
|
||||
|
||||
``match_color``
|
||||
Default: ``#0088FF``
|
||||
|
||||
The color of characters that match the searched string.
|
||||
|
||||
``exact_match``
|
||||
Default: no
|
||||
|
||||
Whether to match menu search queries exactly instead of fuzzily. Without
|
||||
this option, prefixing queries with ``'`` enables exact matching.
|
||||
|
||||
``case_sensitive``
|
||||
Default: no
|
||||
|
||||
Whether exact searches are case sensitive. Only works with ASCII characters.
|
||||
|
||||
``history_dedup``
|
||||
Default: true
|
||||
|
||||
Remove duplicate entries in history as to only keep the latest one.
|
||||
|
||||
``font_hw_ratio``
|
||||
Default: auto
|
||||
|
||||
The ratio of font height to font width.
|
||||
Adjusts grid width of completions.
|
||||
Values in the range 1.8..2.5 make sense for common monospace fonts.
|
||||
@@ -1,142 +0,0 @@
|
||||
CONTEXT MENU
|
||||
============
|
||||
|
||||
The context menu is a menu that pops up on the video window. By default, it is
|
||||
bound to right click.
|
||||
|
||||
menu.conf
|
||||
---------
|
||||
|
||||
You can define your own menu in ``~~/menu.conf`` (see `FILES`_), or an
|
||||
alternative path specified with ``--script-opt=select-menu_conf_path``. It is
|
||||
recommended to use the default ``menu.conf`` from
|
||||
https://github.com/mpv-player/mpv/blob/master/etc/menu.conf as an example to get
|
||||
started.
|
||||
|
||||
Each line of ``menu.conf`` is a menu item with fields separated by 1 or more
|
||||
tabs. The first field is the text shown in the menu. The second field is usually
|
||||
the command that is run when that item is selected. Fields from the third
|
||||
onwards can specify ``checked=``, ``disabled=`` and ``hidden=`` states in the
|
||||
same way as `Conditional auto profiles`_.
|
||||
|
||||
When there is no command, the item will open a submenu. Fields below indented
|
||||
with leading whitespace are added to this submenu. Nested submenu items are
|
||||
defined by adding more leading whitespace than the parent menu entry.
|
||||
|
||||
Empty lines are interpreted as separators.
|
||||
|
||||
The second field can also be one of the following tokens to make that entry a
|
||||
submenu with the relative items: ``$playlist``, ``$tracks``, ``$video-tracks``,
|
||||
``$audio-tracks``, ``$sub-tracks``, ``$secondary-sub-tracks``, ``$chapters``,
|
||||
``$editions``, ``$audio-devices``, ``$profiles``. These menus are automatically
|
||||
disabled when empty.
|
||||
|
||||
To use the native context menu, you need to fill the ``menu-data`` property with
|
||||
menu definition data, and call the ``context-menu`` command. In builtin scripts,
|
||||
this is done by ``select.lua``, which parses ``menu.conf`` to populate
|
||||
``menu-data``. It then calls the ``context-menu`` command on platforms where
|
||||
integration with the native context menu is implemented, while on platforms
|
||||
where it is not, it opens ``context_menu.lua``.
|
||||
|
||||
On platforms without integration with the native context menu,
|
||||
``context_menu.lua`` can be disabled entirely using the
|
||||
``--load-context-menu=no`` option. On platforms where the integration is
|
||||
implemented, it is already disabled by default, and ``--load-context-menu=yes``
|
||||
will make ``select.lua`` use it.
|
||||
|
||||
Script messages
|
||||
---------------
|
||||
|
||||
``open``
|
||||
Show the context menu.
|
||||
|
||||
``select``
|
||||
Select the focused item when there is one.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
This script can be customized through a config file
|
||||
``script-opts/context_menu.conf`` placed in mpv's user directory and through
|
||||
the ``--script-opts`` command-line option. The configuration syntax is
|
||||
described in `mp.options functions`_.
|
||||
|
||||
Configurable Options
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``font_size``
|
||||
Default: 14
|
||||
|
||||
The font size.
|
||||
|
||||
``gap``
|
||||
Default: 0.2
|
||||
|
||||
The gap between menu items, specified as a percentage the font size.
|
||||
|
||||
``padding_x``
|
||||
Default: 8
|
||||
|
||||
The horizontal padding of the menu.
|
||||
|
||||
``padding_y``
|
||||
Default: 4
|
||||
|
||||
The vertical padding of the menu.
|
||||
|
||||
``menu_outline_size``
|
||||
Default: 0
|
||||
|
||||
The size of the menu's border.
|
||||
|
||||
``menu_outline_color``
|
||||
Default: ``#FFFFFF``
|
||||
|
||||
The color of the menu's border.
|
||||
|
||||
``background_alpha``
|
||||
Default: ``0``
|
||||
|
||||
The transparency of the menu's background. Ranges from 0 (opaque) to 255
|
||||
(fully transparent).
|
||||
|
||||
``corner_radius``
|
||||
Default: 5
|
||||
|
||||
The radius of the menu's corners.
|
||||
|
||||
``scale_with_window``
|
||||
Default: auto
|
||||
|
||||
Whether to scale sizes with the window height. Can be ``yes``, ``no``, or
|
||||
``auto``, which follows the value of ``--osd-scale-by-window``.
|
||||
|
||||
When sizes aren't scaled with the window, they are scaled by
|
||||
``display-hidpi-scale``.
|
||||
|
||||
``focused_color``
|
||||
Default: ``#222222``
|
||||
|
||||
The color of the focused item.
|
||||
|
||||
``focused_back_color``
|
||||
Default: ``#FFFFFF``
|
||||
|
||||
The background color of the focused item.
|
||||
|
||||
``disabled_color``
|
||||
Default: ``#555555``
|
||||
|
||||
The color of disabled items and separators.
|
||||
|
||||
``seconds_to_open_submenus``
|
||||
Default: 0.2
|
||||
|
||||
The number of seconds to open submenus after the cursor enters items
|
||||
associated with one.
|
||||
|
||||
``seconds_to_close_submenus``
|
||||
Default: 0.2
|
||||
|
||||
The number of seconds to close submenus after the cursor enters a parent
|
||||
menu.
|
||||
+99
-50
@@ -8,25 +8,64 @@ You can encode files from one format/codec to another using this facility.
|
||||
|
||||
``--of=<format>``
|
||||
Specifies the output format (overrides autodetection by the file name
|
||||
extension of the file specified by ``--o``). See ``--of=help`` for a full
|
||||
list of supported formats.
|
||||
extension of the file specified by ``-o``). This can be a comma separated
|
||||
list of possible formats to try. See ``--of=help`` for a full list of
|
||||
supported formats.
|
||||
|
||||
``--ofopts=<options>``
|
||||
Specifies the output format options for libavformat.
|
||||
See ``--ofopts=help`` for a full list of supported options.
|
||||
|
||||
This is a key/value list option. See `List Options`_ for details.
|
||||
Options are managed in lists. There are a few commands to manage the
|
||||
options list.
|
||||
|
||||
``--ofopts-add=<option>``
|
||||
Appends the option given as an argument to the options list. (Passing
|
||||
multiple options is currently still possible, but deprecated.)
|
||||
``--ofopts-add=<options1[,options2,...]>``
|
||||
Appends the options given as arguments to the options list.
|
||||
|
||||
``--ofopts=""``
|
||||
``--ofopts-pre=<options1[,options2,...]>``
|
||||
Prepends the options given as arguments to the options list.
|
||||
|
||||
``--ofopts-del=<index1[,index2,...]>``
|
||||
Deletes the options at the given indexes. Index numbers start at 0,
|
||||
negative numbers address the end of the list (-1 is the last).
|
||||
|
||||
``--ofopts-clr``
|
||||
Completely empties the options list.
|
||||
|
||||
``--ofps=<float value>``
|
||||
Specifies the output format time base (default: 24000). Low values like 25
|
||||
limit video fps by dropping frames.
|
||||
|
||||
``--oautofps``
|
||||
Sets the output format time base to the guessed frame rate of the input
|
||||
video (simulates MEncoder behavior, useful for AVI; may cause frame drops).
|
||||
Note that not all codecs and not all formats support VFR encoding, and some
|
||||
which do have bugs when a target bitrate is specified - use ``--ofps`` or
|
||||
``--oautofps`` to force CFR encoding in these cases.
|
||||
|
||||
``--omaxfps=<float value>``
|
||||
Specifies the minimum distance of adjacent frames (default: 0, which means
|
||||
unset). Content of lower frame rate is not readjusted to this frame rate;
|
||||
content of higher frame rate is decimated to this frame rate.
|
||||
|
||||
``--oharddup``
|
||||
If set, the frame rate given by ``--ofps`` is attained not by skipping time
|
||||
codes, but by duplicating frames (constant frame rate mode).
|
||||
|
||||
``--oneverdrop``
|
||||
If set, frames are never dropped. Instead, time codes of video are
|
||||
readjusted to always increase. This may cause AV desync, though; to work
|
||||
around this, use a high-fps time base using ``--ofps`` and absolutely
|
||||
avoid ``--oautofps``.
|
||||
|
||||
``--oac=<codec>``
|
||||
Specifies the output audio codec. See ``--oac=help`` for a full list of
|
||||
supported codecs.
|
||||
Specifies the output audio codec. This can be a comma separated list of
|
||||
possible codecs to try. See ``--oac=help`` for a full list of supported
|
||||
codecs.
|
||||
|
||||
``--oaoffset=<value>``
|
||||
Shifts audio data by the given time (in seconds) by adding/removing
|
||||
samples at the start.
|
||||
|
||||
``--oacopts=<options>``
|
||||
Specifies the output audio codec options for libavcodec.
|
||||
@@ -37,20 +76,36 @@ You can encode files from one format/codec to another using this facility.
|
||||
"``--oac=libmp3lame --oacopts=b=128000``"
|
||||
selects 128 kbps MP3 encoding.
|
||||
|
||||
This is a key/value list option. See `List Options`_ for details.
|
||||
Options are managed in lists. There are a few commands to manage the
|
||||
options list.
|
||||
|
||||
``--oacopts-add=<option>``
|
||||
Appends the option given as an argument to the options list. (Passing
|
||||
multiple options is currently still possible, but deprecated.)
|
||||
``--oacopts-add=<options1[,options2,...]>``
|
||||
Appends the options given as arguments to the options list.
|
||||
|
||||
``--oacopts=""``
|
||||
``--oacopts-pre=<options1[,options2,...]>``
|
||||
Prepends the options given as arguments to the options list.
|
||||
|
||||
``--oacopts-del=<index1[,index2,...]>``
|
||||
Deletes the options at the given indexes. Index numbers start at 0,
|
||||
negative numbers address the end of the list (-1 is the last).
|
||||
|
||||
``--oacopts-clr``
|
||||
Completely empties the options list.
|
||||
|
||||
``--ovc=<codec>``
|
||||
Specifies the output video codec. See ``--ovc=help`` for a full list of
|
||||
supported codecs.
|
||||
``--oafirst``
|
||||
Force the audio stream to become the first stream in the output.
|
||||
By default, the order is unspecified.
|
||||
|
||||
``--ovcopts=<options>``
|
||||
``--ovc=<codec>``
|
||||
Specifies the output video codec. This can be a comma separated list of
|
||||
possible codecs to try. See ``--ovc=help`` for a full list of supported
|
||||
codecs.
|
||||
|
||||
``--ovoffset=<value>``
|
||||
Shifts video data by the given time (in seconds) by shifting the pts
|
||||
values.
|
||||
|
||||
``--ovcopts <options>``
|
||||
Specifies the output video codec options for libavcodec.
|
||||
See --ovcopts=help for a full list of supported options.
|
||||
|
||||
@@ -62,45 +117,39 @@ You can encode files from one format/codec to another using this facility.
|
||||
``"--ovc=libx264 --ovcopts=crf=23"``
|
||||
selects VBR quality factor 23 for H.264 encoding.
|
||||
|
||||
This is a key/value list option. See `List Options`_ for details.
|
||||
Options are managed in lists. There are a few commands to manage the
|
||||
options list.
|
||||
|
||||
``--ovcopts-add=<option>``
|
||||
Appends the option given as an argument to the options list. (Passing
|
||||
multiple options is currently still possible, but deprecated.)
|
||||
``--ovcopts-add=<options1[,options2,...]>``
|
||||
Appends the options given as arguments to the options list.
|
||||
|
||||
``--ovcopts=""``
|
||||
``--ovcopts-pre=<options1[,options2,...]>``
|
||||
Prepends the options given as arguments to the options list.
|
||||
|
||||
``--ovcopts-del=<index1[,index2,...]>``
|
||||
Deletes the options at the given indexes. Index numbers start at 0,
|
||||
negative numbers address the end of the list (-1 is the last).
|
||||
|
||||
``--ovcopts-clr``
|
||||
Completely empties the options list.
|
||||
|
||||
``--ovfirst``
|
||||
Force the video stream to become the first stream in the output.
|
||||
By default, the order is unspecified.
|
||||
|
||||
``--ocopyts``
|
||||
Copies input pts to the output video (not supported by some output
|
||||
container formats, e.g. AVI). Discontinuities are still fixed.
|
||||
By default, audio pts are set to playback time and video pts are
|
||||
synchronized to match audio pts, as some output formats do not support
|
||||
anything else.
|
||||
|
||||
``--orawts``
|
||||
Copies input pts to the output video (not supported by some output
|
||||
container formats, e.g. AVI). In this mode, discontinuities are not fixed
|
||||
and all pts are passed through as-is. Never seek backwards or use multiple
|
||||
input files in this mode!
|
||||
|
||||
``--ocopy-metadata=<yes|no>``
|
||||
Copy metadata from input files to output files when encoding (default: yes).
|
||||
|
||||
``--oset-metadata=<metadata-tag[,metadata-tag,...]>``
|
||||
Specifies metadata to include in the output file.
|
||||
Supported keys vary between output formats. For example, Matroska (MKV) and
|
||||
FLAC allow almost arbitrary keys, while support in MP4 and MP3 is more
|
||||
limited.
|
||||
|
||||
This is a key/value list option. See `List Options`_ for details.
|
||||
|
||||
.. admonition:: Example
|
||||
|
||||
"``--oset-metadata=title="Output title",comment="Another tag"``"
|
||||
adds a title and a comment to the output file.
|
||||
|
||||
``--oremove-metadata=<metadata-tag[,metadata-tag,...]>``
|
||||
Specifies metadata to exclude from the output file when copying from the
|
||||
input file.
|
||||
|
||||
This is a string list option. See `List Options`_ for details.
|
||||
|
||||
.. admonition:: Example
|
||||
|
||||
"``--oremove-metadata=comment,genre``"
|
||||
excludes copying of the comment and genre tags to the output
|
||||
file.
|
||||
``--no-ometadata``
|
||||
Turns off copying of metadata from input files to output files when
|
||||
encoding (which is enabled by default).
|
||||
+839
-3169
File diff suppressed because it is too large.
Load diff
+25
-144
@@ -3,10 +3,8 @@ JSON IPC
|
||||
|
||||
mpv can be controlled by external programs using the JSON-based IPC protocol.
|
||||
It can be enabled by specifying the path to a unix socket or a named pipe using
|
||||
the option ``--input-ipc-server``, or the file descriptor number of a unix socket
|
||||
or a named pipe using ``--input-ipc-client``.
|
||||
Clients can connect to this socket and send commands to the player or receive
|
||||
events from it.
|
||||
the option ``--input-ipc-server``. Clients can connect to this socket and send
|
||||
commands to the player or receive events from it.
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -43,7 +41,7 @@ It's also possible to send input.conf style text-only commands:
|
||||
|
||||
::
|
||||
|
||||
> echo 'show-text ${playback-time}' | socat - /tmp/mpvsocket
|
||||
> echo 'show_text ${playback-time}' | socat - /tmp/mpvsocket
|
||||
|
||||
But you won't get a reply over the socket. (This particular command shows the
|
||||
playback time on the player's OSD.)
|
||||
@@ -67,24 +65,15 @@ You can send commands from a command prompt:
|
||||
|
||||
::
|
||||
|
||||
echo show-text ${playback-time} >\\.\pipe\mpvsocket
|
||||
echo show_text ${playback-time} >\\.\pipe\mpvsocket
|
||||
|
||||
To be able to simultaneously read and write from the IPC pipe, like on Linux,
|
||||
it's necessary to write an external program that uses overlapped file I/O (or
|
||||
some wrapper like .NET's NamedPipeClientStream.)
|
||||
|
||||
You can open the pipe in PuTTY as "serial" device. This is not very
|
||||
comfortable, but gives a way to test interactively without having to write code.
|
||||
|
||||
Protocol
|
||||
--------
|
||||
|
||||
The protocol uses UTF-8-only JSON as defined by RFC-8259. Unlike standard JSON,
|
||||
"\u" escape sequences are not allowed to construct surrogate pairs. To avoid
|
||||
getting conflicts, encode all text characters including and above codepoint
|
||||
U+0020 as UTF-8. mpv might output broken UTF-8 in corner cases (see "UTF-8"
|
||||
section below).
|
||||
|
||||
Clients can execute commands on the player by sending JSON messages of the
|
||||
following form:
|
||||
|
||||
@@ -118,11 +107,8 @@ can also be present. See `List of events`_ for a list of all supported events.
|
||||
Because events can occur at any time, it may be difficult at times to determine
|
||||
which response goes with which command. Commands may optionally include a
|
||||
``request_id`` which, if provided in the command request, will be copied
|
||||
verbatim into the response. mpv does not interpret the ``request_id`` in any
|
||||
way; it is solely for the use of the requester. The only requirement is that
|
||||
the ``request_id`` field must be an integer (a number without fractional parts
|
||||
in the range ``-2^63..2^63-1``). Using other types is deprecated and will
|
||||
currently show a warning. In the future, this will raise an error.
|
||||
verbatim into the response. mpv does not intrepret the ``request_id`` in any
|
||||
way; it is solely for the use of the requester.
|
||||
|
||||
For example, this request:
|
||||
|
||||
@@ -136,8 +122,6 @@ Would generate this response:
|
||||
|
||||
{ "error": "success", "data": 1.468135, "request_id": 100 }
|
||||
|
||||
If you don't specify a ``request_id``, command replies will set it to 0.
|
||||
|
||||
All commands, replies, and events are separated from each other with a line
|
||||
break character (``\n``).
|
||||
|
||||
@@ -149,72 +133,6 @@ with ``#`` and empty lines are ignored.
|
||||
Currently, embedded 0 bytes terminate the current line, but you should not
|
||||
rely on this.
|
||||
|
||||
Data flow
|
||||
---------
|
||||
|
||||
Currently, the mpv-side IPC implementation does not service the socket while a
|
||||
command is executed and the reply is written. It is for example not possible
|
||||
that other events, that happened during the execution of the command, are
|
||||
written to the socket before the reply is written.
|
||||
|
||||
This might change in the future. The only guarantee is that replies to IPC
|
||||
messages are sent in sequence.
|
||||
|
||||
Also, since socket I/O is inherently asynchronous, it is possible that you read
|
||||
unrelated event messages from the socket, before you read the reply to the
|
||||
previous command you sent. In this case, these events were queued by the mpv
|
||||
side before it read and started processing your command message.
|
||||
|
||||
If the mpv-side IPC implementation switches away from blocking writes and
|
||||
blocking command execution, it may attempt to send events at any time.
|
||||
|
||||
You can also use asynchronous commands, which can return in any order, and
|
||||
which do not block IPC protocol interaction at all while the command is
|
||||
executed in the background.
|
||||
|
||||
Asynchronous commands
|
||||
---------------------
|
||||
|
||||
Command can be run asynchronously. This behaves exactly as with normal command
|
||||
execution, except that execution is not blocking. Other commands can be sent
|
||||
while it's executing, and command completion can be arbitrarily reordered.
|
||||
|
||||
The ``async`` field controls this. If present, it must be a boolean. If missing,
|
||||
``false`` is assumed.
|
||||
|
||||
For example, this initiates an asynchronous command:
|
||||
|
||||
::
|
||||
|
||||
{ "command": ["screenshot"], "request_id": 123, "async": true }
|
||||
|
||||
And this is the completion:
|
||||
|
||||
::
|
||||
|
||||
{"request_id":123,"error":"success","data":null}
|
||||
|
||||
By design, you will not get a confirmation that the command was started. If a
|
||||
command is long running, sending the message will not lead to any reply until
|
||||
much later when the command finishes.
|
||||
|
||||
Some commands execute synchronously, but these will behave like asynchronous
|
||||
commands that finished execution immediately.
|
||||
|
||||
Cancellation of asynchronous commands is available in the libmpv API, but has
|
||||
not yet been implemented in the IPC protocol.
|
||||
|
||||
Commands with named arguments
|
||||
-----------------------------
|
||||
|
||||
If the ``command`` field is a JSON object, named arguments are expected. This
|
||||
is described in the C API ``mpv_command_node()`` documentation (the
|
||||
``MPV_FORMAT_NODE_MAP`` case). In some cases, this may make commands more
|
||||
readable, while some obscure commands basically require using named arguments.
|
||||
|
||||
Currently, only "proper" commands (as listed by `List of Input Commands`_)
|
||||
support named arguments.
|
||||
|
||||
Commands
|
||||
--------
|
||||
|
||||
@@ -262,7 +180,14 @@ extra commands can also be used as part of the protocol:
|
||||
{ "error": "success" }
|
||||
|
||||
``set_property_string``
|
||||
Alias for ``set_property``. Both commands accept native values and strings.
|
||||
Like ``set_property``, but the argument value must be passed as string.
|
||||
|
||||
Example:
|
||||
|
||||
::
|
||||
|
||||
{ "command": ["set_property_string", "pause", "yes"] }
|
||||
{ "error": "success" }
|
||||
|
||||
``observe_property``
|
||||
Watch a property for changes. If the given property is changed, then an
|
||||
@@ -276,14 +201,6 @@ extra commands can also be used as part of the protocol:
|
||||
{ "error": "success" }
|
||||
{ "event": "property-change", "id": 1, "data": 52.0, "name": "volume" }
|
||||
|
||||
.. warning::
|
||||
|
||||
If the connection is closed, the IPC client is destroyed internally,
|
||||
and the observed properties are unregistered. This happens for example
|
||||
when sending commands to a socket with separate ``socat`` invocations.
|
||||
This can make it seem like property observation does not work. You must
|
||||
keep the IPC connection open to make it work.
|
||||
|
||||
``observe_property_string``
|
||||
Like ``observe_property``, but the resulting data will always be a string.
|
||||
|
||||
@@ -324,6 +241,16 @@ extra commands can also be used as part of the protocol:
|
||||
By default, most events are enabled, and there is not much use for this
|
||||
command.
|
||||
|
||||
``suspend``
|
||||
Suspend the mpv main loop. There is a long-winded explanation of this in
|
||||
the C API function ``mpv_suspend()``. In short, this prevents the player
|
||||
from displaying the next video frame, so that you don't get blocked when
|
||||
trying to access the player.
|
||||
|
||||
``resume``
|
||||
Undo one ``suspend`` call. ``suspend`` increments an internal counter, and
|
||||
``resume`` decrements it. When 0 is reached, the player is actually resumed.
|
||||
|
||||
``get_version``
|
||||
Returns the client API version the C API of the remote mpv instance
|
||||
provides.
|
||||
@@ -340,50 +267,4 @@ sometimes sends invalid JSON. If that is a problem for the client application's
|
||||
parser, it should filter the raw data for invalid UTF-8 sequences and perform
|
||||
the desired replacement, before feeding the data to its JSON parser.
|
||||
|
||||
mpv will not attempt to construct invalid UTF-8 with broken "\u" escape
|
||||
sequences. This includes surrogate pairs.
|
||||
|
||||
JSON extensions
|
||||
---------------
|
||||
|
||||
The following non-standard extensions are supported:
|
||||
|
||||
- a list or object item can have a trailing ","
|
||||
- object syntax accepts "=" in addition of ":"
|
||||
- object keys can be unquoted, if they start with a character in "A-Za-z\_"
|
||||
and contain only characters in "A-Za-z0-9\_"
|
||||
- byte escapes with "\xAB" are allowed (with AB being a 2 digit hex number)
|
||||
|
||||
Example:
|
||||
|
||||
::
|
||||
|
||||
{ objkey = "value\x0A" }
|
||||
|
||||
Is equivalent to:
|
||||
|
||||
::
|
||||
|
||||
{ "objkey": "value\n" }
|
||||
|
||||
Alternative ways of starting clients
|
||||
------------------------------------
|
||||
|
||||
You can create an anonymous IPC connection without having to set
|
||||
``--input-ipc-server``. This is achieved through a mpv pseudo scripting backend
|
||||
that starts processes.
|
||||
|
||||
You can put ``.run`` file extension in the mpv scripts directory in its config
|
||||
directory (see the `FILES`_ section for details), or load them through other
|
||||
means (see `Script location`_). These scripts are simply executed with the OS
|
||||
native mechanism (as if you ran them in the shell). They must have a proper
|
||||
shebang and have the executable bit set.
|
||||
|
||||
When executed, a socket (the IPC connection) is passed to them through file
|
||||
descriptor inheritance. The file descriptor is indicated as the special command
|
||||
line argument ``--mpv-ipc-fd=N``, where ``N`` is the numeric file descriptor.
|
||||
|
||||
The rest is the same as with a normal ``--input-ipc-server`` IPC connection. mpv
|
||||
does not attempt to observe or other interact with the started script process.
|
||||
|
||||
This does not work in Windows yet.
|
||||
mpv will not attempt to construct invalid UTF-8 with broken escape sequences.
|
||||
@@ -1,405 +0,0 @@
|
||||
JAVASCRIPT
|
||||
==========
|
||||
|
||||
JavaScript support in mpv is near identical to its Lua support. Use this section
|
||||
as reference on differences and availability of APIs, but otherwise you should
|
||||
refer to the Lua documentation for API details and general scripting in mpv.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
JavaScript code which leaves fullscreen mode when the player is paused:
|
||||
|
||||
::
|
||||
|
||||
function on_pause_change(name, value) {
|
||||
if (value == true)
|
||||
mp.set_property("fullscreen", "no");
|
||||
}
|
||||
mp.observe_property("pause", "bool", on_pause_change);
|
||||
|
||||
|
||||
Similarities with Lua
|
||||
---------------------
|
||||
|
||||
mpv tries to load a script file as JavaScript if it has a ``.js`` extension, but
|
||||
otherwise, the documented Lua options, script directories, loading, etc apply to
|
||||
JavaScript files too.
|
||||
|
||||
Script initialization and lifecycle is the same as with Lua, and most of the Lua
|
||||
functions in the modules ``mp``, ``mp.utils``, ``mp.msg``, ``mp.options`` and
|
||||
``mp.input`` are available to JavaScript with identical APIs - including running
|
||||
commands, getting/setting properties, registering events/key-bindings/hooks,
|
||||
etc.
|
||||
|
||||
Differences from Lua
|
||||
--------------------
|
||||
|
||||
No need to load modules. ``mp``, ``mp.utils``, ``mp.msg``, ``mp.options`` and
|
||||
``mp.input`` are preloaded, and you can use e.g. ``var cwd =
|
||||
mp.utils.getcwd();`` without prior setup.
|
||||
|
||||
Errors are slightly different. Where the Lua APIs return ``nil`` for error,
|
||||
the JavaScript ones return ``undefined``. Where Lua returns ``something, error``
|
||||
JavaScript returns only ``something`` - and makes ``error`` available via
|
||||
``mp.last_error()``. Note that only some of the functions have this additional
|
||||
``error`` value - typically the same ones which have it in Lua.
|
||||
|
||||
Standard APIs are preferred. For instance ``setTimeout`` and ``JSON.stringify``
|
||||
are available, but ``mp.add_timeout`` and ``mp.utils.format_json`` are not.
|
||||
|
||||
No standard library. This means that interaction with anything outside of mpv is
|
||||
limited to the available APIs, typically via ``mp.utils``. However, some file
|
||||
functions were added, and CommonJS ``require`` is available too - where the
|
||||
loaded modules have the same privileges as normal scripts.
|
||||
|
||||
Language features - ECMAScript 5
|
||||
--------------------------------
|
||||
|
||||
The scripting backend which mpv currently uses is MuJS - a compatible minimal
|
||||
ES5 interpreter. As such, ``String.substring`` is implemented for instance,
|
||||
while the common but non-standard ``String.substr`` is not. Please consult the
|
||||
MuJS pages on language features and platform support - https://mujs.com .
|
||||
|
||||
Unsupported Lua APIs and their JS alternatives
|
||||
----------------------------------------------
|
||||
|
||||
``mp.add_timeout(seconds, fn)`` JS: ``id = setTimeout(fn, ms)``
|
||||
|
||||
``mp.add_periodic_timer(seconds, fn)`` JS: ``id = setInterval(fn, ms)``
|
||||
|
||||
``utils.parse_json(str [, trail])`` JS: ``JSON.parse(str)``
|
||||
|
||||
``utils.format_json(v)`` JS: ``JSON.stringify(v)``
|
||||
|
||||
``utils.to_string(v)`` see ``dump`` below.
|
||||
|
||||
``mp.get_next_timeout()`` see event loop below.
|
||||
|
||||
``mp.dispatch_events([allow_wait])`` see event loop below.
|
||||
|
||||
Scripting APIs - identical to Lua
|
||||
---------------------------------
|
||||
|
||||
(LE) - Last-Error, indicates that ``mp.last_error()`` can be used after the
|
||||
call to test for success (empty string) or failure (non empty reason string).
|
||||
Where the Lua APIs use ``nil`` to indicate error, JS APIs use ``undefined``.
|
||||
|
||||
``mp.command(string)`` (LE)
|
||||
|
||||
``mp.commandv(arg1, arg2, ...)`` (LE)
|
||||
|
||||
``mp.command_native(table [,def])`` (LE)
|
||||
|
||||
``id = mp.command_native_async(table [,fn])`` (LE) Notes: ``id`` is true-thy on
|
||||
success, ``error`` is empty string on success.
|
||||
|
||||
``mp.abort_async_command(id)``
|
||||
|
||||
``mp.del_property(name)`` (LE)
|
||||
|
||||
``mp.get_property(name [,def])`` (LE)
|
||||
|
||||
``mp.get_property_osd(name [,def])`` (LE)
|
||||
|
||||
``mp.get_property_bool(name [,def])`` (LE)
|
||||
|
||||
``mp.get_property_number(name [,def])`` (LE)
|
||||
|
||||
``mp.get_property_native(name [,def])`` (LE)
|
||||
|
||||
``mp.set_property(name, value)`` (LE)
|
||||
|
||||
``mp.set_property_bool(name, value)`` (LE)
|
||||
|
||||
``mp.set_property_number(name, value)`` (LE)
|
||||
|
||||
``mp.set_property_native(name, value)`` (LE)
|
||||
|
||||
``mp.get_time()``
|
||||
|
||||
``mp.add_key_binding(key, name|fn [,fn [,flags]])``
|
||||
|
||||
``mp.add_forced_key_binding(...)``
|
||||
|
||||
``mp.remove_key_binding(name)``
|
||||
|
||||
``mp.register_event(name, fn)``
|
||||
|
||||
``mp.unregister_event(fn)``
|
||||
|
||||
``mp.observe_property(name, type, fn)``
|
||||
|
||||
``mp.unobserve_property(fn)``
|
||||
|
||||
``mp.get_opt(key)``
|
||||
|
||||
``mp.get_script_name()``
|
||||
|
||||
``mp.get_script_directory()``
|
||||
|
||||
``mp.osd_message(text [,duration])``
|
||||
|
||||
``mp.get_wakeup_pipe()``
|
||||
|
||||
``mp.register_idle(fn)``
|
||||
|
||||
``mp.unregister_idle(fn)``
|
||||
|
||||
``mp.enable_messages(level)``
|
||||
|
||||
``mp.register_script_message(name, fn)``
|
||||
|
||||
``mp.unregister_script_message(name)``
|
||||
|
||||
``mp.create_osd_overlay(format)``
|
||||
|
||||
``mp.get_osd_size()`` (returned object has properties: width, height, aspect)
|
||||
|
||||
``mp.msg.log(level, ...)``
|
||||
|
||||
``mp.msg.fatal(...)``
|
||||
|
||||
``mp.msg.error(...)``
|
||||
|
||||
``mp.msg.warn(...)``
|
||||
|
||||
``mp.msg.info(...)``
|
||||
|
||||
``mp.msg.verbose(...)``
|
||||
|
||||
``mp.msg.debug(...)``
|
||||
|
||||
``mp.msg.trace(...)``
|
||||
|
||||
``mp.utils.getcwd()`` (LE)
|
||||
|
||||
``mp.utils.readdir(path [, filter])`` (LE)
|
||||
|
||||
``mp.utils.file_info(path)`` (LE) Note: like lua - this does NOT expand
|
||||
meta-paths like ``~~/foo`` (other JS file functions do expand meta paths).
|
||||
|
||||
``mp.utils.split_path(path)``
|
||||
|
||||
``mp.utils.join_path(p1, p2)``
|
||||
|
||||
``mp.utils.subprocess(t)``
|
||||
|
||||
``mp.utils.subprocess_detached(t)``
|
||||
|
||||
``mp.utils.get_env_list()``
|
||||
|
||||
``mp.utils.getpid()`` (LE)
|
||||
|
||||
``mp.add_hook(type, priority, fn(hook))``
|
||||
|
||||
``mp.options.read_options(obj [, identifier [, on_update]])`` (types:
|
||||
string/boolean/number)
|
||||
|
||||
``mp.input.get(obj)``
|
||||
|
||||
``mp.input.select(obj)``
|
||||
|
||||
``mp.input.terminate()``
|
||||
|
||||
``mp.input.log(message, style)``
|
||||
|
||||
``mp.input.set_log(log)``
|
||||
|
||||
``exit()`` (global)
|
||||
|
||||
Additional utilities
|
||||
--------------------
|
||||
|
||||
``mp.last_error()``
|
||||
If used after an API call which updates last error, returns an empty string
|
||||
if the API call succeeded, or a non-empty error reason string otherwise.
|
||||
|
||||
``Error.stack`` (string)
|
||||
When using ``try { ... } catch(e) { ... }``, then ``e.stack`` is the stack
|
||||
trace of the error - if it was created using the ``Error(...)`` constructor.
|
||||
|
||||
``print`` (global)
|
||||
A convenient alias to ``mp.msg.info``.
|
||||
|
||||
``dump`` (global)
|
||||
Like ``print`` but also expands objects and arrays recursively.
|
||||
|
||||
``mp.utils.getenv(name)``
|
||||
Returns the value of the host environment variable ``name``, or
|
||||
``undefined`` if the variable is not defined.
|
||||
|
||||
``mp.utils.get_user_path(path)``
|
||||
Trivial wrapper of the ``expand-path`` mpv command, returns a string.
|
||||
``read_file``, ``write_file``, ``append_file`` and ``require`` already
|
||||
expand the path internally and accept mpv meta-paths like ``~~desktop/foo``.
|
||||
|
||||
``mp.utils.read_file(fname [,max])``
|
||||
Returns the content of file ``fname`` as string. If ``max`` is provided and
|
||||
not negative, limit the read to ``max`` bytes.
|
||||
|
||||
``mp.utils.write_file(fname, str)``
|
||||
(Over)write file ``fname`` with text content ``str``. ``fname`` must be
|
||||
prefixed with ``file://`` as simple protection against accidental arguments
|
||||
switch, e.g. ``mp.utils.write_file("file://~/abc.txt", "hello world")``.
|
||||
|
||||
``mp.utils.append_file(fname, str)``
|
||||
Same as ``mp.utils.write_file`` if the file ``fname`` does not exist. If it
|
||||
does exist then append instead of overwrite.
|
||||
|
||||
Note: ``read_file``, ``write_file`` and ``append_file`` throw on errors, allow
|
||||
text content only.
|
||||
|
||||
``mp.get_time_ms()``
|
||||
Same as ``mp.get_time()`` but in ms instead of seconds.
|
||||
|
||||
``mp.get_script_file()``
|
||||
Returns the file name of the current script.
|
||||
|
||||
``mp.utils.compile_js(fname, content_str)``
|
||||
Compiles the JS code ``content_str`` as file name ``fname`` (without loading
|
||||
anything from the filesystem), and returns it as a function. Very similar
|
||||
to a ``Function`` constructor, but shows at stack traces as ``fname``.
|
||||
|
||||
``mp.module_paths``
|
||||
Global modules search paths array for the ``require`` function (see below).
|
||||
|
||||
Timers (global)
|
||||
---------------
|
||||
|
||||
The standard HTML/node.js timers are available:
|
||||
|
||||
``id = setTimeout(fn [,duration [,arg1 [,arg2...]]])``
|
||||
|
||||
``id = setTimeout(code_string [,duration])``
|
||||
|
||||
``clearTimeout(id)``
|
||||
|
||||
``id = setInterval(fn [,duration [,arg1 [,arg2...]]])``
|
||||
|
||||
``id = setInterval(code_string [,duration])``
|
||||
|
||||
``clearInterval(id)``
|
||||
|
||||
``setTimeout`` and ``setInterval`` return id, and later call ``fn`` (or execute
|
||||
``code_string``) after ``duration`` ms. Interval also repeat every ``duration``.
|
||||
|
||||
``duration`` has a minimum and default value of 0, ``code_string`` is
|
||||
a plain string which is evaluated as JS code, and ``[,arg1 [,arg2..]]`` are used
|
||||
as arguments (if provided) when calling back ``fn``.
|
||||
|
||||
The ``clear...(id)`` functions cancel timer ``id``, and are irreversible.
|
||||
|
||||
Note: timers always call back asynchronously, e.g. ``setTimeout(fn)`` will never
|
||||
call ``fn`` before returning. ``fn`` will be called either at the end of this
|
||||
event loop iteration or at a later event loop iteration. This is true also for
|
||||
intervals - which also never call back twice at the same event loop iteration.
|
||||
|
||||
Additionally, timers are processed after the event queue is empty, so it's valid
|
||||
to use ``setTimeout(fn)`` as a one-time idle observer.
|
||||
|
||||
CommonJS modules and ``require(id)``
|
||||
------------------------------------
|
||||
|
||||
CommonJS Modules are a standard system where scripts can export common functions
|
||||
for use by other scripts. Specifically, a module is a script which adds
|
||||
properties (functions, etc) to its pre-existing ``exports`` object, which
|
||||
another script can access with ``require(module-id)``. This runs the module and
|
||||
returns its ``exports`` object. Further calls to ``require`` for the same module
|
||||
will return its cached ``exports`` object without running the module again.
|
||||
|
||||
Modules and ``require`` are supported, standard compliant, and generally similar
|
||||
to node.js. However, most node.js modules won't run due to missing modules such
|
||||
as ``fs``, ``process``, etc, but some node.js modules with minimal dependencies
|
||||
do work. In general, this is for mpv modules and not a node.js replacement.
|
||||
|
||||
A ``.js`` file extension is always added to ``id``, e.g. ``require("./foo")``
|
||||
will load the file ``./foo.js`` and return its ``exports`` object.
|
||||
|
||||
An id which starts with ``./`` or ``../`` is relative to the script or module
|
||||
which ``require`` it. Otherwise it's considered a top-level id (CommonJS term).
|
||||
|
||||
Top-level id is evaluated as absolute filesystem path if possible, e.g. ``/x/y``
|
||||
or ``~/x``. Otherwise it's considered a global module id and searched according
|
||||
to ``mp.module_paths`` in normal array order, e.g. ``require("x")`` tries to
|
||||
load ``x.js`` at one of the array paths, and id ``foo/x`` tries to load ``x.js``
|
||||
inside dir ``foo`` at one of the paths.
|
||||
|
||||
The ``mp.module_paths`` array is empty by default except for scripts which are
|
||||
loaded as a directory where it contains one item - ``<directory>/modules/`` .
|
||||
The array may be updated from a script (or using custom init - see below) which
|
||||
will affect future calls to ``require`` for global module id's which are not
|
||||
already loaded/cached.
|
||||
|
||||
No ``global`` variable, but a module's ``this`` at its top lexical scope is the
|
||||
global object - also in strict mode. If you have a module which needs ``global``
|
||||
as the global object, you could do ``this.global = this;`` before ``require``.
|
||||
|
||||
Functions and variables declared at a module don't pollute the global object.
|
||||
|
||||
Custom initialization
|
||||
---------------------
|
||||
|
||||
After mpv initializes the JavaScript environment for a script but before it
|
||||
loads the script - it tries to run the file ``init.js`` at the root of the mpv
|
||||
configuration directory. Code at this file can update the environment further
|
||||
for all scripts. E.g. if it contains ``mp.module_paths.push("/foo")`` then
|
||||
``require`` at all scripts will search global module id's also at ``/foo``
|
||||
(do NOT do ``mp.module_paths = ["/foo"];`` because this will remove existing
|
||||
paths - like ``<script-dir>/modules`` for scripts which load from a directory).
|
||||
|
||||
The custom-init file is ignored if mpv is invoked with ``--no-config``.
|
||||
|
||||
The event loop
|
||||
--------------
|
||||
|
||||
The event loop poll/dispatch mpv events as long as the queue is not empty, then
|
||||
processes the timers, then waits for the next event, and repeats this forever.
|
||||
|
||||
You could put this code at your script to replace the built-in event loop, and
|
||||
also print every event which mpv sends to your script:
|
||||
|
||||
::
|
||||
|
||||
function mp_event_loop() {
|
||||
var wait = 0;
|
||||
do {
|
||||
var e = mp.wait_event(wait);
|
||||
dump(e); // there could be a lot of prints...
|
||||
if (e.event != "none") {
|
||||
mp.dispatch_event(e);
|
||||
wait = 0;
|
||||
} else {
|
||||
wait = mp.process_timers() / 1000;
|
||||
if (wait != 0) {
|
||||
mp.notify_idle_observers();
|
||||
wait = mp.peek_timers_wait() / 1000;
|
||||
}
|
||||
}
|
||||
} while (mp.keep_running);
|
||||
}
|
||||
|
||||
|
||||
``mp_event_loop`` is a name which mpv tries to call after the script loads.
|
||||
The internal implementation is similar to this (without ``dump`` though..).
|
||||
|
||||
``e = mp.wait_event(wait)`` returns when the next mpv event arrives, or after
|
||||
``wait`` seconds if positive and no mpv events arrived. ``wait`` value of 0
|
||||
returns immediately (with ``e.event == "none"`` if the queue is empty).
|
||||
|
||||
``mp.dispatch_event(e)`` calls back the handlers registered for ``e.event``,
|
||||
if there are such (event handlers, property observers, script messages, etc).
|
||||
|
||||
``mp.process_timers()`` calls back the already-added, non-canceled due timers,
|
||||
and returns the duration in ms till the next due timer (possibly 0), or -1 if
|
||||
there are no pending timers. Must not be called recursively.
|
||||
|
||||
``mp.notify_idle_observers()`` calls back the idle observers, which we do when
|
||||
we're about to sleep (wait != 0), but the observers may add timers or take
|
||||
non-negligible duration to complete, so we re-calculate ``wait`` afterwards.
|
||||
|
||||
``mp.peek_timers_wait()`` returns the same values as ``mp.process_timers()``
|
||||
but without doing anything. Invalid result if called from a timer callback.
|
||||
|
||||
Note: ``exit()`` is also registered for the ``shutdown`` event, and its
|
||||
implementation is a simple ``mp.keep_running = false``.
|
||||
@@ -1,80 +0,0 @@
|
||||
EMBEDDING INTO OTHER PROGRAMS (LIBMPV)
|
||||
======================================
|
||||
|
||||
mpv can be embedded into other programs as video/audio playback backend. The
|
||||
recommended way to do so is using libmpv. See ``include/mpv/client.h`` in the mpv
|
||||
source code repository. This provides a C API. Bindings for other languages
|
||||
might be available (see wiki).
|
||||
|
||||
Since libmpv merely allows access to underlying mechanisms that can control
|
||||
mpv, further documentation is spread over a few places:
|
||||
|
||||
- https://github.com/mpv-player/mpv/blob/master/include/mpv/client.h
|
||||
- https://mpv.io/manual/master/#options
|
||||
- https://mpv.io/manual/master/#list-of-input-commands
|
||||
- https://mpv.io/manual/master/#properties
|
||||
- https://github.com/mpv-player/mpv-examples/tree/master/libmpv
|
||||
|
||||
C PLUGINS
|
||||
=========
|
||||
|
||||
You can write C plugins for mpv. These use the libmpv API, although they do not
|
||||
use the libmpv library itself.
|
||||
|
||||
They are enabled by default if compiler supports linking with the ``-rdynamic``
|
||||
flag on Linux/BSD platforms. On Windows they are always enabled.
|
||||
|
||||
C plugins location
|
||||
------------------
|
||||
|
||||
C plugins are put into the mpv scripts directory in its config directory
|
||||
(see the `FILES`_ section for details). They must have a ``.so`` or ``.dll``
|
||||
file extension. They can also be explicitly loaded with the ``--script`` option.
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
A C plugin must export the following function::
|
||||
|
||||
int mpv_open_cplugin(mpv_handle *handle)
|
||||
|
||||
The plugin function will be called on loading time. This function must not
|
||||
return as long as your plugin is loaded (it runs in its own thread). The
|
||||
``handle`` will be deallocated as soon as the plugin function returns.
|
||||
|
||||
The return value is interpreted as error status. A value of ``0`` is
|
||||
interpreted as success, while ``-1`` signals an error. In the latter case,
|
||||
the player prints an uninformative error message that loading failed.
|
||||
|
||||
Return values other than ``0`` and ``-1`` are reserved, and trigger undefined
|
||||
behavior.
|
||||
|
||||
Within the plugin function, you can call libmpv API functions. The ``handle``
|
||||
is created by ``mpv_create_client()`` (or actually an internal equivalent),
|
||||
and belongs to you. You can call ``mpv_wait_event()`` to wait for things
|
||||
happening, and so on. However do not call ``mpv_destroy()`` or
|
||||
``mpv_terminate_destroy()`` on this handle.
|
||||
|
||||
Note that the player might block until your plugin calls ``mpv_wait_event()``
|
||||
for the first time. This gives you a chance to install initial hooks etc.
|
||||
before playback begins.
|
||||
|
||||
The details are quite similar to Lua scripts.
|
||||
|
||||
Linkage to libmpv
|
||||
-----------------
|
||||
|
||||
The current implementation requires that your plugins are **not** linked against
|
||||
libmpv. What your plugins use are not symbols from a libmpv binary, but
|
||||
symbols from the mpv host binary.
|
||||
|
||||
On Windows to make symbols from the host binary available, you have to define
|
||||
MPV_CPLUGIN_DYNAMIC_SYM when compiling cplugin. This will load symbols
|
||||
dynamically, before calling ``mpv_open_cplugin()``.
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
See:
|
||||
|
||||
- https://github.com/mpv-player/mpv-examples/tree/master/cplugins
|
||||
+223
-551
File diff suppressed because it is too large.
Load diff
+218
-1103
File diff suppressed because it is too large.
Load diff
+1277
-6226
File diff suppressed because it is too large.
Load diff
+145
-676
@@ -20,94 +20,37 @@ The Interface
|
||||
|
||||
::
|
||||
|
||||
+------+---------+---------+-----------------------------------------------+
|
||||
| menu | pl prev | pl next | title cache |
|
||||
+------+------+------+---------+-----------+------+-------+-----+-----+----+
|
||||
| play | skip | skip | time | seekbar | time | audio | sub | vol | fs |
|
||||
| | back | frwd | elapsed | | left | | | | |
|
||||
+------+------+------+---------+-----------+------+-------+-----+-----+----+
|
||||
+------------------+-----------+--------------------+
|
||||
| playlist prev | title | playlist next |
|
||||
+-------+------+---+--+------+-+----+------+--------+
|
||||
| audio | skip | seek | | seek | skip | full |
|
||||
+-------+ back | back | play | frwd | frwd | screen |
|
||||
| sub | | | | | | |
|
||||
+-------+------+------+------+------+------+--------+
|
||||
| seekbar |
|
||||
+----------------+--------------+-------------------+
|
||||
| time passed | cache status | time remaining |
|
||||
+----------------+--------------+-------------------+
|
||||
|
||||
|
||||
menu
|
||||
============= ================================================
|
||||
left-click open the menu
|
||||
============= ================================================
|
||||
|
||||
pl prev
|
||||
playlist prev
|
||||
============= ================================================
|
||||
left-click play previous file in playlist
|
||||
shift+L-click show the playlist
|
||||
middle-click show the playlist
|
||||
right-click open the playlist menu
|
||||
============= ================================================
|
||||
|
||||
pl next
|
||||
============= ================================================
|
||||
left-click play next file in playlist
|
||||
shift+L-click show the playlist
|
||||
middle-click show the playlist
|
||||
right-click open the playlist menu
|
||||
shift+L-click show playlist
|
||||
============= ================================================
|
||||
|
||||
title
|
||||
| Displays the current playlist position and media-title, filename or custom
|
||||
title, or the target chapter name while hovering the seekbar.
|
||||
| Displays current media-title or filename
|
||||
|
||||
============= ================================================
|
||||
left-click show file and track info
|
||||
shift+L-click show the path
|
||||
middle-click show the path
|
||||
right-click open the history menu
|
||||
left-click show playlist position and length and full title
|
||||
right-click show filename
|
||||
============= ================================================
|
||||
|
||||
cache
|
||||
| Shows current cache fill status
|
||||
|
||||
play
|
||||
playlist next
|
||||
============= ================================================
|
||||
left-click toggle play/pause
|
||||
shift+L-click toggle infinite looping of the playlist
|
||||
middle-click toggle infinite looping of the playlist
|
||||
right-click toggle infinite looping of the current file
|
||||
============= ================================================
|
||||
|
||||
skip back
|
||||
============= ================================================
|
||||
left-click go to beginning of chapter / previous chapter
|
||||
shift+L-click show chapters
|
||||
middle-click show chapters
|
||||
right-click open the chapter menu
|
||||
============= ================================================
|
||||
|
||||
skip frwd
|
||||
============= ================================================
|
||||
left-click go to next chapter
|
||||
shift+L-click show chapters
|
||||
middle-click show chapters
|
||||
right-click open the chapter menu
|
||||
============= ================================================
|
||||
|
||||
time elapsed
|
||||
| Shows current playback position timestamp
|
||||
|
||||
============= ================================================
|
||||
left-click toggle displaying timecodes with milliseconds
|
||||
============= ================================================
|
||||
|
||||
seekbar
|
||||
| Indicates current playback position and position of chapters
|
||||
|
||||
============= ================================================
|
||||
left-click seek to position
|
||||
right-click seek to the nearest chapter
|
||||
mouse wheel seek forward/backward
|
||||
============= ================================================
|
||||
|
||||
time left
|
||||
| Shows remaining playback time timestamp
|
||||
|
||||
============= ================================================
|
||||
left-click toggle between total and remaining time
|
||||
left-click play next file in playlist
|
||||
shift+L-click show playlist
|
||||
============= ================================================
|
||||
|
||||
audio and sub
|
||||
@@ -115,29 +58,69 @@ audio and sub
|
||||
|
||||
============= ================================================
|
||||
left-click cycle audio/sub tracks forward
|
||||
shift+L-click cycle audio/sub tracks backwards
|
||||
middle-click cycle audio/sub tracks backwards
|
||||
right-click open the audio/sub track menu
|
||||
mouse wheel cycle audio/sub tracks forward/backwards
|
||||
right-click cycle audio/sub tracks backwards
|
||||
shift+L-click show available audio/sub tracks
|
||||
============= ================================================
|
||||
|
||||
vol
|
||||
skip back
|
||||
============= ================================================
|
||||
left-click toggle mute
|
||||
right-click open the audio device menu
|
||||
mouse wheel volume up/down
|
||||
left-click go to beginning of chapter / previous chapter
|
||||
shift+L-click show chapters
|
||||
============= ================================================
|
||||
|
||||
fs
|
||||
seek back
|
||||
============= ================================================
|
||||
left-click skip back 5 seconds
|
||||
right-click skip back 30 seconds
|
||||
shift-L-click skip back 1 frame
|
||||
============= ================================================
|
||||
|
||||
play
|
||||
============= ================================================
|
||||
left-click toggle play/pause
|
||||
============= ================================================
|
||||
|
||||
seek frwd
|
||||
============= ================================================
|
||||
left-click skip forward 10 seconds
|
||||
right-click skip forward 60 seconds
|
||||
shift-L-click skip forward 1 frame
|
||||
============= ================================================
|
||||
|
||||
skip frwd
|
||||
============= ================================================
|
||||
left-click go to next chapter
|
||||
shift+L-click show chapters
|
||||
============= ================================================
|
||||
|
||||
fullscreen
|
||||
============= ================================================
|
||||
left-click toggle fullscreen
|
||||
right-click toggle whether the window is maximized
|
||||
============= ================================================
|
||||
|
||||
Since mpv 0.40.0, it is possible to configure the commands to run with mouse
|
||||
actions on some interface elements, and the default behaviors of several
|
||||
elements were changed. If you miss some older behaviors, look at
|
||||
``etc/restore-osc-bindings.conf`` in the mpv git repository.
|
||||
seekbar
|
||||
| Indicates current playback position and position of chapters
|
||||
|
||||
============= ================================================
|
||||
left-click seek to position
|
||||
============= ================================================
|
||||
|
||||
time passed
|
||||
| Shows current playback position timestamp
|
||||
|
||||
============= ================================================
|
||||
left-click toggle displaying timecodes with milliseconds
|
||||
============= ================================================
|
||||
|
||||
cache status
|
||||
| Shows current cache fill status (only visible when below 45%)
|
||||
|
||||
time remaining
|
||||
| Shows remaining playback time timestamp
|
||||
|
||||
============= ================================================
|
||||
left-click toggle between total and remaining time
|
||||
============= ================================================
|
||||
|
||||
Key Bindings
|
||||
~~~~~~~~~~~~
|
||||
@@ -153,9 +136,22 @@ del Cycles visibility between never / auto (mouse-move) / always
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
This script can be customized through a config file ``script-opts/osc.conf``
|
||||
placed in mpv's user directory and through the ``--script-opts`` command-line
|
||||
option. The configuration syntax is described in `mp.options functions`_.
|
||||
The OSC offers limited configuration through a config file
|
||||
``lua-settings/osc.conf`` placed in mpv's user dir and through the
|
||||
``--script-opts`` command-line option. Options provided through the command-line
|
||||
will override those from the config file.
|
||||
|
||||
Config Syntax
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
The config file must exactly follow the following syntax::
|
||||
|
||||
# this is a comment
|
||||
optionA=value1
|
||||
optionB=value2
|
||||
|
||||
``#`` can only be used at the beginning of a line and there may be no
|
||||
spaces around the ``=`` or anywhere else.
|
||||
|
||||
Command-line Syntax
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
@@ -171,572 +167,85 @@ Example::
|
||||
Configurable Options
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``layout``
|
||||
Default: bottombar
|
||||
|
||||
The layout for the OSC. Currently available are: box, slimbox,
|
||||
bottombar, topbar, slimbottombar, slimtopbar and floating.
|
||||
|
||||
``seekbarstyle``
|
||||
Default: bar
|
||||
|
||||
Sets the style of the playback position marker and overall shape
|
||||
of the seekbar: ``bar``, ``diamond`` or ``knob``.
|
||||
|
||||
``seekbarhandlesize``
|
||||
Default: 0.6
|
||||
|
||||
Size ratio of the seek handle if ``seekbarstyle`` is set to ``diamond``
|
||||
or ``knob``. This is relative to the full height of the seekbar.
|
||||
|
||||
``seekbarkeyframes``
|
||||
Default: yes
|
||||
|
||||
Controls the mode used to seek when dragging the seekbar. If set to ``yes``,
|
||||
default seeking mode is used (usually keyframes, but player defaults and
|
||||
heuristics can change it to exact). If set to ``no``, exact seeking on
|
||||
mouse drags will be used instead. Keyframes are preferred, but exact seeks
|
||||
may be useful in cases where keyframes cannot be found. Note that using
|
||||
exact seeks can potentially make mouse dragging much slower.
|
||||
|
||||
``seekrangestyle``
|
||||
Default: inverted
|
||||
|
||||
Display seekable ranges on the seekbar. ``bar`` shows them on the full
|
||||
height of the bar, ``line`` as a thick line and ``inverted`` as a thin
|
||||
line that is inverted over playback position markers. ``none`` will hide
|
||||
them. Additionally, ``slider`` will show a permanent handle inside the seekbar
|
||||
with cached ranges marked inside. Note that these will look differently
|
||||
based on the seekbarstyle option. Also, ``slider`` does not work with
|
||||
``seekbarstyle`` set to ``bar``.
|
||||
|
||||
``seekrangeseparate``
|
||||
Default: yes
|
||||
|
||||
Controls whether to show line-style seekable ranges on top of the
|
||||
seekbar or separately if ``seekbarstyle`` is set to ``bar``.
|
||||
|
||||
``seekrangealpha``
|
||||
Default: 20
|
||||
|
||||
Alpha of the seekable ranges, 0 (opaque) to 255 (fully transparent).
|
||||
|
||||
``scrollcontrols``
|
||||
Default: yes
|
||||
|
||||
By default, going up or down with the mouse wheel can trigger certain
|
||||
actions (such as seeking) if the mouse is hovering an OSC element.
|
||||
Set to ``no`` to disable any special mouse wheel behavior.
|
||||
|
||||
``deadzonesize``
|
||||
Default: 0.75
|
||||
|
||||
Size of the deadzone. The deadzone is an area that makes the mouse act
|
||||
like leaving the window. Movement there won't make the OSC show up and
|
||||
it will hide immediately if the mouse enters it. The deadzone starts
|
||||
at the window border opposite to the OSC and the size controls how much
|
||||
of the window it will span. Values between 0.0 and 1.0, where 0 means the
|
||||
OSC will always popup with mouse movement in the window, and 1 means the
|
||||
OSC will only show up when the mouse hovers it. Default pre-0.42.0 was 0.5.
|
||||
|
||||
``minmousemove``
|
||||
Default: 0
|
||||
|
||||
Minimum amount of pixels the mouse has to move between ticks to make
|
||||
the OSC show up.
|
||||
|
||||
``showwindowed``
|
||||
Default: yes
|
||||
|
||||
Enable the OSC when windowed
|
||||
| Default: yes
|
||||
| Enable the OSC when windowed
|
||||
|
||||
``showfullscreen``
|
||||
Default: yes
|
||||
|
||||
Enable the OSC when fullscreen
|
||||
|
||||
``idlescreen``
|
||||
Default: yes
|
||||
|
||||
Show the mpv logo and message when idle
|
||||
|
||||
``audioonlyscreen``
|
||||
Default: no
|
||||
|
||||
Show the mpv logo when no video track is present or selected.
|
||||
| Default: yes
|
||||
| Enable the OSC when fullscreen
|
||||
|
||||
``scalewindowed``
|
||||
Default: 1.0
|
||||
|
||||
Scale factor of the OSC when windowed.
|
||||
| Default: 1.0
|
||||
| Scale factor of the OSC when windowed
|
||||
|
||||
``scalefullscreen``
|
||||
Default: 1.0
|
||||
| Default: 1.0
|
||||
| Scale factor of the OSC when fullscreen
|
||||
|
||||
Scale factor of the OSC when fullscreen
|
||||
``scaleforcedwindow``
|
||||
| Default: 2.0
|
||||
| Scale factor of the OSC when rendered on a forced (dummy) window
|
||||
|
||||
``vidscale``
|
||||
Default: auto
|
||||
|
||||
Scale the OSC with the video.
|
||||
``no`` tries to keep the OSC size constant as much as the window size allows.
|
||||
``auto`` scales the OSC with the OSD, which is scaled with the window or kept at a
|
||||
constant size, depending on the ``--osd-scale-by-window`` option.
|
||||
| Default: yes
|
||||
| Scale the OSC with the video
|
||||
| ``no`` tries to keep the OSC size constant as much as the window size allows
|
||||
|
||||
``valign``
|
||||
Default: 0.8
|
||||
|
||||
Vertical alignment in box and slimbox layouts, -1 (top) to 1 (bottom).
|
||||
| Default: 0.8
|
||||
| Vertical alignment, -1 (top) to 1 (bottom)
|
||||
|
||||
``halign``
|
||||
Default: 0.0
|
||||
|
||||
Horizontal alignment in box and slimbox layouts, -1 (left) to 1 (right).
|
||||
|
||||
``barmargin``
|
||||
Default: 0
|
||||
|
||||
Margin from bottom (bottombar, slimbottombar) or top (topbar, slimtopbar),
|
||||
in pixels.
|
||||
| Default: 0.0
|
||||
| Horizontal alignment, -1 (left) to 1 (right)
|
||||
|
||||
``boxalpha``
|
||||
Default: 80
|
||||
|
||||
Alpha of the background box, 0 (opaque) to 255 (fully transparent)
|
||||
| Default: 80
|
||||
| Alpha of the background box, 0 (opaque) to 255 (fully transparent)
|
||||
|
||||
``hidetimeout``
|
||||
Default: 500
|
||||
|
||||
Duration in ms until the OSC hides if no mouse movement, must not be
|
||||
negative
|
||||
| Default: 500
|
||||
| Duration in ms until the OSC hides if no mouse movement, must not be
|
||||
negative
|
||||
|
||||
``fadeduration``
|
||||
Default: 200
|
||||
| Default: 200
|
||||
| Duration of fade out in ms, 0 = no fade
|
||||
|
||||
Duration of fade effects in ms, 0 = no fade.
|
||||
``deadzonesize``
|
||||
| Default: 0
|
||||
| Size of the deadzone. The deadzone is an area that makes the mouse act
|
||||
like leaving the window. Movement there won't make the OSC show up and
|
||||
it will hide immediately if the mouse enters it. The deadzone starts
|
||||
at the window border opposite to the OSC and the size controls how much
|
||||
of the window it will span. Values between 0 and 1.
|
||||
|
||||
``fadein``
|
||||
Default: no
|
||||
``minmousemove``
|
||||
| Default: 3
|
||||
| Minimum amount of pixels the mouse has to move between ticks to make
|
||||
the OSC show up
|
||||
|
||||
Enable fade-in.
|
||||
``layout``
|
||||
| Default: box
|
||||
| The layout for the OSC. Currently available are: box, slimbox,
|
||||
bottombar and topbar.
|
||||
|
||||
``title``
|
||||
Default: ${!playlist-count==1:[${playlist-pos-1}/${playlist-count}] }${media-title}
|
||||
|
||||
String that supports property expansion that will be displayed as
|
||||
OSC title.
|
||||
ASS tags are escaped and newlines are converted to spaces.
|
||||
|
||||
``tooltipborder``
|
||||
Default: 1
|
||||
|
||||
Size of the tooltip outline when using bottombar or topbar layouts
|
||||
``seekbarstyle``
|
||||
| Default: slider
|
||||
| Sets the style of the seekbar, slider (diamond marker) or bar (fill)
|
||||
|
||||
``timetotal``
|
||||
Default: no
|
||||
|
||||
Show total time instead of time remaining
|
||||
|
||||
``remaining_playtime``
|
||||
Default: yes
|
||||
|
||||
Whether the time-remaining display takes speed into account.
|
||||
``yes`` - how much playback time remains at the current speed.
|
||||
``no`` - how much video-time remains.
|
||||
| Default: no
|
||||
| Show total time instead of time remaining
|
||||
|
||||
``timems``
|
||||
Default: no
|
||||
|
||||
Display timecodes with milliseconds
|
||||
|
||||
``tcspace``
|
||||
Default: 100 (allowed: 50-200)
|
||||
|
||||
Adjust space reserved for timecodes (current time and time remaining) in
|
||||
the ``bottombar`` and ``topbar`` layouts. The timecode width depends on the
|
||||
font, and with some fonts the spacing near the timecodes becomes too small.
|
||||
Use values above 100 to increase that spacing, or below 100 to decrease it.
|
||||
| Default: no
|
||||
| Display timecodes with milliseconds
|
||||
|
||||
``visibility``
|
||||
Default: auto (auto hide/show on mouse move)
|
||||
|
||||
Also supports ``never`` and ``always``
|
||||
|
||||
``visibility_modes``
|
||||
Default: never_auto_always
|
||||
|
||||
The list of visibility modes to cycle through when calling the
|
||||
osc-visibility cycle script message. Modes are separated by ``_``.
|
||||
|
||||
``boxwidth``
|
||||
Default: 550
|
||||
|
||||
Width of the ``box`` layout.
|
||||
|
||||
``slimboxwidth``
|
||||
Default: 660
|
||||
|
||||
Width of the ``slimbox`` layout.
|
||||
|
||||
``boxmaxchars``
|
||||
Default: 80
|
||||
|
||||
Max chars for the osc title at the box layout. mpv does not measure the
|
||||
text width on screen and so it needs to limit it by number of chars. The
|
||||
default is conservative to allow wide fonts to be used without overflow.
|
||||
However, with many common fonts a bigger number can be used. YMMV.
|
||||
|
||||
``boxvideo``
|
||||
Default: no
|
||||
|
||||
Whether to overlay the osc over the video (``no``), or to box the video
|
||||
within the areas not covered by the osc (``yes``). If this option is set,
|
||||
the osc may overwrite the ``--video-margin-ratio-*`` options, even if the
|
||||
user has set them. (It will not overwrite them if all of them are set to
|
||||
default values.) By default, ``visibility`` must be set to ``always``.
|
||||
Use ``dynamic_margins`` to allow margins to update with OSC visibility
|
||||
instead.
|
||||
|
||||
Currently, this is supported for the ``bottombar``, ``slimbottombar``,
|
||||
``topbar`` and ``slimtopbar`` layouts only. The other layouts do not change
|
||||
if this option is set. Separately, if window controls are present (see
|
||||
below), they will be affected regardless of which osc layout is in use.
|
||||
|
||||
Subtitles may still overlap with the OSC when ``--sub-use-margins`` is set
|
||||
to ``yes`` (the default), as they are allowed to extend into the margin
|
||||
area. Setting ``--sub-use-margins=no`` confines subtitles to the video
|
||||
area.
|
||||
|
||||
This does not work correctly with video outputs like ``--vo=xv``, which
|
||||
render OSD into the unscaled video.
|
||||
|
||||
``dynamic_margins``
|
||||
Default: no
|
||||
|
||||
When set to ``yes``, margins follow the actual OSC visibility: they are
|
||||
applied when the OSC appears and removed when it hides. Without this
|
||||
option, margins are only applied when ``visibility`` is set to ``always``.
|
||||
|
||||
``sub_margins``
|
||||
Default: no
|
||||
|
||||
Whether to adjust the subtitle margin so that subtitles do not overlap
|
||||
with the OSC. Requires ``dynamic_margins`` or ``visibility=always`` to
|
||||
take effect. Uses ``--sub-margin-y-offset`` to apply the adjustment.
|
||||
|
||||
With ``boxvideo`` enabled and ``--sub-use-margins=no``, subtitles are
|
||||
already confined to the video area and this option has no additional
|
||||
effect.
|
||||
|
||||
``osd_margins``
|
||||
Default: yes
|
||||
|
||||
Whether to adjust the OSD margin so that OSD text does not overlap
|
||||
with the OSC. Requires ``dynamic_margins`` or ``visibility=always`` to
|
||||
take effect. Uses ``--osd-margin-y-offset`` to apply the adjustment.
|
||||
|
||||
``windowcontrols``
|
||||
Default: auto (Show window controls if there is no window border/title-bar)
|
||||
|
||||
Whether to show window management controls over the video, and if so,
|
||||
which side of the window to place them. This may be desirable when the
|
||||
window has no decorations, either because they have been explicitly
|
||||
disabled (``border=no``) or because the current platform doesn't support
|
||||
them (eg: gnome-shell with wayland).
|
||||
|
||||
The set of window controls is fixed, offering ``minimize``, ``maximize``,
|
||||
and ``quit``. Not all platforms implement ``minimize`` and ``maximize``,
|
||||
but ``quit`` will always work.
|
||||
|
||||
``windowcontrols_independent``
|
||||
Default: yes
|
||||
|
||||
Whether to show window controls independently of the OSC, or show them
|
||||
together.
|
||||
|
||||
``windowcontrols_alignment``
|
||||
Default: right
|
||||
|
||||
If window controls are shown, indicates which side should they be aligned
|
||||
to.
|
||||
|
||||
Supports ``left`` and ``right`` which will place the controls on those
|
||||
respective sides.
|
||||
|
||||
``windowcontrols_title``
|
||||
Default: ${media-title}
|
||||
|
||||
String that supports property expansion that will be displayed as the
|
||||
windowcontrols title.
|
||||
ASS tags are escaped, and newlines and trailing slashes are stripped.
|
||||
|
||||
``floatingtitle``
|
||||
Default: yes
|
||||
|
||||
Whether to show the title row in the ``floating`` layout. When enabled,
|
||||
window controls are rendered as compact buttons without a full-width
|
||||
background bar.
|
||||
|
||||
``floatingwidth``
|
||||
Default: 700
|
||||
|
||||
Width of the ``floating`` layout.
|
||||
|
||||
``floatingalpha``
|
||||
Default: 105
|
||||
|
||||
Alpha of the ``floating`` layout background, 0 (opaque) to 255 (fully
|
||||
transparent).
|
||||
|
||||
``tracknumberswidth``
|
||||
Default: 35
|
||||
|
||||
Width of the track number labels next to the audio/subtitle track selector
|
||||
icons. Set to ``0`` to hide track numbers and show only the icons.
|
||||
|
||||
``greenandgrumpy``
|
||||
Default: no
|
||||
|
||||
Set to ``yes`` to reduce festivity (i.e. disable santa hat in December.)
|
||||
|
||||
``livemarkers``
|
||||
Default: yes
|
||||
|
||||
Update chapter markers positions on duration changes, e.g. live streams.
|
||||
The updates are unoptimized - consider disabling it on very low-end systems.
|
||||
|
||||
``chapter_fmt``
|
||||
Default: ``Chapter: %s``
|
||||
|
||||
Template for the chapter-name display when hovering the seekbar.
|
||||
Use ``no`` to disable chapter display on hover. Otherwise it's a lua
|
||||
``string.format`` template and ``%s`` is replaced with the actual name.
|
||||
|
||||
``unicodeminus``
|
||||
Default: no
|
||||
|
||||
Use a Unicode minus sign instead of an ASCII hyphen when displaying
|
||||
the remaining playback time.
|
||||
|
||||
``icon_style``
|
||||
Default: layout
|
||||
|
||||
Selects the icon set used for OSC buttons. Both sets are bundled in the
|
||||
mpv-osd-symbols font.
|
||||
|
||||
``layout``
|
||||
Select the icon set based on the current layout.
|
||||
``classic``
|
||||
The original mpv icon set.
|
||||
``fluent``
|
||||
Icons based on Microsoft's Fluent UI System Icons.
|
||||
|
||||
``background_color``
|
||||
Default: #000000
|
||||
|
||||
Sets the background color of the OSC.
|
||||
|
||||
``timecode_color``
|
||||
Default: #FFFFFF
|
||||
|
||||
Sets the color of the timecode and seekbar, of the OSC.
|
||||
|
||||
``title_color``
|
||||
Default: #FFFFFF
|
||||
|
||||
Sets the color of the video title. Formatted as #RRGGBB.
|
||||
|
||||
``time_pos_color``
|
||||
Default: #FFFFFF
|
||||
|
||||
Sets the color of the timecode at hover position in the seekbar.
|
||||
|
||||
``time_pos_outline_color``
|
||||
Default: #FFFFFF
|
||||
|
||||
Sets the color of the timecode's outline at hover position in the seekbar.
|
||||
Also affects the timecode in the slimbox layout.
|
||||
|
||||
``buttons_color``
|
||||
Default: #FFFFFF
|
||||
|
||||
Sets the colors of the big buttons.
|
||||
|
||||
``top_buttons_color``
|
||||
Default: #FFFFFF
|
||||
|
||||
Sets the colors of the top buttons.
|
||||
|
||||
``small_buttonsL_color``
|
||||
Default: #FFFFFF
|
||||
|
||||
Sets the colors of the small buttons on the left in the box layout.
|
||||
|
||||
``small_buttonsR_color``
|
||||
Default: #FFFFFF
|
||||
|
||||
Sets the colors of the small buttons on the right in the box layout.
|
||||
|
||||
``held_element_color``
|
||||
Default: #999999
|
||||
|
||||
Sets the colors of the elements that are being pressed or held down.
|
||||
|
||||
``tick_delay``
|
||||
Default: 1/60
|
||||
|
||||
Sets the minimum interval between OSC redraws in seconds. This can be
|
||||
decreased on fast systems to make OSC rendering smoother.
|
||||
|
||||
Ignored if ``tick_delay_follow_display_fps`` is set to yes and the VO
|
||||
supports the ``display-fps`` property.
|
||||
|
||||
``tick_delay_follow_display_fps``
|
||||
Default: no
|
||||
|
||||
Use display fps to calculate the interval between OSC redraws.
|
||||
|
||||
``max_thumb_size``
|
||||
Default: 200
|
||||
|
||||
Maximum display size of the preview thumbnail. Only meaningful when a
|
||||
Thumbnailer is active. See the `OSC Preview API`_ section.
|
||||
|
||||
The following options configure what commands are run when the buttons are
|
||||
clicked. ``mbtn_mid`` commands are also triggered with ``shift+mbtn_left``.
|
||||
An option that ends with ``_down_command`` means that the command is
|
||||
continuously called while the mouse button is held down.
|
||||
|
||||
``menu_mbtn_left_command=script-binding select/menu; script-message-to osc osc-hide``
|
||||
|
||||
``menu_mbtn_mid_command=``
|
||||
|
||||
``menu_mbtn_right_command=``
|
||||
|
||||
``playlist_prev_mbtn_left_command=playlist-prev; show-text ${playlist} 3000``
|
||||
|
||||
``playlist_prev_mbtn_mid_command=show-text ${playlist} 3000``
|
||||
|
||||
``playlist_prev_mbtn_right_command=script-binding select/select-playlist; script-message-to osc osc-hide``
|
||||
|
||||
``playlist_next_mbtn_left_command=playlist-next; show-text ${playlist} 3000``
|
||||
|
||||
``playlist_next_mbtn_mid_command=show-text ${playlist} 3000``
|
||||
|
||||
``playlist_next_mbtn_right_command=script-binding select/select-playlist; script-message-to osc osc-hide``
|
||||
|
||||
``title_mbtn_left_command=script-binding stats/display-page-5``
|
||||
|
||||
``title_mbtn_mid_command=show-text ${path}``
|
||||
|
||||
``title_mbtn_right_command=script-binding select/select-watch-history; script-message-to osc osc-hide``
|
||||
|
||||
``play_pause_mbtn_left_command=cycle pause``
|
||||
|
||||
``play_pause_mbtn_mid_command=cycle-values loop-playlist inf no``
|
||||
|
||||
``play_pause_mbtn_right_command=cycle-values loop-file inf no``
|
||||
|
||||
``chapter_prev_mbtn_left_command=osd-msg add chapter -1``
|
||||
|
||||
``chapter_prev_mbtn_mid_command=show-text ${chapter-list} 3000``
|
||||
|
||||
``chapter_prev_mbtn_right_command=script-binding select/select-chapter; script-message-to osc osc-hide``
|
||||
|
||||
``chapter_next_mbtn_left_command=osd-msg add chapter 1``
|
||||
|
||||
``chapter_next_mbtn_mid_command=show-text ${chapter-list} 3000``
|
||||
|
||||
``chapter_next_mbtn_right_command=script-binding select/select-chapter; script-message-to osc osc-hide``
|
||||
|
||||
``audio_track_mbtn_left_command=cycle audio``
|
||||
|
||||
``audio_track_mbtn_mid_command=cycle audio down``
|
||||
|
||||
``audio_track_mbtn_right_command=script-binding select/select-aid; script-message-to osc osc-hide``
|
||||
|
||||
``audio_track_wheel_down_command=cycle audio``
|
||||
|
||||
``audio_track_wheel_up_command=cycle audio down``
|
||||
|
||||
``sub_track_mbtn_left_command=cycle sub``
|
||||
|
||||
``sub_track_mbtn_mid_command=cycle sub down``
|
||||
|
||||
``sub_track_mbtn_right_command=script-binding select/select-sid; script-message-to osc osc-hide``
|
||||
|
||||
``sub_track_wheel_down_command=cycle sub``
|
||||
|
||||
``sub_track_wheel_up_command=cycle sub down``
|
||||
|
||||
``volume_mbtn_left_command=no-osd cycle mute``
|
||||
|
||||
``volume_mbtn_mid_command=``
|
||||
|
||||
``volume_mbtn_right_command=script-binding select/select-audio-device; script-message-to osc osc-hide``
|
||||
|
||||
``volume_wheel_down_command=add volume -5``
|
||||
|
||||
``volume_wheel_up_command=add volume 5``
|
||||
|
||||
``fullscreen_mbtn_left_command="cycle fullscreen"``
|
||||
|
||||
``fullscreen_mbtn_mid_command=``
|
||||
|
||||
``fullscreen_mbtn_right_command="cycle window-maximized"``
|
||||
|
||||
``skip_backward_mbtn_left_down_command=seek -5``
|
||||
|
||||
``skip_backward_mbtn_mid_down_command=frame-back-step``
|
||||
|
||||
``skip_backward_mbtn_right_down_command=seek -30``
|
||||
|
||||
``skip_forward_mbtn_left_down_command=seek 10``
|
||||
|
||||
``skip_forward_mbtn_mid_down_command=frame-step``
|
||||
|
||||
``skip_forward_mbtn_right_down_command=seek 60``
|
||||
|
||||
``close_mbtn_left_command=quit``
|
||||
|
||||
``close_mbtn_mid_command=``
|
||||
|
||||
``close_mbtn_right_command=``
|
||||
|
||||
``minimize_mbtn_left_command=cycle window-minimized``
|
||||
|
||||
``minimize_mbtn_mid_command=``
|
||||
|
||||
``minimize_mbtn_right_command=``
|
||||
|
||||
``maximize_mbtn_left_command=cycle ${?fullscreen==yes:fullscreen}${!fullscreen==yes:window-maximized}``
|
||||
|
||||
``maximize_mbtn_mid_command=``
|
||||
|
||||
``maximize_mbtn_right_command=``
|
||||
|
||||
Custom Buttons
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Additional script-opts are available to define custom buttons in ``bottombar``
|
||||
and ``topbar`` layouts.
|
||||
|
||||
.. admonition:: Example to add loop, shuffle and speed buttons
|
||||
|
||||
::
|
||||
|
||||
custom_button_1_content=🔁
|
||||
custom_button_1_mbtn_left_command=cycle-values loop-file inf no
|
||||
custom_button_1_mbtn_right_command=cycle-values loop-playlist inf no
|
||||
|
||||
custom_button_2_content=🔀
|
||||
custom_button_2_mbtn_left_command=playlist-shuffle
|
||||
|
||||
custom_button_3_content=⏱
|
||||
custom_button_3_mbtn_left_command=add speed 1
|
||||
custom_button_3_mbtn_right_command=set speed 1
|
||||
custom_button_3_wheel_up_command=add speed 0.25
|
||||
custom_button_3_wheel_down_command=add speed -0.25
|
||||
| Default: auto (auto hide/show on mouse move)
|
||||
| Also supports ``never`` and ``always``
|
||||
|
||||
Script Commands
|
||||
~~~~~~~~~~~~~~~
|
||||
@@ -744,59 +253,19 @@ Script Commands
|
||||
The OSC script listens to certain script commands. These commands can bound
|
||||
in ``input.conf``, or sent by other scripts.
|
||||
|
||||
``osc-message``
|
||||
Show a message on screen using the OSC. First argument is the message,
|
||||
second the duration in seconds.
|
||||
|
||||
``osc-visibility``
|
||||
Controls visibility mode ``never`` / ``auto`` (on mouse move) / ``always``
|
||||
and also ``cycle`` to cycle between the modes. If a second argument is
|
||||
passed (any value), then the output on the OSD will be silenced.
|
||||
|
||||
``osc-show``
|
||||
Triggers the OSC to show up, just as if user moved mouse.
|
||||
|
||||
``osc-hide``
|
||||
Hide the OSC when ``visibility`` is ``auto``.
|
||||
and also ``cycle`` to cycle between the modes
|
||||
|
||||
Example
|
||||
|
||||
You could put this into ``input.conf`` to hide the OSC with the ``a`` key and
|
||||
to set auto mode (the default) with ``b``::
|
||||
|
||||
a script-message osc-visibility never
|
||||
b script-message osc-visibility auto
|
||||
a script_message osc-visibility never
|
||||
b script_message osc-visibility auto
|
||||
|
||||
``osc-idlescreen``
|
||||
Controls the visibility of the mpv logo on idle. Valid arguments are ``yes``,
|
||||
``no``, and ``cycle`` to toggle between yes and no. If a second argument is
|
||||
passed (any value), then the output on the OSD will be silenced.
|
||||
|
||||
OSC Preview API
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
The OSC supports displaying preview thumbnails when hovering over the seekbar if
|
||||
a compatible thumbnailer script is installed. It communicates with a thumbnailer
|
||||
script via the following ``user-data`` properties:
|
||||
|
||||
``user-data/osc/draw-preview``
|
||||
Set by the OSC to request a thumbnail within the currently playing file.
|
||||
The ``draw-preview`` property is a table with the following fields:
|
||||
|
||||
``x``, ``y``
|
||||
Top-left coordinates (positive integers) to draw the thumbnail at.
|
||||
|
||||
``w``, ``h``
|
||||
Width and height (positive non-zero integers) of the area to draw the
|
||||
thumbnail in. Note that this only specifies the drawing width and
|
||||
height, the actual backing thumbnail size may differ.
|
||||
|
||||
``hover-sec``
|
||||
Requested thumbnail timestamp in seconds.
|
||||
|
||||
``ass``
|
||||
Optional ASS string to render alongside the thumbnail, using OSD
|
||||
coordinates. This can be used for decorations such as a thumbnail
|
||||
border.
|
||||
|
||||
The OSC sets this property to ``nil`` to signal the thumbnailer to clear
|
||||
the displayed thumbnail.
|
||||
|
||||
Avoid installing/enabling multiple thumbnailer script since this api expects
|
||||
only one to be active at a time.
|
||||
@@ -1,60 +0,0 @@
|
||||
POSITIONING
|
||||
===========
|
||||
|
||||
This script provides script bindings to pan videos and images. It can be
|
||||
disabled using the ``--load-positioning=no`` option.
|
||||
|
||||
Script bindings
|
||||
---------------
|
||||
|
||||
``pan-x <amount>``
|
||||
Adjust ``--video-align-x`` relatively to the OSD width, rather than
|
||||
relatively to the video width like the option. This is useful to pan large
|
||||
images consistently.
|
||||
|
||||
``amount`` is a number such that an amount of 1 scrolls as much as the OSD
|
||||
width.
|
||||
|
||||
``pan-y <amount>``
|
||||
Adjust ``--video-align-y`` relatively to the OSD height, rather than
|
||||
relatively to the video height like the option.
|
||||
|
||||
``amount`` is a number such that an amount of 1 scrolls as much as the OSD
|
||||
height.
|
||||
|
||||
``drag-to-pan``
|
||||
Pan the video while holding a mouse button, keeping the clicked part of the
|
||||
video under the cursor.
|
||||
|
||||
``align-to-cursor``
|
||||
Pan through the whole video while holding a mouse button, or after clicking
|
||||
once if ``toggle_align_to_cursor`` is ``yes``.
|
||||
|
||||
``cursor-centric-zoom <amount>``
|
||||
Increase ``--video-zoom`` by ``amount`` while keeping the part of the video
|
||||
hovered by the cursor under it, or the average position of touch points if
|
||||
known.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
This script can be customized through a config file
|
||||
``script-opts/positioning.conf`` placed in mpv's user directory and through the
|
||||
``--script-opts`` command-line option. The configuration syntax is described in
|
||||
`mp.options functions`_.
|
||||
|
||||
Configurable Options
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``toggle_align_to_cursor``
|
||||
Default: no
|
||||
|
||||
Whether ``align-to-cursor`` requires holding down a mouse button to pan. If
|
||||
``no``, dragging pans. If ``yes``, clicking the first time makes pan follow
|
||||
the cursor, and clicking a second time disables this.
|
||||
|
||||
``suppress_osd``
|
||||
Default: no
|
||||
|
||||
Whether to not print the new value of ``--video-zoom`` when using
|
||||
``cursor-centric-zoom``.
|
||||
@@ -1,197 +0,0 @@
|
||||
SELECT
|
||||
======
|
||||
|
||||
console can present a list of items to browse and select from with the
|
||||
``mp.input.select`` API. ``select.lua`` is a builtin client of this API
|
||||
providing script bindings that gather and format the data to be selected in the
|
||||
console and do operations on the selected item. It can be disabled using the
|
||||
``--load-select=no`` option.
|
||||
|
||||
This script is also used to populate the context menu.
|
||||
|
||||
Key bindings
|
||||
------------
|
||||
|
||||
When using ``mp.input.select``, the key bindings listed in `CONSOLE`_ are
|
||||
extended with the following:
|
||||
|
||||
ENTER, Ctrl+j and Ctrl+m
|
||||
Select the focused item.
|
||||
|
||||
UP and Ctrl+p
|
||||
Focus the item above, or the last one when the first item is selected.
|
||||
|
||||
DOWN and Ctrl+n
|
||||
Focus the item below, or the first one when the last item is selected.
|
||||
|
||||
PGUP and Ctrl+b
|
||||
Scroll up one page.
|
||||
|
||||
PGDN and Ctrl+f
|
||||
Scroll down one page.
|
||||
|
||||
Shift+LEFT
|
||||
Scroll left.
|
||||
|
||||
Shift+RIGHT
|
||||
Scroll right.
|
||||
|
||||
Ctrl+y
|
||||
Copy the focused item to the clipboard.
|
||||
|
||||
MBTN_LEFT
|
||||
Select the item under the cursor, or close the console if clicking outside
|
||||
of the menu rectangle.
|
||||
|
||||
WHEEL_UP
|
||||
Scroll up.
|
||||
|
||||
WHEEL_DOWN
|
||||
Scroll down.
|
||||
|
||||
WHEEL_LEFT and Shift+WHEEL_DOWN
|
||||
Scroll left.
|
||||
|
||||
WHEEL_RIGHT and Shift+WHEEL_UP
|
||||
Scroll right.
|
||||
|
||||
Typing printable characters does a fuzzy search of the presented items.
|
||||
|
||||
If the query starts with ``'``, only exact matches are filtered. You can also
|
||||
specify multiple search terms delimited by spaces, and only items matching all
|
||||
terms are filtered.
|
||||
|
||||
Script bindings
|
||||
---------------
|
||||
|
||||
By default select.lua's script bindings are bound to key sequences starting with
|
||||
``g`` listed in `Keyboard Control`_. The names of the script bindings listed
|
||||
below can be used to bind them to different keys.
|
||||
|
||||
.. admonition:: Example to rebind playlist selection in input.conf
|
||||
|
||||
Ctrl+p script-binding select/select-playlist
|
||||
|
||||
Available script bindings are:
|
||||
|
||||
``select-playlist``
|
||||
Select a playlist entry. ``--osd-playlist-entry`` determines how playlist
|
||||
entries are formatted.
|
||||
|
||||
``select-sid``
|
||||
Select a subtitle track, or disable the current one.
|
||||
|
||||
``select-secondary-sid``
|
||||
Select a secondary subtitle track, or disable the current one.
|
||||
|
||||
``select-aid``
|
||||
Select an audio track, or disable the current one.
|
||||
|
||||
``select-vid``
|
||||
Select a video track, or disable the current one.
|
||||
|
||||
``select-track``
|
||||
Select a track of any type, or disable a selected track.
|
||||
|
||||
``select-chapter``
|
||||
Select a chapter.
|
||||
|
||||
``select-edition``
|
||||
Select an MKV edition or DVD/Blu-ray title.
|
||||
|
||||
``select-subtitle-line``
|
||||
Select a subtitle line to seek to. This doesn't work with image subtitles.
|
||||
|
||||
``select-audio-device``
|
||||
Select an audio device.
|
||||
|
||||
``select-watch-history``
|
||||
Select a file from the watch history. Requires ``--save-watch-history``.
|
||||
|
||||
If you don't already use ``--autocreate-playlist``, it is recommended to
|
||||
enable it with this script binding to populate the playlist with the other
|
||||
files in the entry's directory.
|
||||
|
||||
.. admonition:: Example for input.conf to play files adjacent to the history entry
|
||||
|
||||
g-h script-binding select/select-watch-history; no-osd set autocreate-playlist filter
|
||||
|
||||
``select-watch-later``
|
||||
Select a file from watch later config files (see `RESUMING PLAYBACK`_) to
|
||||
resume playing. Requires ``--write-filename-in-watch-later-config``. This
|
||||
doesn't work with ``--ignore-path-in-watch-later-config``.
|
||||
|
||||
If you don't already use ``--autocreate-playlist``, it is recommended to
|
||||
enable it with this script binding to populate the playlist with the other
|
||||
files in the entry's directory.
|
||||
|
||||
.. admonition:: Example for input.conf to play files adjacent to the watch later entry
|
||||
|
||||
g-w script-binding select/select-watch-later; no-osd set autocreate-playlist filter
|
||||
|
||||
``select-binding``
|
||||
List the defined input bindings. You can also select one to run the
|
||||
associated command.
|
||||
|
||||
``show-properties``
|
||||
List the names and values of all properties. You can also select one to
|
||||
print its value on the OSD, which is useful for long values that get
|
||||
clipped.
|
||||
|
||||
``edit-config-file``
|
||||
Open ``mpv.conf`` in the system text editor, creating it if it doesn't
|
||||
already exist.
|
||||
|
||||
``edit-input-conf``
|
||||
Open ``input.conf`` in the system text editor, creating it if it doesn't
|
||||
already exist.
|
||||
|
||||
``open-docs``
|
||||
Open mpv's online documentation in the browser.
|
||||
|
||||
``open-chat``
|
||||
Open mpv's chat in the browser.
|
||||
|
||||
``menu``
|
||||
Show a menu with miscellaneous entries.
|
||||
|
||||
``context-menu``
|
||||
Show the context menu.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
This script can be customized through a config file ``script-opts/select.conf``
|
||||
placed in mpv's user directory and through the ``--script-opts`` command-line
|
||||
option. The configuration syntax is described in `mp.options functions`_.
|
||||
|
||||
Configurable options
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``history_date_format``
|
||||
Default: %Y-%m-%d %H:%M:%S
|
||||
|
||||
The format of dates of history entries. This is passed to Lua's ``os.date``,
|
||||
which uses the same formats as ``strftime(3)``.
|
||||
|
||||
``hide_history_duplicates``
|
||||
Default: yes
|
||||
|
||||
Whether to show only the last of history entries with the same path.
|
||||
|
||||
``menu_conf_path``
|
||||
Default: ~~/menu.conf (see `FILES`_).
|
||||
|
||||
The path from which to read the custom context menu definition (see `CONTEXT
|
||||
MENU`_).
|
||||
|
||||
``max_playlist_items``
|
||||
Default: 25
|
||||
|
||||
The maximum number of playlist entries in the context menu.
|
||||
|
||||
``populate_menu_data``
|
||||
Default: yes, except for libmpv
|
||||
|
||||
Whether observe the properties referenced in ``menu.conf`` and update
|
||||
``menu-data`` with suitable menu items after mpv's window is created.
|
||||
@@ -1,309 +0,0 @@
|
||||
STATS
|
||||
=====
|
||||
|
||||
This builtin script displays information and statistics for the currently
|
||||
played file. It is enabled by default if mpv was compiled with Lua support.
|
||||
It can be disabled entirely using the ``--load-stats-overlay=no`` option.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
The following key bindings are active by default unless something else is
|
||||
already bound to them:
|
||||
|
||||
==== ==============================================
|
||||
i Show stats for a fixed duration
|
||||
I Toggle stats (shown until toggled again)
|
||||
? Toggle displaying the key bindings
|
||||
==== ==============================================
|
||||
|
||||
While the stats are visible on screen the following key bindings are active,
|
||||
regardless of existing bindings. They allow you to switch between *pages* of
|
||||
stats:
|
||||
|
||||
==== ==================
|
||||
1 Show usual stats
|
||||
2 Show frame timings (scroll)
|
||||
3 Input cache stats
|
||||
4 Active key bindings (scroll)
|
||||
5 Selected Tracks Info (scroll)
|
||||
0 Internal stuff (scroll)
|
||||
==== ==================
|
||||
|
||||
If stats were displayed by toggling, these key bindings are also active:
|
||||
|
||||
==== ==================
|
||||
ESC Close the stats
|
||||
==== ==================
|
||||
|
||||
On pages which support scroll, these key bindings are also active:
|
||||
|
||||
==== ==================
|
||||
UP Scroll one line up
|
||||
DOWN Scroll one line down
|
||||
==== ==================
|
||||
|
||||
On page 4, these key bindings are also active:
|
||||
|
||||
==== ==================
|
||||
/ Search key bindings
|
||||
==== ==================
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
This script can be customized through a config file ``script-opts/stats.conf``
|
||||
placed in mpv's user directory and through the ``--script-opts`` command-line
|
||||
option. The configuration syntax is described in `mp.options functions`_.
|
||||
|
||||
Configurable Options
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``key_page_1``
|
||||
Default: 1
|
||||
``key_page_2``
|
||||
Default: 2
|
||||
``key_page_3``
|
||||
Default: 3
|
||||
``key_page_4``
|
||||
Default: 4
|
||||
``key_page_5``
|
||||
Default: 5
|
||||
``key_page_0``
|
||||
Default: 0
|
||||
``key_exit``
|
||||
Default: ESC
|
||||
|
||||
Key bindings for page switching while stats are displayed.
|
||||
|
||||
``key_scroll_up``
|
||||
Default: UP
|
||||
``key_scroll_down``
|
||||
Default: DOWN
|
||||
``key_scroll_search``
|
||||
Default: /
|
||||
``scroll_lines``
|
||||
Default: 1
|
||||
|
||||
Scroll key bindings and number of lines to scroll on pages which support it.
|
||||
|
||||
``duration``
|
||||
Default: 4
|
||||
|
||||
How long the stats are shown in seconds (oneshot).
|
||||
|
||||
``redraw_delay``
|
||||
Default: 1
|
||||
|
||||
How long it takes to refresh the displayed stats in seconds (toggling).
|
||||
|
||||
``persistent_overlay``
|
||||
Default: no
|
||||
|
||||
When `no`, other scripts printing text to the screen can overwrite the
|
||||
displayed stats. When `yes`, displayed stats are persistently shown for the
|
||||
respective duration. This can result in overlapping text when multiple
|
||||
scripts decide to print text at the same time.
|
||||
|
||||
``file_tag_max_length``
|
||||
Default: 128
|
||||
|
||||
Only show file tags shorter than this length, in bytes.
|
||||
|
||||
``file_tag_max_count``
|
||||
Default: 16
|
||||
|
||||
Only show the first specified amount of file tags.
|
||||
|
||||
``term_clip``
|
||||
Default: yes
|
||||
|
||||
Whether to clip lines to the terminal width.
|
||||
|
||||
``track_info_selected_only``
|
||||
Default: yes
|
||||
|
||||
Show track info for selected tracks only instead of all tracks.
|
||||
|
||||
``plot_perfdata``
|
||||
Default: no
|
||||
|
||||
Show graphs for performance data (page 2).
|
||||
|
||||
``plot_vsync_ratio``
|
||||
Default: no
|
||||
|
||||
``plot_vsync_jitter``
|
||||
Default: no
|
||||
|
||||
Show graphs for vsync and jitter values (page 1). Only when toggled.
|
||||
|
||||
``plot_cache``
|
||||
Default: yes
|
||||
|
||||
Show graphs for cache values (page 3). Only when toggled.
|
||||
|
||||
``plot_tonemapping_lut``
|
||||
Default: no
|
||||
|
||||
Enable tone-mapping LUT visualization automatically. Only when toggled.
|
||||
|
||||
``flush_graph_data``
|
||||
Default: yes
|
||||
|
||||
Clear data buffers used for drawing graphs when toggling.
|
||||
|
||||
``font``
|
||||
Default: same as ``osd-font``
|
||||
|
||||
Font name. Should support as many font weights as possible for optimal
|
||||
visual experience.
|
||||
|
||||
``font_mono``
|
||||
Default: monospace
|
||||
|
||||
Font name for parts where monospaced characters are necessary to align
|
||||
text. Currently, monospaced digits are sufficient.
|
||||
|
||||
``font_size``
|
||||
Default: 20
|
||||
|
||||
Font size used to render text.
|
||||
|
||||
``font_color``
|
||||
Default: same as ``osd-color``
|
||||
|
||||
Color of the text.
|
||||
|
||||
``border_size``
|
||||
Default: 1.65
|
||||
|
||||
Size of border drawn around the font.
|
||||
|
||||
``border_color``
|
||||
Default: same as ``osd-border-color``
|
||||
|
||||
Color of the text border.
|
||||
|
||||
``shadow_x_offset``
|
||||
Default: same as ``--osd-shadow-offset``
|
||||
|
||||
The horizontal distance from the text to position the shadow at.
|
||||
|
||||
``shadow_y_offset``
|
||||
Default: same as ``--osd-shadow-offset``
|
||||
|
||||
The vertical distance from the text to position the shadow at.
|
||||
|
||||
``shadow_color``
|
||||
Default: same as ``osd-shadow-color``
|
||||
|
||||
Color of the text shadow.
|
||||
|
||||
``alpha``
|
||||
Default: 11
|
||||
|
||||
Transparency of text when ``font_color`` is specified, of text borders when
|
||||
``border_color`` is specified, and of text shadows when ``shadow_color`` is
|
||||
specified.
|
||||
|
||||
``plot_bg_border_color``
|
||||
Default: 0000FF
|
||||
|
||||
Border color used for drawing graphs.
|
||||
|
||||
``plot_bg_border_width``
|
||||
Default: 1.25
|
||||
|
||||
Border width used for drawing graphs.
|
||||
|
||||
``plot_bg_color``
|
||||
Default: 262626
|
||||
|
||||
Background color used for drawing graphs.
|
||||
|
||||
``plot_color``
|
||||
Default: FFFFFF
|
||||
|
||||
Color used for drawing graphs.
|
||||
|
||||
``vidscale``
|
||||
Default: auto
|
||||
|
||||
Scale the text and graphs with the video.
|
||||
``no`` tries to keep the sizes constant.
|
||||
``auto`` scales the text and graphs with the OSD, which is scaled with the
|
||||
window or kept at a constant size, depending on the ``--osd-scale-by-window`` option.
|
||||
|
||||
Note: colors are given as hexadecimal values and use ASS tag order: BBGGRR
|
||||
(blue green red).
|
||||
|
||||
Different key bindings
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Additional keys can be configured in ``input.conf`` to display the stats::
|
||||
|
||||
e script-binding stats/display-stats
|
||||
E script-binding stats/display-stats-toggle
|
||||
|
||||
And to display a certain page directly::
|
||||
|
||||
i script-binding stats/display-page-1
|
||||
h script-binding stats/display-page-4-toggle
|
||||
|
||||
Active key bindings page
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Lists the active key bindings and the commands they're bound to, excluding the
|
||||
interactive keys of the stats script itself. See also ``--input-test`` for more
|
||||
detailed view of each binding.
|
||||
|
||||
The keys are grouped automatically using a simple analysis of the command
|
||||
string, and one should not expect documentation-level grouping accuracy,
|
||||
however, it should still be reasonably useful.
|
||||
|
||||
Using ``--idle --script-opt=stats-bindlist=yes`` will print the list to
|
||||
the terminal and quit immediately. Long lines are clipped to the terminal width
|
||||
unless this is disabled with ``--script-opt=stats-term_clip=no``. Escape
|
||||
sequences can be disabled by adding ``-`` before ``yes``, i.e.
|
||||
``--script-opt=stats-bindlist=-yes``.
|
||||
|
||||
Like with ``--input-test``, the list includes bindings from ``input.conf`` and
|
||||
from user scripts. Use ``--no-config`` to list only built-in bindings.
|
||||
|
||||
Internal stuff page
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Most entries shown on this page have rather vague meaning. Likely none of this
|
||||
is useful for you. Don't attempt to use it. Forget its existence.
|
||||
|
||||
Selecting this for the first time will start collecting some internal
|
||||
performance data. That means performance will be slightly lower than normal for
|
||||
the rest of the time the player is running (even if the stats page is closed).
|
||||
Note that the stats page itself uses a lot of CPU and even GPU resources, and
|
||||
may have a heavy impact on performance.
|
||||
|
||||
The displayed information is accumulated over the redraw delay (shown as
|
||||
``poll-time`` field).
|
||||
|
||||
This adds entries for each Lua script. If there are too many scripts running,
|
||||
parts of the list will simply be out of the screen, but it can be scrolled.
|
||||
|
||||
If the underlying platform does not support pthread per thread times, the
|
||||
displayed times will be 0 or something random (I suspect that at time of this
|
||||
writing, only Linux provides the correct via pthread APIs for per thread times).
|
||||
|
||||
Most entries are added lazily and only during data collection, which is why
|
||||
entries may pop up randomly after some time. It's also why the memory usage
|
||||
entries for scripts that have been inactive since the start of data collection
|
||||
are missing.
|
||||
|
||||
Memory usage is approximate and does not reflect internal fragmentation.
|
||||
|
||||
JS scripts memory reporting is disabled by default because collecting the data
|
||||
at the JS side has an overhead and will increase memory usage. It can be
|
||||
enabled by setting the ``--js-memory-report`` option before starting mpv.
|
||||
|
||||
If entries have ``/time`` and ``/cpu`` variants, the former gives the real time
|
||||
(monotonic clock), while the latter the thread CPU time (only if the
|
||||
corresponding pthread API works and is supported).
|
||||
+471
-594
File diff suppressed because it is too large.
Load diff
+931
-486
File diff suppressed because it is too large.
Load diff
Loaded 100 of 1121 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user