Created
January 11, 2023 15:39
-
-
Save xionluhnis/864cda9c0b0d93797d8c4bead5253f46 to your computer and use it in GitHub Desktop.
Generate a timelapse from JPG images using FFMPEG
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 | |
[[ -z "$FR" ]] && FR=30 | |
[[ -z "$W" ]] && W=-1 | |
[[ -z "$H" ]] && H=1080 | |
[[ -z "$F" ]] && F=0.125 | |
[[ -z "$TR" ]] && TR=2 | |
INPUT="$1" | |
[[ -n "$2" ]] && OUTPUT="$2" || OUTPUT="${INPUT//\/}.mp4" | |
# ffmpeg -framerate $FR -pattern_type glob -i "$INPUT/*.JPG" -c:v libx264 -crf 17 -pix_fmt yuv420p -vf "transpose=0" -vf scale=-1:800 "$OUTPUT" | |
ffmpeg -framerate $FR -pattern_type glob -i "$INPUT/*.JPG" -c:v libx264 -crf 17 -pix_fmt yuv420p -vf "transpose=$TR,scale=$W:$H,setpts=$F*PTS" "$OUTPUT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment