Last active
September 10, 2023 20:13
-
-
Save victorlin/2d53550ab869474f9faf21b297b63417 to your computer and use it in GitHub Desktop.
Wyze cameras store video files in a folder hierarchy. This script creates a time lapse video file per hour.
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 | |
# | |
# Wyze cameras store video files in a folder hierarchy. This script creates a time lapse video file per hour. | |
date_folder="$1" | |
for hour_folder in $(ls "$date_folder") | |
do | |
echo "$date_folder-$hour_folder" | |
for hour_video in $(ls "$date_folder/$hour_folder" | grep -v "\-800k\.mp4") | |
do | |
hour="${hour_video%.*}" | |
ext="${hour_video##*.}" | |
# ffmpeg -i "$date_folder/$hour_folder/$hour.$ext" -vf "setpts=0.05*PTS" -b 800k -an "$date_folder/$hour_folder/$hour-800k.$ext" > /dev/null | |
echo "file '$date_folder/$hour_folder/$hour-800k.$ext'" >> "concat.txt" | |
done | |
ffmpeg -f concat -safe 0 -i "concat.txt" -c copy "$date_folder-$hour_folder.mp4" | |
rm "concat.txt" | |
rm "$date_folder/$hour_folder/*-800k*" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment