five82 / batchtranscode

GNU General Public License v2.0
2 stars 1 forks source link
docker-container ffmpeg-wrapper gplv2 video-transcoding

batchtranscode Docker image

I'm stepping away from maintaining this for the foreseeable future due to time constraints. The project will be archived since any potential future development will probably focus on a different approach.

HDR transcoding is not working correctly. Do not use this with HDR content. For further details, see the following issue:

https://github.com/five82/batchtranscode/issues/27

Available on Docker Hub at https://hub.docker.com/r/five82/batchtranscode/

docker pull five82/batchtranscode

Takes video files, analyzes, and batch transcodes automatically using FFmpeg based on the following conditions:

All output files will be MKV. Use FFmpeg or other tools to remux if you need a different video container. The script does support transcoding UHD and HDR videos.

Description

batchtranscode is a bash script inside a Docker container that uses FFmpeg to transcode videos. The intention is to simplify your workflow when transcoding multiple videos at once. Drop your videos into a directory and start the container. The script will analyze each video, choose the appropriate encoding parameters, and transcode.

Usage

Create input, intermediate, and output directories. Add all video files that you want to encode into your input directory. Start the docker container with the command below and it will sequentially encode each video in the directory. The container will terminate when complete.

docker run --rm \
--name batchtranscode \
-v <path/to/input/dir>:/input \
-v <path/to/intermediate/dir>:/intermediate \
-v <path/to/output/dir>:/output \
five82/batchtranscode

You can also put nested directories containing files into your input directory and batchtranscode will recreate the directory and file structure under the output directory.

Notes

The script will crop black bars by default. To disable cropping, see the cropblackbars optional parameter below.

Mapping the intermediate directory is only required if you are transcoding non MKV input files. Batchtranscode will copy and remux the file into an MKV container before transcoding. You will need enough free disk space in your intermediate directory for your largest non MKV input file.

Optional parameters

The defaults below were selected because they are optimal for my own encodes. Set the encoder to "x264", bitdepth to "8", and audioencoder to "aac" to ensure maximum compatibility with most devices. (Please note: HDR10 videos require the x265 encoder and a bitdepth of 10.)

FFmpeg optional parameters