News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Renaming Live Photos (jpg + mov) in a single folder

Started by zarr, May 26, 2020, 07:07:10 AM

Previous topic - Next topic

zarr

Hi,

I have been using exiftool for many years to rename images to YYYY-MM-DD HH.MM.SS - Camera.jpg.

I am having some trouble renaming my iOS Live Photos to match this format. It seems that the filenames for the mov and jpg element need to be the same in order for Apple Photos to recognise them as a single Live Photo. As discussed in a few other posts this is problematic because the timestamp between the mov and jpg can be different. I have seen the posts below which deal with moving the files into date based directories, but I can't figure out the command to keep them all in one directory.

Any ideas please?

thanks

StarGeek

If you are in the same time zone that the video was shot in (ignoring any Summer/Standard time difference), you can continue to use the same command.  All you have to do is add the -api QuickTimeUTC option.

So if your command was something like
exiftool -d "%Y-%m-%d %H.%M.%S" "-Filename<$CreateDate - ${Model;}.%e" /path/to/files
you could use
exiftool -api QuickTimeUTC -d "%Y-%m-%d %H.%M.%S" "-Filename<$CreateDate - ${Model;}.%e" /path/to/files

The reason the time stamps are different is because video time stamps are supposed to be stored in UTC, so the time exiftool lists will be off by the time zone.  This is because early camera's usually didn't know what time zone it was.  This has changed with camera phones, as they know what time zone they're in.

If you are not in the same time zone as the video, then you will have to use the GlobalTimeShift option instead.  Just set it to the time zone that the video was taken in.  For example, if I shot a video on the East Coast US and then started processing it at my home on the West Coast, I would not use the -api option and instead add
-GlobalTimeShift -5
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

zarr

Thanks, this is helpful - however, for any given year there could be any number of different time zones which does complicate matters slightly. I see that -tagsfromfile could be used to copy the tags from each mov but I am have been unable to get this to work effectively either - a bit confused about how -fileorder comes into play here, if at all?

StarGeek

Ok then, the command would be something like this.  Replace Testname with Filename if you're sure the output is correct
exiftool -fileorder -FileName -d "%Y-%m-%d %H.%M.%S" -TagsFromFile %d%f.jpg '-TestName<$CreateDate - ${Model;}.%e' /path/to/files

The -FileOrder option is used to make sure the filenames are sorted in reverse, so that way the .mov files are processed before the jpg files.  Otherwise the jpg would most likely get renamed first and the mov file wouldn't get renamed.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

zarr

Thanks again. After a bit of testing this command worked:

exiftool -api quicktimeutc -fileorder -filename -d '%Y-%m-%d %H.%M.%S' -tagsfromfile %d%f.mov '-testname<$createdate%-c - ${model;}.%e' -r . -m

I swapped it around so that the mov tags are copied to jpegs, using the QuickTime api as you suggested in your first post. This seems to work, but the only way I'll know for sure is by importing the folder into Apple Photos and seeing if all Live Photos are properly combined... if I don't follow up on here, let's assume it worked as required!

cheers