I recreated the features I liked from losslesscut in the mpv (not mpv.net) video player via a lua script
Why?
LosslessCut is a great and intuitive user interface for cutting videos, but I dislike all the loading times you need to wait through at each step and much prefer a CLI / keyboard based workflow.
mpv is a much snappier video player, so I made a lua script with keybinds to gather in and out points of videos, and run an external process (smoothie or ffmpeg) to read that video and make a cut copy of them.
- supports cutting multiple segments (called 'indexes')
- entirely controllable by keyboard
- snappy, no chromium or javascript around here
- supports playlists (having multiple files open at once)
- segments are displayed by making fake chapters
Place suckless-cut.lua in your mpv scripts folder
What? what even is is my "scripts folder?"
Tip: if you installed mpv on Windows with Scoop it's at %USERPROFILE%\scoop\apps\mpv\current\portable_config
You may also run mpv with --script="/path/to/suckless-cut.lua"
-
g and h sets in and out points at current player position
-
G and H sets in point at
00:00:00, and out the end of the video
- Ctrl+r takes your indexes and executes your default export program with them
Each cut you make is stored in an index, which contains the start, fin (end) and file path
After setting a start and end point, setting another start point will automatically set it to index #2
-
c and C lets you go down (uncapped), and up (with capitalized) your indexes, which is what each
start-endcombo is called -
Ctrl-p prints all indexes to console & OSD
-
Ctrl+t (requires uosc installed) graphical index selector
Warning
smoothie export don't contain audio, to circumvent this cut with ffmpeg first then run it manually through smoothie
- k cycles cutting modes:
splitseparates every single cut into separate filestrimmerges and joins the multiple cuts you have per video
- Ctrl+v toggles on/off verbose
Keyframes are arbitrary timestamps in a video that are preferable to cut at, if not you may experience desync or your video not embedding.
To seek through each keyframes: move your cursor over to the seekbar and use your mouse scroll wheel on it to seek across keyframes, then set your start/end points with g h there. todo: find/add keybinds to easily do this via the keyboard

