-
-
Save dmd/1d4680c6cf40f3d3f9e67c5a7fdc2036 to your computer and use it in GitHub Desktop.
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 | |
| set -e # die on any failure | |
| trap 'rm -rf /tmp/nestframes' ERR | |
| TARGET=/Users/dmd/Documents/dashare/205spring/surv | |
| DAYSAGO=$1 | |
| if [[ $# -eq 0 ]]; then | |
| echo "need days ago" | |
| exit 0 | |
| fi | |
| YESTERDAY=$(date -v-${DAYSAGO}d +"%Y-%m-%d") | |
| for PLACE in B L | |
| do | |
| mkdir -p /tmp/nestframes/${PLACE} | |
| scp dev.host:nest-grabber/data/stills/${PLACE}*${YESTERDAY}*.jpg /tmp/nestframes/${PLACE}/ | |
| /usr/local/bin/ffmpeg -n -r 20 -pattern_type glob -i "/tmp/nestframes/${PLACE}/*.jpg" -c:v libx264 -vf fps=25 -pix_fmt yuv420p ${TARGET}/${PLACE}-${YESTERDAY}.mp4 | |
| done | |
| rm -rf /tmp/nestframes | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment