I often import photos and videos (mostly having JPG and MOV extensions) from digital cameras and tablets to my PC, and I would ideally like to see them sorted according to the dates and times they were taken already present in their EXIF data. And hence my wish to rename them all preferably using a simple Nautilus Script by preferably inserting the date and time stamps before each filename.
I have so far managed only to bring together the following Nautilus Script, which I believe is far from perfect:
for i in *.*
do
mv -i "$i" "$(exiftool -CreateDate "$i" | awk -F ': ' '{print $2}')_"$i""
done
What I don't like in this renaming method is the colons used in EXIF date and time stamps (e.g. "2013:09:03 20:55:09_IMG_0108.JPG") which might create problems when transferring these files later to other environments (e.g. Windows).
This command (using exiv2 instead of exiftool) conveniently enables manipulation of date and time stamps but its drawback is that it doesn't work on video (e.g. MOV) files:
exiv2 -k -r '%Y-%m-%d_%H-%M-%S_:basename:' rename "$i"
So I'm hoping someone can come up with a better solution. And it would be magic if it even managed to convert the original filenames and extensions to lowercase as well!