Last active
April 2, 2020 22:57
-
-
Save wngreene/281e9b968a615bdba34df4ad5220dcaf to your computer and use it in GitHub Desktop.
Convert folder of images to an h264 video.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
# Create a video from a folder of images. | |
FOLDER=${1} | |
OUTPUT_FILE=${2} | |
FPS=${3-30} | |
FMT=${4-%010d.png} | |
CODEC=${5-libx264rgb} | |
CRF=${6-0} # 0-lossless, 18-"visually" lossless, 23-default, 51-most compression. | |
pushd . | |
cd ${FOLDER} | |
ffmpeg -r ${FPS} -i ${FMT} -c:v ${CODEC} -crf ${CRF} ${OUTPUT_FILE} | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment