https://github.com/marcoradocchia/mpv-cutvid
MPV lua script to cut and merge video sections into a single clip, using ffmpeg in the background
https://github.com/marcoradocchia/mpv-cutvid
cut-video ffmpeg lua mpv mpv-scripts video video-trim
Last synced: 2 months ago
JSON representation
MPV lua script to cut and merge video sections into a single clip, using ffmpeg in the background
- Host: GitHub
- URL: https://github.com/marcoradocchia/mpv-cutvid
- Owner: marcoradocchia
- License: gpl-3.0
- Created: 2022-03-30T17:02:30.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-09-22T17:51:53.000Z (over 2 years ago)
- Last Synced: 2025-01-04T17:46:34.867Z (4 months ago)
- Topics: cut-video, ffmpeg, lua, mpv, mpv-scripts, video, video-trim
- Language: Lua
- Homepage:
- Size: 20.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
mpv-cutvid






MPV lua script to cut and merge video sections into a single clip, using ffmpeg
in the background.## Description
Lua MPV script which allows to cut/trim video file into clips which are
generated and merged in the background while viedo playback is running.
In order to cut and merge the video clips a shell script running ffmpeg
commands is invoked.The script uses MPV's OSD messages for user interaction.
The output video will be created in the same directory as original one with the
following filename format: `YYYY-MM-DD_hh_mm_ss.mkv`.## Keymaps
Two default (but editable) keymaps are provides two keymaps:
* `Ctrl+t`: start/end video clip timestamp, which are saved in temporary file
and passed to ffmpeg;
* `Ctrl+Shift+t`: clear accidental start timestamp;
* `Ctrl+p`: start trimming/merging clips (valid input only if paired start/end
timestamps have been saved).## Installation
In order to install the the scripts run the following commands:
```sh
git clone https://github.com/marcoradocchia/mpv-cutvid
sudo make USER= install
```
where `` is a _placeholder_ for the user's name the script is intended to
be used by.### Uninstall
In order to uninstall the scripts run:
```sh
sudo make USER= uninstall
```
where `` is a _placeholder_ like above.### Requirements
This script makes use of ffmpeg to produce video output, on Arch Linux `ffmpeg`
is an MPV dependency. On different distribution installing `ffmpeg` might be
needed.The `ffmpeg-cut-merge` script needs `bc` to be installed. On Arch based distros
install it with:
```sh
sudo pacman -S bc
```## License
[GPLv3](LICENSE)