ffrs translates plain English commands into ffmpeg commands. It works as both a command-line tool and a Rust library.
I’m a simple guy.
I watch a YouTube livestream about vibe coding. That curiosity pulls me into a search. I look up spec-kit—and there it is. Found.
Then I drift. I scroll my Facebook timeline. Scroll. Scroll again. Refresh.
Suddenly, nixCraft posts about the ffrs CLI tool. Yeah, it’s written in JavaScript—and the comment section is exactly what you’d expect.
Then someone drops the line that changes everything:
“This is my only complaint. It’s a great idea—just rewrite it in Rust or Go and ship it as a single binary.”
Me? Why not.
No overthinking. No debate. Just momentum.
Vibe it. Build it. Ship it.
- Translate plain English commands to ffmpeg commands
- Convert video, audio, and image formats
- Extract audio from a video file
- Interactive and direct command modes
- Dry-run to inspect the generated command before running it
- Deterministic, structured command generation
Actual conversion requires ffmpeg in your PATH. --dry-run only prints the command and does not need ffmpeg.
cargo install ffrsgit clone https://github.com/darkterminal/ffrs.git
cd ffrs
cargo install --path .Verify the installation:
ffrs --versionPrebuilt release archives are not currently published. Use one of the Cargo methods above.
# Convert a video file
ffrs "convert video.mp4 to video.avi"
# Inspect the command without running it
ffrs --dry-run "convert video.mp4 to video.avi"
# Extract audio
ffrs "extract audio from video.mp4 to audio.mp3"
# Paths with spaces
ffrs 'convert "my video.mp4" to "my video.avi"'
# Write the output into an existing directory
ffrs --output /path/to/output "convert video.mp4 to video.avi"
# Version and help
ffrs --version
ffrs --helpThe command is printed before execution. Use --dry-run when you only want to inspect it.
ffrs --interactiveType commands at the > prompt. Type quit or exit to leave; end-of-input (for example Ctrl-D) also exits.
Add to your Cargo.toml:
[dependencies]
ffrs = "0.1.0"Use in your code:
use ffrs::{CommandBuilder, Parser, Tokenizer};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut tokenizer = Tokenizer::new("convert video.mp4 to video.avi");
let tokens = tokenizer.tokenize();
let mut parser = Parser::new(tokens);
let intent = parser.parse()?;
let cmd_builder = CommandBuilder::new();
let ffmpeg_cmd = cmd_builder.build_command(&intent)?;
println!("Generated command: {}", ffmpeg_cmd.to_display_string());
Ok(())
}[operation] <input> to <output>
Supported operations:
convert— convert a file to another supported formatextract audio from <input> to <output>— extract audio (shorter formsextract audio <input> ...,extract <input> ..., andextractaudio <input> ...also work)
Rules:
- The input file must exist and be a file.
- The output must have a supported extension and must differ from the input.
--outputmust point to a directory that already exists; only the output file name is taken from the command.- Relative, absolute, quoted, and Windows-style paths are recognized.
- Video: MP4, AVI, MOV, WMV, MKV, WebM
- Audio: MP3, WAV, FLAC
- Images: JPG, PNG, GIF
0: success1: user input error (including CLI usage errors)2: ffmpeg execution failure3: internal error
- Commands execute immediately after being printed; use
--dry-runto inspect first. - Output directories are not created automatically.
- Glob patterns and
~are not expanded byffrs; the shell may expand them first. - No release binaries are published at the moment.
See CHANGELOG.md for notable changes.
See CONTRIBUTING.md for setup and contribution guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.