videoclip
July 29, 2026 ยท View on GitHub
videoclip
Easily create video and audio clips with mpv in a few keypresses.
Videoclips are saved as .mp4 or .webm.
Subtitles can be embedded into the clips.
Prerequisites
-
Add the directory where
mpvis installed to the PATH.If you're using GNU/Linux, this step is likely unnecessary because package managers (
apt,pacman, etc.) place executable files to/usr/binwhich is already added to thePATH. If you have installedmpvto a non-standard location, or if you're not using the GNU operating system, you need to make sure thatmpvis added to thePATH.
Installation
Using git
Clone the repository to the mpv/scripts directory.
The command below works on the GNU operating system with git installed.
git clone 'https://github.com/Ajatt-Tools/videoclip.git' ~/.config/mpv/scripts/videoclip
To update the user-script on demand later, you can execute:
cd ~/.config/mpv/scripts/videoclip && git pull
Using make
Clone the repository first, then install to ~/.config/mpv by running:
git clone 'https://github.com/Ajatt-Tools/videoclip.git'
cd videoclip
make install
The installation target copies the videoclip/ directory to ~/.config/mpv/scripts/.
If none exists, installs the example config to ~/.config/mpv/script-opts/videoclip.conf.
To uninstall, run:
make uninstall
To install to a different mpv config directory, set PREFIX:
make PREFIX="$HOME/.config/mpv" install
Manually
- Download the latest release or the master branch (trunk)
- Extract the
videoclip/directory from the zip file to your mpv scripts directory.
| OS | Location |
|---|---|
| GNU/Linux | ~/.config/mpv/scripts/ |
| Windows | C:/Users/Username/AppData/Roaming/mpv/scripts/ |
Note: in Celluloid user scripts are installed by switching to the "Plugins" tab in the preferences dialog and dropping the files there.
Expected directory tree
~/.config/mpv/scripts
|-- other_addon_1
|-- other_addon_2
`-- videoclip
|-- main.lua
|-- ...
`-- videoclip.lua
Configuration
The config file should be created by the user, if needed.
| OS | Config location |
|---|---|
| GNU/Linux | ~/.config/mpv/script-opts/videoclip.conf |
| Windows | C:/Users/Username/AppData/Roaming/mpv/script-opts/videoclip.conf |
If a parameter is not specified in the config file, the default value will be used.
mpv doesn't tolerate spaces before and after =.
The example configuration file is stored in
videoclip/config/default_config.conf.
Release pages also provide it as videoclip.conf.
Copy it to your script-opts directory and edit it as needed.
Key bindings
| OS | Config location |
|---|---|
| GNU/Linux | ~/.config/mpv/input.conf |
| Windows | C:/Users/Username/AppData/Roaming/mpv/input.conf |
Add this line if you want to change the key that opens the script's menu.
c script-binding videoclip-menu-open
Usage
- Open a file in mpv and press
cto open the script menu. - Follow the onscreen instructions. You need to set the
start point,end point, and then presscto create the clip.
It is possible to create silent videoclips.
To do that, first mute audio in mpv.
The default key binding is m.
If a video has visible subtitles, they will be embedded automatically.
Toggle them off in mpv if you don't want any subtitles to be visible.
The default key binding is v.
Running tests
Run tests without mpv or a media file:
lua tests/run.lua
luajit tests/run.lua
Run tests inside a real mpv instance with a local media file:
VIDEOCLIP_TEST=TRUE mpv --msg-level=all=no,videoclip=warn "/path/to/video.mkv"