vedit is a small Rust command-line wrapper that runs auto-editor to remove silent parts from a video and then uses ffmpeg to adjust playback speed. It automates the two-step process: run auto-editor with a configurable margin, then apply video and audio speed filters with ffmpeg.
This repository contains a minimal CLI (see src/main.rs) that expects auto-editor and ffmpeg to be available on your PATH.
- Rust (stable) — to build the project
auto-editor— installed and available on your PATHffmpeg— installed and available on your PATH
Note: vedit assumes that after running:
auto-editor <input> --margin <N>sec
an altered file will exist with the same stem as the input and the suffix _ALTERED (e.g. video.mp4 -> video_ALTERED.mp4). Ensure your auto-editor installation/version produces that output or configure/move the file accordingly.
From cargo:
cargo install veditFrom the project root:
# Build in release mode, binary will be in ~/.cargo/bin
cargo install --path .Basic invocation:
vedit <input> --margin <seconds> --speed <factor> --output <output>Arguments:
<input>— Path to the input video file (positional).--margin— Margin in seconds passed toauto-editor(float, e.g.0.2).--speed— Playback speed factor applied withffmpeg(float, e.g.1.25,1.5,2.0).--output— Output filename for the final processed video.
Example:
# Remove silent parts (with 0.2s margin) then speed playback 1.5x, writing to output.mp4
vedit input.mp4 --margin 0.2 --speed 1.5 --output output.mp4The CLI performs the following steps:
- Parses arguments using
clap. - Runs:
auto-editor <input> --margin <margin>sec- Expects an altered file named
<stem>_ALTERED.<ext>to exist after that command.
- Runs
ffmpegon the altered file to change speed:- Video filter:
setpts=PTS/<speed> - Audio filter:
atempo=<speed>
- Video filter:
- Writes the final file to the path provided by
--output.
The code returns errors when the external commands exit with non-zero status:
- If
auto-editorfails, the program reportsauto-editor failed. - If
ffmpegfails, the program reportsffmpeg failed.
atempoaccepts only certain ranges per filter invocation (commonly 0.5–2.0). If you pass a--speedoutside ffmpeg's single-stepatemporange,ffmpegmay fail. A robust solution would chain multipleatempofilters for larger speed multipliers (not implemented here).- The tool relies on
auto-editorproducing an altered file with the_ALTEREDsuffix. If yourauto-editorversion uses a different naming pattern, you'll need to rename the altered file beforeveditrunsffmpeg, or modify the code. - This is a thin wrapper: all heavy lifting is done by
auto-editorandffmpeg.veditdoes not attempt to parse or modify media streams itself.
This project is intentionally small. If you want to:
- Support chaining
atempofor arbitrary speeds, - Make the altered filename configurable,
- Add better logging or dry-run mode,
feel free to open a PR or modify src/main.rs.