Main Menu

Live Photos

Started by neebah, December 11, 2019, 11:00:58 AM

Previous topic - Next topic

neebah

When separated from the photos app Live photos consist of an image and a video file.  Each file contains a Content-ID in the makernotes somewhere.  How would one go about processing a group of live photos and videos by their content-ID into numbered folders

StarGeek

Can you give an example of what this Content-ID and what you want the resulting folder name to be?  Have you figured out the tag that contains this Content-ID?

And to go off on a tangent, can you provide a small example of a Live Photo?  Say just a couple seconds of the floor.  I see questions about this on StackOverflow every so often and haven't been able to find an actual sample to examine.
* 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).

neebah

Its actually called ImageUniqueID  https://exiftool.org/TagNames/Apple.html

neebah

Actually my apologies.  It's called ContentIdentifier and is stored as a makernote in the image and a key in the video

Phil Harvey

To sort these into folders (in the current directory) based on their ContentIdentifier, you would do this:

exiftool "-directory<contentidentifier" DIR

- 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 ($).

neebah

what if I wanted to name the directory that they are stored into by the images datetimeoriginal tag


Phil Harvey

OK then, what was all this talk about ContentIdentifier?

Sorting by DateTimeOriginal is easy.  You'll find lots of examples in the forum and here.

- 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 ($).

neebah

Sorry I didn't make that clear.  Grouping the folder by ContentIdentifier, but naming the folder by the DateTimeOriginal

neebah

So let's say I got a video and image dated 2018-01-12 12:00:00 and its content id is A1234

I would like both of those files in a folder titled 2018-01-12 12:00:00 because they have the same contentID of A1234

and then continuing down the rest of the directory repeatedly placing items with matching contentID's into folder with dates for the name. 


Phil Harvey

So you are saying that the video and image have different dates, but you want to use the video date for the folder?

This can be done, but will be a bit complicated if the file names are unrelated.  Is this what you want?  How are the files named?

- 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 ($).

neebah

Image date preferably.  For the sake of brevity in the last post I just pretended that the image and video had the same date. 

Files are named IMG_0027.heic and IMG_00027.mov and similar.  I don't actually want any file renaming.  I can handle that end of it.  Just the folder grouping and naming of the folder. 


Phil Harvey

There's and extra zero in the name of the MOV file?  Maybe something like this then:

exiftool -tagsfromfile "%d%4f%-4f.heic" "-directory<createdate" -d %Y/%m/%d -ext heic -ext mov DIR

- 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 ($).