Skip to content

video cutting that sucks less (inspired by Lossless Cut and suckless.org).

License

Notifications You must be signed in to change notification settings

couleur-tweak-tips/suckless-cut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

suckless-cut

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.

Features

  • 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

chapters

Installation

Place suckless-cut.lua in your mpv scripts folder

What? what even is is my "scripts folder?"

mpv config folder location

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"

Keybinds

Setting in & out point(s)

  • 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

Rendering

  • Ctrl+r takes your indexes and executes your default export program with them

Navigating indexes

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-end combo is called

  • Ctrl-p prints all indexes to console & OSD

  • Ctrl+t (requires uosc installed) graphical index selector

image

Warning

smoothie export don't contain audio, to circumvent this cut with ffmpeg first then run it manually through smoothie

  • k cycles cutting modes:
    • split separates every single cut into separate files
    • trim merges and joins the multiple cuts you have per video

Debugging

  • Ctrl+v toggles on/off verbose

How to cut at each keyframe (for better results while cutting with ffmpeg)

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

Alternatives