A minimal, terminal-based video segment cutter written in Rust. It uses ffmpeg for processing and viuer for in-terminal video playback.
This project’s code is under the MIT license.
- In-Terminal Playback: Uses
viuerto render video directly in the terminal. - Two Display Modes:
- Low-Res: Fast, block-based rendering that works in most terminals.
- High-Res: Pixel-based rendering using Kitty or iTerm graphics protocols (if supported).
- Segment-Based Editing:
- Place markers (
v) to define segments. - Toggle segments (
t) for inclusion or exclusion in the final export.
- Place markers (
- Interactive Timeline: A simple timeline shows the playhead, markers, and included/excluded segments.
- Dual Output Modes:
- Multi-File: Exports each "included" segment as a separate video file.
- Single-File: Concatenates all "included" segments into one continuous video file.
- Non-Destructive: All operations are non-destructive. Your original video file is never modified.
Warning
- It has only been tested on Linux.
- It may not build or run on other platforms.
- Terminal support for high-resolution playback (Kitty/iTerm) varies. Low-res mode is the default.
- It does not process or preview audio. The final export (using
-c copy) will preserve the original audio tracks.
Before you begin, you must have two external dependencies installed and available in your system's PATH:
- ffmpeg: Used for all video decoding, seeking, and segment exporting.
- ffprobe: Used to get video metadata (dimensions, duration, FPS).
You also need the Rust toolchain (e.g., rustc and cargo) to build the project.
-
Clone the repository:
git clone https://github.com/pbossev/rve.git cd rve -
Build the release binary:
cargo build --release
-
The final binary will be located at
target/release/rve. You can copy this to a directory in yourPATH:sudo cp target/release/rve /usr/local/bin/
The binary is named rve. To run it, simply pass a video file as an argument:
rve /path/to/my_video.mp4Based on the --help menu:
<filepath>: (Required) The path to the video file you want to edit.--single-output,-s: On exit, concatenate all "included" segments into one file (e.g.,filename_concat.mp4). If omitted, it defaults to multi-file mode.--high-res,-r: Start the application in high-resolution pixel mode. This only works if your terminal (e.g., Kitty, WezTerm) supports the necessary graphics protocols.--help,-h: Show the help menu.
| Key | Action |
|---|---|
Space |
Play / Pause |
. |
Next frame (when paused) |
, |
Previous frame (when paused) |
| Key | Action |
|---|---|
← / → |
Seek -5s / +5s |
Alt+← / Alt+→ |
Seek -30s / +30s |
Ctrl+← / Ctrl+→ |
Seek -60s / +60s |
0-9 |
Jump to 0% - 90% of the video |
| Key | Action |
|---|---|
v |
Place or remove a marker at the current playhead. |
t |
Toggle the current segment (between markers) as "Included" or "Excluded". |
[ |
Jump to the previous marker. |
] |
Jump to the next marker. |
| Key | Action |
|---|---|
r |
Toggle between Low-Res (block) and High-Res (pixel) display mode. |
i |
Toggle output mode between "Multi-File" and "Single-File". |
? |
Toggle the on-screen keybinding help display. |
q |
Quit and save. This begins the ffmpeg export process based on your segments. |
! |
Quit without saving. Exits the program immediately. |
I plan to develop this more as I get more time for it.
- Add basic audio preview support.
- Add basic audio editing support.
- Add multi-file importing.
- More advanced editing features (e.g., re-ordering segments, changing playback speed).
