Created
September 1, 2024 09:50
-
-
Save Maddimax/cb2dfcd496660999894709386416db83 to your computer and use it in GitHub Desktop.
Mount an smb folder and combine all files inside into a timelaps movie
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/sh | |
| MOUNTDIR=$(mktemp -d) | |
| WORKDIR=$(mktemp -d) | |
| mkdir -p $MOUNTDIR | |
| # Mount the folder that contains your jpegs. Example: server-name/mount-name/some/folder/inside | |
| mount_smbfs //Guest:@$1 $MOUNTDIR | |
| find $MOUNTDIR/HomeAssistant/data/gcam -type f -name "*.jpg" -exec echo file '{}' \; > $WORKDIR/files.txt | |
| ffmpeg -y -f concat -safe 0 -i $WORKDIR/files.txt $WORKDIR/timelapse.mp4 | |
| umount $MOUNTDIR | |
| rmdir $MOUNTDIR | |
| open -W $WORKDIR/timelapse.mp4 | |
| rm -rf $WORKDIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment