Mirror a directory tree of audio files converting the files to opus if needed
Project description
Media Archon
Table of Contents
Installation
pip install media-archon
Copy the config file media-archon.toml
into the top level of the directory tree of media you wish to convert and edit to meet your needs.
Theory
Media archon is an aggressively multithreaded Linux/Unix/MacOSX tool designed to mirror a tree of source media files to a destination tree, converting matching media using any command line tool selected by the user. It has been designed and tested around using the excellent fre:ac opensource audio software to convert existing MP3 audiobooks etc. into Opus files for unbeatable size vs. quality.
When executed with media-archon /directory/of/media/files/
, it will:
- Look for and read the
/directory/of/media/files/media-archon.toml
. - Attempt to discover how many threads can execute in parallel on the host (Threads).
- Create two threadpools, one
light
(default 10 �� Threads) for exploring directories and copying, and oneheavy
(default 1 �� Threads). These can be overriden in the config.
After configuring itself it will schedule a light
thread to walk /directory/of/media/files/
which will:
- Iterate through the objects in the directory looking for a configuration override file (default
media-archon-override.toml
). If found it will update its converter parameters for this directory and all its subdirectories. - Loop through the objects again and depending on whether it is a directory or a file with a particular extension (e.g.
.mp3
):- If a directory, schedule a new
light
thread to search it in parallel. - If a file on the ignore list (
.*
) ignore. - If a file with an extension in the copy list schedule a
light
thread to copy it to the destination. - If a file with an extension in the convert list schedule a
heavy
thread to convert it from the source to the target using the supplied command line in the config.
- If a directory, schedule a new
- Delete files and directories in the target that are not in the source.
License
media-archon
is distributed under the terms of the AGPL-3.0-or-later license.
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
Built Distribution
Hashes for media_archon-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa5cbed6f85278d63f64814c8ac874c9f72a5c6d60ca62da0ad76b1ec4c8424e |
|
MD5 | 8ccc02815559c1cb826ad425f9d4743a |
|
BLAKE2b-256 | 2f180e5b6a34feff6ee4587cc70c90e826a2e5cfd4817c57651d9cb6e33872d2 |