A lightweight, queue-based automation framework for batch-converting videos and images using FFmpeg.
It is designed to handle heavy media conversion tasks sequentially, preventing system overload while maintaining a clean, tracked workflow.
- Queue-Based Workflow: Process heavy video/image conversions one by one without overloading your system.
- Ready-to-Use Presets: Includes handy presets for AV1 (libaom, libsvtav1), WebP, Opus, and custom video trimming.
- Robust Processing (
run.sh): * Automatically adjusts process priority (renice) to keep your OS responsive during intense CPU encodes.- Saves temporary outputs to a work-in-progress (
wip) directory, moving them tofinonly upon successful completion. - Safely removes completed queue items in real-time.
- Logs the entire process to
log.txtwith timestamps.
- Saves temporary outputs to a work-in-progress (
.
├── original/ # Place your raw, unconverted files here
├── queue/ # Symlinks to original files, representing the active queue
├── wip/ # Temporary directory for files currently being processed
├── fin/ # Final directory where successfully converted files are stored
├── select.sh # Selects the active FFmpeg preset script
├── gen_queue.sh # Generates symlinks from original/ to queue/
├── run.sh # The main batch-processing engine
├── print_info.sh # Helper script to output video frame counts
├── video_*.sh / image_*.sh # Pre-configured FFmpeg scripts
└── log.txt # Main execution logs
Ensure you have ffmpeg, ffprobe, and bash installed on your system.
- Arch Linux:
sudo pacman -S ffmpeg bash - Debian/Ubuntu:
sudo apt install ffmpeg bash - macOS (via Homebrew):
brew install ffmpeg
Here is a quick guide on how to batch-convert multiple images to the modern .webp format:
Create the original directory if it doesn't exist, and drop your input files inside:
mkdir -p original
# Put your source files (e.g., .png, .jpg) inside original/
Run select.sh with your desired preset script. This creates a symlink named function pointing to the active preset:
./select.sh image_libwebp.sh
Generate symlinks from your original/ folder to the queue/ folder to build the pipeline:
./gen_queue.sh
Start the conversion engine:
./run.sh
Note: The script may prompt you for your sudo password to lower its CPU priority (renice). This ensures your computer remains perfectly usable while FFmpeg runs in the background.
The conversion pipeline operates in a safe, step-by-step cycle:
[original/] ---> (gen_queue.sh) ---> [queue/] ---> (run.sh + preset) ---> [wip/] ---> [fin/]
- Queue Generation (
gen_queue.sh): Instead of copying heavy media files and wasting disk space, it creates symbolic links insidequeue/pointing back to youroriginal/files. - Preset Selection (
select.sh): It symlinks your chosen conversion script to a file namedfunction. This allowsrun.shto trigger the active script dynamically using./functionwithout hardcoding the format. - Process Optimization (
run.sh): When you startrun.sh, it usessudo reniceto assign a lower priority value to the current process. This is incredibly helpful for long, resource-heavy encodes (like AV1), keeping your UI snappy. - Safe Processing Cycle: For every file in the queue:
run.shlogs the metadata using./print_info.sh.- The preset is executed, and the intermediate file is written to
wip/. - Upon successful completion (exit status
0), the original queue link is safely deleted, and the finalized file is moved tofin/. - If a crash or interruption occurs, your files remain safely in
wip/orqueue/so you never lose progress.
This project is licensed under the GPL-3.0 License. See the LICENSE file for details.