A fast, precise MP3 cutting tool built with Rust.
- Frame-accurate MP3 cutting using ffmpeg stream copy
- Minimal memory usage (constant, independent of file size)
- Supports
MM:SSandSStime formats - Auto-generates timestamped output filenames
- Rust 1.70+
- ffmpeg (must be installed)
# Ubuntu/Debian
sudo apt install ffmpeg
# macOS
brew install ffmpeg
# Arch Linux
sudo pacman -S ffmpeg
# Or download from: https://ffmpeg.org/download.htmlcargo build --release
# Binary: target/release/scut- You specify an MP3 file on your computer (e.g.,
podcast.mp3) - You tell scut where to start and stop cutting (e.g., from 1:23 to 5:45)
- scut creates a new MP3 file with just that segment
- Your original file is never modified
The tool reads directly from your file, no uploading or loading into memory required.
# Cut from 1 minute 23 seconds to 5 minutes 45 seconds
cargo run -- -i /path/to/podcast.mp3 -s 1:23 -e 5:45
# IMPORTANT: Quote paths with spaces or special characters
cargo run -- -i "/path/with spaces/song.mp3" -s 1:23 -e 5:45What happens:
- Reads:
/path/to/podcast.mp3 - Extracts: Audio from 1:23 to 5:45
- Creates:
podcast_cut_20250114_143022.mp3(in current directory)
Always quote file paths that contain:
- Spaces
- Parentheses
() - Brackets
[] - Special characters
# ✅ Correct (quoted)
cargo run -- -i "/path/Song (2024) [HD].mp3" -s 1:00 -e 2:00
# ❌ Wrong (unquoted - bash will fail)
cargo run -- -i /path/Song (2024) [HD].mp3 -s 1:00 -e 2:00# Save with custom name
cargo run -- -i "/path/to/podcast.mp3" -s 1:23 -e 5:45 -o intro.mp3
# Save to specific folder (folder must exist)
cargo run -- -i "/path/to/podcast.mp3" -s 1:23 -e 5:45 -o "/path/to/output/intro.mp3"# 90 seconds to 180 seconds (same as 1:30 to 3:00)
cargo run -- -i /path/to/song.mp3 -s 90 -e 180-i, --input <FILE> Path to your MP3 file (e.g., /home/user/music.mp3)
-s, --start <START> Start time: MM:SS (e.g., 1:23) or seconds (e.g., 83)
-e, --end <END> End time: MM:SS (e.g., 5:45) or seconds (e.g., 345)
-o, --output <FILE> Where to save (optional, defaults to timestamped name)
# Extract first 30 seconds of a song
cargo run -- -i song.mp3 -s 0:00 -e 0:30 -o preview.mp3
# Cut a 10-minute segment from a lecture
cargo run -- -i lecture.mp3 -s 15:00 -e 25:00 -o chapter2.mp3
# Remove intro from podcast (get everything from 1:30 to end)
# First check duration: ffprobe -i podcast.mp3 -show_entries format=duration -v quiet
cargo run -- -i podcast.mp3 -s 1:30 -e 45:00 -o no_intro.mp3Module structure following SOLID principles:
errors.rs- Error typestime.rs- Time parsing and validationcli.rs- CLI argument parsingaudio.rs- Audio cutting operationsmain.rs- Application orchestration
Each module has a single responsibility and minimal public API.
cargo test # 27 unit testsTests were written before implementation (TDD approach).
MIT