Subsec workaround for Olympus: read shot sequence number from tag "Drive Mode"

Started by willuwe, April 14, 2020, 07:27:00 AM

Previous topic - Next topic

willuwe

HI,

I am happily using commands like "C:\exiftoolgui\exiftool.exe -r -d "%Y\%Y-%m\%Y-%m-%d_%H-%M-%S" "-filename<}${subsecdatetimeoriginal}.${model;}.%ue" -k -progress:%150b -ext JPG" to quickly move around, structure and name my jpg, raw and movie files.
Because I store the files redundantly I do not use the counter option for the file names, i.e. I only create one file per drive, camera model and time of shot.
Unfortunately, my raw files are in Olympus ORF format, and the extraction of subsec information does not work. Consequently, the method above does not work for bursts with more than one photo taken per second.
However, I saw in the Meta data (maker section) a tag called "Drive Mode". Whenever I use continuous shooting mode, that tag reports (example) "Continuous Shooting, Shot 6; Electronic shutter". If I knew how to read this tag with exiftool, "cut out" the Shot# (here: 6) and add this to the name of the file, my problems would be perfectly solved.

Any idea how this could be done?

Thanks,
Uwe

Phil Harvey

Hi Uwe,

Try this:

"C:\exiftoolgui\exiftool.exe -r -d "%Y\%Y-%m\%Y-%m-%d_%H-%M-%S" "-filename<}${subsecdatetimeoriginal}.${model;}.%ue" "-filename<}${subsecdatetimeoriginal}.${model;}-${drivemode;$_ = /Shot (\d+)/ ? $1 : undef}.%ue" -k -progress:%150b -ext JPG"

Note that I've had to assign FileName twice.  The first assignment will have effect only if DriveMode is not available, or doesn't have the Shot number.  I don't know what DriveMode is for a single picture, but we will have to rework the command if it contains a "Shot" number.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

willuwe


Big thanks, Phil!

Though it did not work with the subsec-tag, I modified to
"C:\exiftoolgui\exiftool.exe -r -d "%Y\%Y-%m\%Y-%m-%d_%H-%M-%S" "-filename<${datetimeoriginal}.${model;}.%ue" "-filename<${datetimeoriginal}.${model;}-${drivemode;$_ = /Shot (\d+)/ ? $1 : undef}.%ue" -k -progress:%150b"

and it worked exactly as it should: correctly index-numbered the burst sequence shots, while it skipped the index for single shots. Olympus users can rejoice!
Please note that I had to remove the closing brackets "}" in the sequence "...filename<}${..." to stop the year-folders being named something like "}2020" - though I admit that I do not really understand how this worked.

Anyways: you have made me very happy.

BR,
Uwe

Phil Harvey

Hi Uwe,

Right.  I just cut-and-pasted, and didn't notice the subseconds and the extra "}".  Looks good now!

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

willuwe

One more related question: When processing files w/o the drivemode tag, exiftool reports a lot of "minor warnings" about the fact. Is there a way to oppress this (without losing performance)? I fiddled around with conditions like <<-if "defined drivemode" ...>>, but failed to get the result I wanted - obviously because being incapable of formatting the statement properly.

Any suggestions?

Thanks, Uwe

Phil Harvey

Hi Uwe,

The syntax would be -if "defined $drivemode"

But if you want to rename the files that don't have drive mode, then you should do this.  You can use either -q -q to suppress warnings and other messages, or -m to ignore minor warnings.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).