Docker container that uses ffmpeg to auto-optimize a full directory of hero-video-files, ignoring non optimizable and failing files.
Recommended usage via Docker Kitematic & Docker Hub.
docker pull majamee/hero-videoptim
docker run -v /absolute/path/to/hero-videos-base-folder/:/video majamee/hero-videoptim
Please just replace in the command above the absolute path to your root video file folder and all videos inside (recursive) will be converted to web-optimized hero-videos (no-audio). You can also use tags like majamee/hero-videoptim:edge
(e.g. uses alpine's edge version as base).
docker pull majamee/hero-videoptim
does update the docker image.docker run...
will mount the folder/absolute/path/to/hero-videos-base-folder
into the docker image and convert all video-files within that folder replacing the original with optimized versions and leaving everything that cannot be optimized without errors as is. Backups of the original image will be kept next to the hero-video-files (which have the audio-track removed) to allow autoplay.
Just use Kitematic to open the shared folder, place your video file in there, replace "input.mkv"
in the commands below by your input video file (without ""
) and execute the shell commands subsequent into the Docker container.
# 1080p@CRF22 hero video
ffmpeg -y -threads 0 -i "input.mkv" -an -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -profile:v high -level 4.0 -vf "scale=min'(1920,iw)':-4" -crf 22 -movflags faststart -write_tmcd 0 "hero-optimized.mp4"
- Optimizes all video files in a folder or in any of its subfolders for web playback
- Prevents upscaling (maximum 1080p)
- Removes audio track to save bandwidth and to make autoplay for hero videos in all modern web browsers possible
- Optimized hero-video replaces the old file, which itself is being kept renamed as
*.backup
- Checks result for negative compression and prohibits it (keeps original if so)
- HTML5 Hero Video/ Background Player demo included
- Include Plyr for hero video/ background video playback