Last active
April 12, 2020 14:32
-
-
Save luisparravicini/754d54a9e858210ac4c601525d788049 to your computer and use it in GitHub Desktop.
ffmpeg options added to make twitter accept the video
This file contains hidden or 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/bash | |
# | |
# Takes a directory of macOS screemshots, label each file with | |
# a timestamp and creates a video with them. | |
# | |
dir=$1 | |
if [ -z "$dir" ]; then | |
echo usage: $0 path | |
exit 1 | |
fi | |
index=0 | |
for f in $dir/*.png; do | |
timestamp=$(basename "$f" | sed -e 's/Screen Shot //' -e 's/ at / - /' -e 's/\.png//') | |
fname=$(printf '%s/%03d.png' `dirname "$f"` $index) | |
let index=index+1 | |
echo $timestamp | |
mogrify -crop 1394x678+206+186 +repage "$f" | |
convert "$f" -background black -fill white -pointsize 20 \ | |
-gravity south label:"$timestamp" -geometry +0+10 \ | |
-composite "$fname" | |
rm "$f" | |
done | |
out=flights.mp4 | |
ffmpeg -framerate 1 -i "$dir"/%03d.png -r 12 -vcodec libx264 -pix_fmt yuv420p $out | |
echo created $out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment