Created
May 15, 2022 16:33
-
-
Save daquinoaldo/812330891f4d0d9e63c5201161953015 to your computer and use it in GitHub Desktop.
Create a time lapse starting from plain photos taken with a intervalometer
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
#!/bin/zsh | |
[ -z "$1" ] && echo "Usage: $0 inputdir [framerate]" && exit 1 | |
inpudir=$1 | |
outputfile="$1.mov" | |
framerate=$2 | |
: ${framerate:="60"} | |
files=(${inpudir}/*) | |
size=$(file ${files[1]} | grep -Eo '([0-9]+x[0-9]+)') | |
extension="${files[1]##*.}" | |
frames=$(ls -l ${inpudir} | egrep -c '^-') | |
echo -e "\e[32mFrames to process: ${frames}\e[0m" | |
ffmpeg -framerate ${framerate} -pattern_type glob -i "${inpudir}/*.${extension}" -s:v ${size} -c:v prores -profile:v 3 -pix_fmt yuv422p10 ${outputfile} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment