Last active
May 18, 2017 06:36
-
-
Save netologist/4bb48d67c0eb49a5ee6444a54b9037a5 to your computer and use it in GitHub Desktop.
photos-date-changer.sh
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 | |
for folder in */ ; do | |
d1=${folder%%_*} | |
for file in "$folder"*; do | |
echo "$file" | |
if [[ $file =~ \.(avi|AVI|mpeg|mpg|mov|wmv|mp4)$ ]]; then | |
datestr=${d1//' '/'-'} | |
f=${file%%.*}; | |
e=${file##*.}; | |
ffmpeg -i "$file" -metadata ICRD="$d3 12:00:00" -c copy "${f}A.$e"; | |
rm "$file" | |
else | |
datestr=${d1//' '/':'} | |
exiftool "-AllDates=$datestr 12:00:00" "$file"; | |
rm "${file}_original" | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment