Created
October 7, 2014 21:49
-
-
Save sergiolopes/ba64e5e09af1bd5bb3a9 to your computer and use it in GitHub Desktop.
Copy EXIF date from videos to file modification time
This file contains 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
for i in */*.MP4; do | |
echo "$i " | |
date=$(exiftool "$i"|grep "Create Date" | head -n 1|cut -b35-|sed -e 's/\:[0-9][0-9]$//g;s/://g;s/ //g') | |
touch -t "$date" "$i" | |
done | |
for i in */*.MTS; do | |
echo "$i " ; | |
date=$(exiftool "$i"|grep Original|cut -b35-|sed -e 's/\:[0-9][0-9]\+.*//g;s/://g;s/ //g'); | |
touch -t "$date" "$i"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment