SafClip is a terminal user interface (TUI) video clipping tool written in Rust. It offers keyboard and mouse-driven controls to create and merge video clips losslessly.
- Lossless Cuts: Uses FFmpeg stream copying (
-c copy) to cut and merge video files instantly without re-encoding. - Keyframe Snapping: Queries keyframes via
ffprobeand snaps segment boundaries to them, preventing frozen or black frames at clip start. A "LOADING" popup is displayed while metadata probing is in progress. - MPRIS Integration: Syncs playback status, seek position, and track duration with active Linux media players (like MPV or VLC) over D-Bus.
- Zoomable Timeline: A TUI timeline that can be zoomed and panned for millisecond-level precision.
- Mouse Scrubbing: Click to seek, drag to scrub, scroll wheel to zoom (anchored at cursor), and right-drag to pan the timeline.
- Session Restoration: Saves segments to
<source_filename>.safclip.jsonautomatically, with modification verification on reload.
ffmpegandffprobein your systemPATH.- Linux OS with D-Bus for MPRIS player synchronization.
- Start an MPRIS-compatible media player:
mpv --mpris /path/to/video.mp4
- Run SafClip:
safclip /path/to/video.mp4
Space: Play / PauseLeft/Right: Seek ±1s (Shift: ±5s, Alt: ±10s)Home/End: Jump to start / endK: Snap to nearest keyframe
+/-: Zoom in / outAlt+h/l: Pan left / right
- Left Click: Seek
- Left Drag: Scrub (pauses during scrub)
- Scroll Wheel: Zoom (anchored at cursor)
- Right Drag: Pan
a/d(orEnter): Set IN point / Set OUT point (adds segment)Up/Down: Select previous / next segmentDelete/x: Delete selected segmentu/Ctrl+r: Undo / Redoe/E(orShift+e): Export separate clips / Export merged clip
Tab: Switch active MPRIS player?: Toggle help popupEsc: Cancel or close popupsq: Quit
Sessions are saved as <source_filename>.safclip.json:
{
"version": 1,
"source_path": "/path/to/video.mp4",
"source_modified": 1717372800,
"segments": [
{
"id": "c3b8a1c8-c68e-4a69-873f-c300c76db36d",
"start_seconds": 12.5,
"end_seconds": 45.2,
"label": null
}
]
}