Skip to main content

Tiny CLI to extract and tag audio tracks from video files via ffmpeg.

Project description

Product intent

  • Extract production-ready audio from lecture/screencast videos without a DAW.
  • Provide predictable defaults while surfacing audio engineering knobs only when needed.
  • Run entirely from the terminal so it fits into automation scripts and batch workflows.

Requires ffmpeg/ffprobe on PATH (brew install ffmpeg on macOS).

UX design

Mental model

  • Primary verb is extract; everything else is an option that describes the desired audio file.
  • Default behaviour: first audio track, full timeline, export as high-quality mp3 next to the source file.
  • Advanced controls are flat flags (no subcommands) to keep the command memorable.

User journey

  1. Discovery - sound-track-extract --help lists one-liners for common tasks so a new user can copy/paste.
  2. Pre-flight - tool validates: source exists, ffmpeg installed, output path writable, and timecodes sane. Errors are plain-English with fixes.
  3. Execution - renders a short status block (input -> output, duration, selected format) before running ffmpeg.
  4. Completion - success message with location + file size; failures forward stderr and exit non-zero for scripting.

Key interactions

  • sound-track-extract video.mp4 -> default mp3 export (320 kbps, stereo, original length).
  • --format wav|flac|aac|ogg switches container/mode; CLI auto-adjusts sane defaults (e.g., bitrate ignored for lossless).
  • --start/--end allow clipping a segment; accepts HH:MM:SS or seconds.
  • --sample-rate, --channels, --bitrate tune technical audio output, grouped by option help text.
  • --output-dir and --name-template control where/how files are named (placeholders: {stem}, {format}, {track}).
  • --title/--artist/--album/--comment embed metadata; status panel now shows detected duration for confidence.
  • --list-tracks prints detected audio streams, --audio-track picks one, and --force overwrites existing exports.
  • --dry-run prints the ffmpeg command without executing, enabling trust before use.
  • Clear error copy for common mistakes (missing ffmpeg, overlapping timecodes, unwritable folders).

Usage

uv run sound-track-extract kdd_lec7.mp4
# or run the module directly
uv run python -m sound_track_extract.cli kdd_lec7.mp4

Frequently used recipes

  • Quick mp3: sound-track-extract talk.mov
  • Lossless FLAC: sound-track-extract talk.mov --format flac
  • Clip a quote: sound-track-extract talk.mov --start 00:10:05 --end 00:12:20
  • Inspect tracks: sound-track-extract talk.mov --list-tracks
  • Pick a dubbed track: sound-track-extract talk.mov --audio-track 1
  • Custom destination: sound-track-extract talk.mov --output-dir exports --name-template "{stem}_clean"
  • Tag metadata: sound-track-extract talk.mov --title "Lecture 7" --artist "KDD"
  • Automate: find . -name '*.mp4' -exec sound-track-extract {} --format wav --force \;

Development

uv sync            # install deps
uv run --extra dev pytest
uv run sound-track-extract --help

See CHANGELOG.md for progress snapshots.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sound_track_extract-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sound_track_extract-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file sound_track_extract-0.1.0.tar.gz.

File metadata

  • Download URL: sound_track_extract-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.6

File hashes

Hashes for sound_track_extract-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ff539e407356acbaa69253e0708296d70036bde50991f0abe4235551143f4bc9
MD5 19898221af55b9a0efab8e5948653d42
BLAKE2b-256 ca835f847a5a4d72beb9c63f5a3f3069ab175d922f7c5a6f33929c3ef33eb7fa

See more details on using hashes here.

File details

Details for the file sound_track_extract-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sound_track_extract-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26adc86d153bf98db197d397ea4a46edddfaef49f3fffc9709dad536050fb39d
MD5 dd5e21f1e557057a807dfbc19f428e78
BLAKE2b-256 8f17cec08fa78b07f6e8328d572ec05122bed44451b03e1d500a61598319adf2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page