video-manager
video-manager
This simple crystal program will loop over the list of directories you tell it to via the config file. For each video file in the directory, it will optimize the file according to the ffmpeg encoding settings listed in your config file. Each file is copied to /tmp before conversion begins, and all file changes are done atomically, meaning the program can be interrupted at any point and you won't corrupt or lose any data. You can also configure the number of parallel conversions that will run at once. The default ffmpeg settings are designed to allow for fast seeking on a Plex server.
The program will save the hashes (based on filename, file size, and the ffmpeg options that were used) of each file it has already optimized in the config file so if it is re-run those same files will not be converted again. If you make a change to your ffmpeg options, all files will be re-converted since their hashes will be invalidated.
On a very good CPU (i.e. a 9900k), 8 threads seems to be the sweet spot.
The config file is located at ~/.video-manager-settings.json
. The first time the program is run a default config will be created and you can further configure things from there.
Only linux and macos are supported. Once windows support is added to crystal I may update this to work on windows if running ffmpeg on windows is even feasible, which I don't know.
Installation
- download and install crystal via https://crystal-lang.org/install/
- clone the repo
git clone git@github.com:sam0x17/video-manager.git
cd
into the repo (cd video-manager
)- run
shards install
- run
shards build --release
The binary is now located in the bin
folder. You can run it directly, or install it somewhere more permanent on your system like /usr/bin
.
video-manager
- 3
- 1
- 1
- 0
- 0
- 4 months ago
- March 15, 2020
MIT License
Sat, 21 Dec 2024 13:48:59 GMT