Skip to content

Instantly share code, notes, and snippets.

@sergiolopes
Created October 7, 2014 21:49
Show Gist options
  • Save sergiolopes/ba64e5e09af1bd5bb3a9 to your computer and use it in GitHub Desktop.
Save sergiolopes/ba64e5e09af1bd5bb3a9 to your computer and use it in GitHub Desktop.
Copy EXIF date from videos to file modification time
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