Sign inSign up

charlocharlie/ffmpeg-watch-encode

By charlocharlie

Updated over 5 years ago

Docker container to watch a directory and encode a video file with a quality factor.

Image
0

658

charlocharlie/ffmpeg-watch-encode repository overview

ffmpeg-watch-encode

A Docker container designed to watch a directory and encode a .mkv file at a desired CRF (Constant Rate Factor). The purpose of this is to reduce the file size of 4K HDR .mkv's by reducing the overall quality, but preserving all audio and subtitle streams.

Designed to be deployed to Unraid.

Build and tag the image
docker build . -t ffmpeg
Run the container with mounted volumes
# Run from cloned repository
docker run -v `pwd`/watch:/watch -v `pwd`/output:/output -v `pwd`/copy:/copy -v `pwd`/logs:/logs ffmpeg

# Run from Docker Hun
docker run -v `pwd`/watch:/watch -v `pwd`/output:/output -v `pwd`/copy:/copy -v `pwd`/logs:/logs charlocharlie/ffmpeg-watch-encode
Stopping the container

For some reason you can't CTRL-C out of the above command, so to stop the container, open another terminal and do:

docker container ls
# Copy the container ID for the ffmpeg-watch-encode container
docker container stop <container ID>

Options

You can configure some encoding options with environment variables:

Variable NameDefaultDescription
ENCODERlibx265Pick the encoder to use. The below options may behave differently when not using the libx265 encoder.
CRF28A quality factor for the encode from 0.0-58.0. Lower numbers are better quality and higher file size.
PRESETmediumx265 encoder preset. Set as low as you're willing to wait. See https://x265.readthedocs.io/en/default/presets.html
TUNE(none)x265 encoder tuning. See https://x265.readthedocs.io/en/default/presets.html#tuning

Tag summary

Content type

Image

Digest

Size

46.6 MB

Last updated

over 5 years ago

docker pull charlocharlie/ffmpeg-watch-encode