Separate photos by camera + .mov files of the same file name

Started by tupakima, March 05, 2023, 09:48:19 PM

Previous topic - Next topic

tupakima

Dear Exiftool seniors,

I've been trying to tackle this problem to no avail, it could be due to my limited capability to understand the Exiftool instructions. So here I am, hoping to be enlightened.

I have a big folder of photos/videos which I have organized by date, among which are media taken by different types of cameras, including my iPhone. Now I would like to separate them into their own camera model folder, preferably organized by date again. But those videos imported from my iPhone are .MOV files which carry no exif metadata at all. Most of them are 3-sec videos from the live-photo feature, which carry the same name as their corresponding photos, just different extension. So how do I execute this move? If those 3-sec videos could be moved along with their same-name photos, I would only need to manually clean up a small number of stand-alone videos from the iPhone and the .MP4 videos from my a6400, which also carry no metadata.

Thank you very much for your time!

Phil Harvey

Are the filesystem date/times valid?  If so, you could use those.

But dealing with your .MOV files which have a corresponding .JPG is possible. Something  like this is what I'm thinking.

exiftool -tagfromfile %d%f.JPG "-directory<${model;}/$datetimeoriginal" -d "%Y-%m-%d" -ext mov DIR

Then after this, run the same command again with -ext jpg instead of -ext mov to also move the JPG images.

Of course, you'll have to change the -d format and the directory-name structure according to your preferences, but this gives you the idea.  Basically, it moves the MOV files based on metadata from the corresponding JPG images.

But since they are already organized by date, maybe -d isn't necessary and you can use the existing structure.  But to give an example for this we would need a concrete example of your existing structure and how you want this to be changed.

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

tupakima

Good news is that after checking the exif data more carefully with exiftool, those .MOV files do contain information about the camera model:



And here is an example of my folder structure:


So it seems like I just need to find a command that sort the media by camera model then by date. No more matching same-name mayhem! Could you help me suggest such a command?

Phil Harvey

It is basically the same as the command I gave, but you don't need to read the tags from another file:

exiftool "-directory<${model;}/$datetimeoriginal" -d "%Y/%Y-%m/%Y-%m-%d" -ext mov DIR

Also, I've changed the date formatting to reflect your directory structure.  I don't know if you want the Model at the top level or the bottom -- you can change the command around if you want it differently.

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