Help writing sequence for my bucket list project

Started by JumpingBean, September 18, 2020, 05:30:24 PM

Previous topic - Next topic

JumpingBean

Hello all!  I'm a complete newbie and I'm a bit computer illiterate (this is my first forum post, EVER), but I really wanted to get the project of organizing my photos finally finished (bucket list of mine!).  I have over 2 tb of photos and working on iOS. I'm particular, and there doesn't seem to be an app solution that exists that can help me do it easily.  It seems exiftool could be part of the solution but I don't know if I can invest the time to learn and write the proper sequence (this also terrifies me).  I was hoping a superuser can be so kind and show mercy and help! :)

What I'm hoping to do:

1) Batch change the modified date on my photos to the creation date, as another way to sort in sequence in finder/photos.

2) I'm wanting to ultimately automate batch renaming my pictures (thousands of photos) to date of creation (year.month.day), name of point of interest, city, country (via reverse geotag), in sequence, and then have it automatically refile the photos into folders by day. ie (name of photo would be 2020.09.15 Statue of Liberty, New York City, USA and then it would go in 2020.09.15 folder).   Here's where it gets complicated - I took a million Live photos (apple iphone), which saves as both HEIC and MOV files, and I need to ensure that during the batch renaming, the two files have the same name/sequence number with their corresponding extensions, so that I can reconvert them into Live photos in the future.  In these same folders, there are single normal photos (HEIC) and single normal regular videos (MOV) mixed in, and I want them to be including in the rename process with preservation of creation-date-chronicity-order with the Live photos- I mention this for consideration.  I might need to applescript this?  Maybe use Hazel for the filing?  Also, I would need to buy the appropriate Google Maps API key for doing the reverse geotagging (which can be done via an ExifTool config file)?

I know everyone is super busy - but writing the sequence seems to be outside my skillset and a bit overwhelming!
I will continue to try to learn but any help would be super, duper, appreciated!    :D


bobo

#1
Hi JumpingBean,


Quote from: JumpingBean on September 18, 2020, 05:30:24 PM
1) Batch change the modified date on my photos to the creation date, as another way to sort in sequence in finder/photos.

For Finder: I personally don't recommend using the file modification date to organize files in Finder. This is a system file tag and can potentially change when you use file sync tools, copy from disk to disk or move file onto and off of backup services. I would personally rename photos in some form of Y_M_D_H_M_S_suffix.extension format so that they appear in the right order by file name in Finder.

For Photos: Photos is very tricky. I recently finished tagging, sorting and updating location and times for ~65000 photos across 16 years for Photos. Here are some findings from my experience:
1 - Photos uses a different tag and time structure to identify video file timestamp and location than for image files - this means that for video files, there has to be a different approach to tagging:
* I found that MP4, M4V files were not consistently supported and date times were not correctly extracted
--> My solution was to repack the video/audio into a MOV container
--> Photos uses Quicktime:CreationDate for date and time instead of CreateDate
--> Photos expects local time+timezone offset in Quicktime:CreationDate, and expects UTC time with no time-zone suffix in CreateDate
--> For GPS information, Photos expects Keys:GPSCoordinates. Other GPS location tags will not be read

Quote from: JumpingBean on September 18, 2020, 05:30:24 PM
2) I'm wanting to ultimately automate batch renaming my pictures (thousands of photos) to date of creation (year.month.day), name of point of interest, city, country (via reverse geotag), in sequence, and then have it automatically refile the photos into folders by day. ie (name of photo would be 2020.09.15 Statue of Liberty, New York City, USA and then it would go in 2020.09.15 folder).   Here's where it gets complicated - I took a million Live photos (apple iphone), which saves as both HEIC and MOV files, and I need to ensure that during the batch renaming, the two files have the same name/sequence number with their corresponding extensions, so that I can reconvert them into Live photos in the future.  In these same folders, there are single normal photos (HEIC) and single normal regular videos (MOV) mixed in, and I want them to be including in the rename process with preservation of creation-date-chronicity-order with the Live photos- I mention this for consideration.  I might need to applescript this?  Maybe use Hazel for the filing?  Also, I would need to buy the appropriate Google Maps API key for doing the reverse geotagging (which can be done via an ExifTool config file)?

This is a very loaded question. There is so much to unpack here. In general:
1 - Automation and scripting really only works if you stick to the exact same cameras and you limit the types of cameras you use. I found that using three different cameras, the amount of work required to get Photos in OSX to consistently recognize the photos and videos in date time order and location was exponential. It took me approximately 6 months to clean up my database for Photos with three different cameras (iPhone, Canon DSLR and an action cam).

2 - From my experience, its not easy to import HEIC+MOV into Photos as a Live Photo indirectly. If you mess with the MOV tags, its unlikely that Photos will group the video and image back together as a Live Photo package (it might treat them separately). If you want Photos to recognize and treat live photos properly, I would recommend importing directly from your iPhone to the Photos app. Your milage may vary, experiment with it.

3 - If by reverse-geo-tag, you mean using maps to manually tag each photo, there are some apps out there which can do this. For OSX, my favourite is GeoTag GeoTag (uses apple maps). You can keep google maps open in your browser on the side and copy the GPS coordinates over to GeoTag if you can't find the location on Apple maps. I used this app to tag ~65k photos.

GeoTag doesn't support video files - I made a fork of this app on GitHub and added basic video support (QuickTime supported codecs only)https://github.com/b0rna/GeoTag - you can download it but you will need to grab XCode and compile it yourself as I don't currently have a paid Apple Developer account and cannot release a binary. Please note that it doesn't support the Photos specific GPS tag for videos yet, but it can write GPS tags to video files that QuickTime supports. In the next few months, I hope to add a feature which will allow the app to write GPS tags to QuickTime MOV files such that Photos will recognize them.

4 - In general, I would recommend a flow like this:
a - sort images based on camera model in separate folders (you can have subfolders under each event/day folder or one folder per camera model). Exiftool can help do this as you can access camera model and other tags which identify the capture device.

b - Identify what modifications need to be made for each camera model and each type of file. For instance, when using Photos on OSX:
* Image and videos from iPhones (after 4S) generally do not need any modification
* Images from DSLRs and other camera may require correction to the date-time if the camera was taken to a different timezone (such as an overseas trip, and if the camera's time was not updated to the local time).
* Video files which are not in a QuickTime MOV container may need to be re-muxed (I used ffmpeg). You maybe able to keep MP4s in Photos but I don't think Photos date/time/GPS extraction behaviour for MP4 files is well understood.
* Once your video files are in an MOV container and have the correct time, you can add the CreationDate tag + time zone, and copy the GPS location into the keys:GPSCoordinates to allow photos to recognize the date time and location of your videos correctly.

Once you have a method for your cameras, you can package it up into a script and run that script when importing new images.

Keep in mind that this is not a weekend project. Doing this to my very clean image and video library took ~6 months of spare time. I would say that most of that time was spent geo-tagging images and fixing incorrect dates and times for overseas trips.

Hope that this can help get you started.

- Borna

JumpingBean

Hi, Borna!!! OMG, you are sooooo kind.  Thank you so much for your detailed and thoughtful response!  This totally helps!  What a great jumpstart!