https://github.com/josiahbull/convertium
Automatically convert files into a widely supported standard to reduce Plex transcoding
https://github.com/josiahbull/convertium
convert docker ffmpeg plex python
Last synced: 3 months ago
JSON representation
Automatically convert files into a widely supported standard to reduce Plex transcoding
- Host: GitHub
- URL: https://github.com/josiahbull/convertium
- Owner: JosiahBull
- License: mit
- Created: 2022-07-07T21:09:57.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-28T01:29:40.000Z (over 2 years ago)
- Last Synced: 2025-03-11T05:48:33.810Z (3 months ago)
- Topics: convert, docker, ffmpeg, plex, python
- Language: Python
- Homepage:
- Size: 976 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Convertium



[](https://codecov.io/gh/JosiahBull/convertium)Convertium is a simple python script which recursively looks for video files in configured directories, then automatically reformats them in a style to minimize Plex transcoding by maximizing compatibility with as many devices as possible. By default files will be automatically reformatted to the following file format:
```bash
fps = 30
container = .mp4
video codec = h264
audio codec = mp3
resolution = 1920x1080
```Note that these options can be changed in your `docker-compose.yml` if you desire different conversion characteristics.
## Usage
All environmental variables are configurable, but below is an example `docker-compose.yml` file.
```yaml
version: "3.9"
services:
convertium:
restart: unless-stopped
image: ghcr.io/josiahbull/convertium:main
volumes:
- '/media/movies:/movies'
- '/media/tv:/tv'
environment:
# number of minutes between scans
- SCAN_INTERVAL=20
# comma separated list of paths to scan
- BASE_PATHS=/movies,/tv
# comma separated list of extensions to attempt conversions on
- VALID_EXTENSIONS=.mp4,.mkv,.avi,.mov,.wmv,.mpg,.mpeg
# comma seperated list of ffmpeg arguments to pass when converting
- FFMPEG_ARGUMENTS=-c:v,libx264,-crf,20,-preset,slow,-c:a,mp3,-b:a,192k,-vf,scale=1920:1080,-movflags,+faststart,-loglevel,error,-y
- PYTHON_ENV=production
# The times of day between which conversions should occur, strictly in 24-hour format, strictly with only a single pair of timestamps.
# Optionally, thread limits may be added to the timestamps - this can be used to create a "high performance" time of day,
# where other tasks may be impacted. Note that 01:00T#7-07:00t#2 would use 7 threads between 1am->7am, and then 2 threads from 7am->1am.
# setting threads to 0 will disable ANY conversions in that time of day. Omitting a thread requirement will allow unlimited threads.
- CONVERSION_TIMES=00:00-07:00T#0
depends_on:
- postgrespostgres:
restart: unless-stopped
image: postgres
volumes:
- './data:/var/lib/postgresql/data'
environment:
- POSTGRES_USER=convertium
- POSTGRES_PASSWORD=convertium
- POSTGRES_DB=convertiumautoheal:
restart: unless-stopped
image: willfarrell/autoheal
environment:
- AUTOHEAL_CONTAINER_LABEL=all
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- convertium
- postgres```
Then simply run `docker-compose up -d` to begin scanning and converting files. Note that this process can be very cpu intensive, as this crate makes no attempt to utilise any hardware support.
## Sister Projects
- [Renameium](https://github.com/JosiahBull/renameium) - Rename files according to easily customizable and configurable standards.
- [Removeium](https://github.com/JosiahBull/removeium) - Remove excess files provided in torrents, to clean up the database.
- [Subteium](https://github.com/JosiahBull/subteium) - Automatically strip advertisements and insert subtitle files into videos.
- [Convertium](https://github.com/JosiahBull/convertium) - Automatically convert files into a widely supported standard to reduce transcoding.## Licensing and Contribution
Unless otherwise specified, all contributions will be licensed under MIT