7
1
I'm dealing with an unorganized, big group of media files, captured using several different cameras and camcorders, and I'd like to use exiftool in a bash script to rename each file with its creation date and time, maker and model.
With this command images are renamed as I want:
exiftool -m -P '-filename<${DateTimeOriginal}_${Make}_${Model}.%e' myfile.jpg
I already know I can format date and time using -d FMT option, but I'm omitting it for clarity.
Here's instead the problems I'm facing with DSLR "*.mov" videos:
- exiftool is dropping the .mov extension, even if it use ".mov" instead ".%e" in the file name model
- those files don't have the DateTimeOriginal tag, and I have to use the MediaCreateDate tag that other files don't have
Does anyone know how to "force" exiftool to use the original, .mov extension?
Is there a way to tell exiftool to check if an exif tag exists or not? And use another tag if the first isn't there?
I tried with something like
if [ -n `exiftool -m -p '$DateTime' filename]
then
...
But exiftool is dropping me an error, so the empty string check always fails. Any tip?
1
Actually, Phil Harvey, exiftool's dev, says that dropping ".mov" extension happen because of trailing nulls in the model name: http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,5079.msg24462.html#msg24462 He says he will fix this problem.
– gerlos – 2013-06-03T20:21:42.710