shrinktunes
shrinktunes is a convenience wrapper for ffmpeg batch jobs. It was originally created for batch converting audio files in a large asset library to various formats, containers, and compression levels.
Usage
Once installed, you can use the shrinktunes command to convert files specified individually or with a glob pattern. Below are some examples.
Convert a Single File
shrinktunes convert "path/to/your/file.wav" -o mp3
Convert Files to Multiple Formats
shrinktunes convert "path/to/your/files/*.wav" -o mp3 -o ogg
Convert with Verbose Logging
shrinktunes convert -v "path/to/your/files/*.wav" -o mp3
Force Overwrite Existing Files
shrinktunes convert "path/to/your/files/*.wav" -o mp3 -f
Installation
You'll need to have FFmpeg installed on your machine to use shrinktunes. If you don't have it installed, the CLI will provide instructions on how to get it based on your platform.
This project uses poetry for dependency management and packaging. To install shrinktunes, first get poetry, then run:
poetry install
Commands
shrinktunes convert
-
<glob_pattern>: A quoted glob pattern for files to convert, e.g. `"path/to/your/files/*.wav"(Note: If you forget to quote it, it won't be interpreted as a glob, but rather expanded by your shell, which will likely result in an error.`)
-
-o <ext>: Output format by file extension; must be specified one or more times. Supported formats are dynamically determined fromffmpeg(seeshrinktunes infofor common formats orffmpeg -formatsfor all of them). -
-v: Enable verbose logging mode -
-f: Force overwrite of existing files
shrinktunes info
You can also use shrinktunes to print information about the available codecs on your system with the info command:
$ shrinktunes info
ffmpeg is installed
Decoders:
aac raw ADTS AAC (Advanced Audio Coding)
avi AVI (Audio Video Interleaved)
flac raw FLAC
m4a QuickTime / MOV
mp3 MP3 (MPEG audio layer 3)
mp4 QuickTime / MOV
ogg Ogg
wav WAV / WAVE (Waveform Audio)
webm Matroska / WebM
Encoders:
avi AVI (Audio Video Interleaved)
flac raw FLAC
mp3 MP3 (MPEG audio layer 3)
mp4 MP4 (MPEG-4 Part 14)
ogg Ogg
wav WAV / WAVE (Waveform Audio)
webm WebM
Note It currently filters down to a few common ones (let me know of obvious oversights).
Use ffmpeg -formats to see the full list (they will still work with shrinktunes if ffmpeg can do it; the list is just overwhelmingly long so we have made it short).
Development
Clone the repository and install the dependencies with Poetry:
git clone https://github.com/your-username/shrinktunes.git
cd shrinktunes
poetry install
Tests
Tests utilize pytest. After installing the dependencies, run the tests with:
poetry run pytest
Or, inside a venv like I do:
$ source .venv/bin/activate
(shrinktunes) $ pytest
Contributing
We welcome contributions! Please open an issue or submit a pull request on GitHub.
License
shrinktunes is open-source software, released under MIT License.
Author
Metadata
Release files for shrinktunes 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shrinktunes-0.1.0.tar.gz | 5.4 kB | Without provenance | Details for shrinktunes-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| shrinktunes-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for shrinktunes-0.1.0-py3-none-any.whl |
Total release size: 12.8 kB
Release files / shrinktunes-0.1.0.tar.gz
| Download URL | shrinktunes-0.1.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fddc77c904795e286a92e3b8bf027df80b0d699125206e3aff93f9fc718c23df
|
|
BLAKE2b-256 checksum How to use checksums |
6074c92c0e80bef300692e53030652b32cdc21391bfef62c595e359fa0bd85e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / shrinktunes-0.1.0-py3-none-any.whl
| Download URL | shrinktunes-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26e5a132407a1472e6bcb1b7b500f630c5dbf6194472b527e76dc100958fdb31
|
|
BLAKE2b-256 checksum How to use checksums |
56fe558d1638ae45d7fc313b558206985a18e0086841e49955c92b5e5b552027
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for shrinktunes 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.