https://github.com/f0e/mpv-lossless-cut
Cut videos incredibly quickly directly inside of the video player mpv. Fork of familyfriendlymikey/mpv-cut
https://github.com/f0e/mpv-lossless-cut
ffmpeg lossless lossless-cut mpv video video-editing
Last synced: about 2 months ago
JSON representation
Cut videos incredibly quickly directly inside of the video player mpv. Fork of familyfriendlymikey/mpv-cut
- Host: GitHub
- URL: https://github.com/f0e/mpv-lossless-cut
- Owner: f0e
- Created: 2023-01-20T03:21:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-01-27T09:31:13.000Z (5 months ago)
- Last Synced: 2026-01-27T22:09:05.728Z (5 months ago)
- Topics: ffmpeg, lossless, lossless-cut, mpv, video, video-editing
- Language: Lua
- Homepage:
- Size: 11.3 MB
- Stars: 71
- Watchers: 4
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mpv-lossless-cut
## about
The core functionality of this script is to very quickly cut videos losslessly in [mpv](https://mpv.io/installation/) as an alternative to [LosslessCut](https://github.com/mifi/lossless-cut).
I decided to modify [mpv-cut](https://github.com/familyfriendlymikey/mpv-cut) since I was looking for slightly different functionality to what the original script provided. Mainly I wanted to be able to adjust the start and end points of cuts.
Also credits to [suckless-cut](https://github.com/couleur-tweak-tips/suckless-cut) for inspiration & keybinds.
## requirements
Besides mpv, you must have `ffmpeg` in your PATH.
## installation
Download [the latest release](https://github.com/f0e/mpv-lossless-cut/releases/latest) and move the folders in the zip into your mpv folder.
| Platform | Path |
| ------------------- | -------------------------------------------------- |
| **Windows** | `%appdata%/Roaming/mpv/` |
| **Windows (Scoop)** | `%userprofile%/scoop/persist/mpv/portable_config/` |
| **Linux**/**MacOS** | `~/.config/mpv/` |
After that, the next time you run mpv the script will be loaded.
## options
`script-opts/mpv-lossless-cut.conf`:
- `lossless` - Whether the cut clips should be lossless. If set to yes, cuts may not be exact, as they can only occur at keyframes. Setting it to no will re-encode clips, but cut times will be exact.
- `output_dir` - The output directory for cuts, can be relative or absolute.
- Default value: `.` (will place cuts in the same directory as the original video)
- `multi_cut_mode` - The mode for handling multiple cuts for a single video. Options:
- `separate`: create separate cut files (default)
- `merge`: merge cut files into a single cut.
## usage
### keybinds
- g and h to set the start and end points of a cut (will use your current position).
- G and H will do the same, but will place the points at the very start or end of the video.
- r to render cuts.
- ctrl+g to toggle between `separate` and `merge` mode.
- ctrl+h to clear cuts.
If you want to change the start or end position of a cut you can press the keybind again. You can also create multiple cuts from a single video.
Rendered cuts will be placed in the same directory as the source file.
---
## troubleshooting
If the script doesn't work, you can try these steps.
- Make sure all of the [requirements](#requirements) are installed
- Make sure the script is installed in the correct directory. You should end up with something like: `~/.mpv/config/scripts/mpv-lossless-cut.lua`.
- Run mpv using the terminal (`mpv video.mp4`) and check the output, are there any errors?
- Make sure you don't have multiple versions of mpv installed. You might have installed the script to the wrong version.