Skip to content
This repository was archived by the owner on Apr 12, 2026. It is now read-only.

Latest commit

 

History

History
51 lines (34 loc) · 1.76 KB

File metadata and controls

51 lines (34 loc) · 1.76 KB

typeconvert.py

Python CLI tool for batch file conversion using multiple FFmpeg workers.

Features

  • Multi-format Support: Convert multiple source formats (e.g., .wav, .flac) to a target format (e.g., .mp3).
  • Concurrent Processing: Leverages multiple FFmpeg workers for faster batch processing.
  • Recursive Search: Scan directories and subdirectories for source files.
  • In-place Replacement: Option to delete source files after successful conversion.

Installation

Ensure you have FFmpeg installed and added to your system PATH.

pip install -r requirements.txt

Dependencies: rich, ffmpeg-python.

Usage

python -m typeconvert [OPTIONS]

Options

  • -i, --input: Input directory.
  • -o, --output: Output directory.
  • -f, --from: List of source extensions to convert (e.g., wav flac).
  • -t, --to: Target extension (e.g., mp3).
  • -r, --recursive: Recursively search input directory.
  • --replace: Delete source files after conversion. Safe Mode: Files are moved to a hidden .typeconvert_trash folder during processing and only permanently deleted if the entire batch completes successfully. Interrupting the process restores them.
  • --dry-run: Simulate the conversion process without modifying any files.
  • -w, --workers: Number of concurrent FFmpeg instances (default: CPU count).

Example

Convert all .wav and .flac files in a folder to .mp3 using 4 workers, recursively, and replace the originals:

python -m typeconvert --input ./music --from wav flac --to mp3 --recursive --replace --workers 4

License

MIT