Automating HandBrake encoding with Java
- You might have variable/peak frame rate (VFR/PFR) recordings, leading to audio sync issues in video editing software
- This is a problem with NVIDIA ShadowPlay and AMD ReLive
- Recursively scans input directory for
.mp4
files to encode - Encodes
.mp4
files with a Constant Frame Rate (CFR) preset- Encoded files are named with the suffix
.cfr.mp4
- The preset used is "Production Standard" H.264
- It works with any video resolution
- It works with any framerate
- It creates quite a large file afterwards, but it's ideal "as an intermediate format for video editing"
- I recommend deleting the encoded file after using it, and retaining the original archived file
- Encoded files are named with the suffix
- Archives original videos
The app requires the following arguments:
input
directory containing.mp4
files to encodeoutput
where you want encoded files to be savedarchive
where you want archived files to be saved- (These can all be the same directory, personally I record and encode to an SSD, then archive to NAS)
docker pull ghcr.io/will-molloy/auto-handbrake-cfr:latest
docker run --rm -v <INPUT_DIR>:/input -v <OUTPUT_DIR>:/output -v <ARCHIVE_DIR>:/archive ghcr.io/will-molloy/auto-handbrake-cfr
Module | Description |
---|---|
auto-handbrake-core | Core interface and classes required to run HandBrake via Java |
auto-handbrake-cfr | CFR conversion, described above |