https://github.com/ppetr/audio-to-opus
https://github.com/ppetr/audio-to-opus
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ppetr/audio-to-opus
- Owner: ppetr
- License: apache-2.0
- Created: 2023-11-07T14:56:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-16T12:05:03.000Z (about 2 years ago)
- Last Synced: 2025-01-31T08:44:22.285Z (over 1 year ago)
- Language: Python
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.md
- License: LICENSE
- Code of conduct: docs/code-of-conduct.md
Awesome Lists containing this project
README
# Reduce the size of audio files by converting them to the [Opus audio format](https://en.wikipedia.org/wiki/Opus_(audio_format))
_*Disclaimer:* This is not an officially supported Google product._
This is expecially convenient for audio-books that are often encoded with
unnecessarily high bandwidth. And Opus is very well suited for low-bandwidth
speech encoding.
The script first checks the bandwidth of an input file using FFmpeg's
[`ffprobe`](https://ffmpeg.org/ffprobe.html). If it's already low enough (at
most twice the target), it just creates a symlink to it. Otherwise it
re-encodes it using `ffmpeg` (or
[`ffmpeg-normalize`](https://github.com/slhck/ffmpeg-normalize) if present).
This makes the script [idempotent](https://en.wikipedia.org/wiki/Idempotence).
# Installation
Prerequisites:
- Installed [`pipx`](https://pipx.pypa.io/stable/).
- Installed [`ffmpeg`](https://ffmpeg.org/download.html).
After checking out the repository run this command inside the checked out
directory:
```sh
pipx install .
```
Append `--force` if reinstalling over a previous version.
## Usage
```sh
audio2opus [-h] [--bitrate BITRATE] [--samplerate SAMPLERATE] input output
```
## Contributions
Please see [Code of Conduct](docs/code-of-conduct.md) and
[Contributing](docs/contributing.md).