Copying a Live Photo still, and its accompanying mov

Started by bodacious, November 17, 2019, 05:49:58 PM

Previous topic - Next topic

StarGeek

Sorry I didn't give an example for the -FileOrder option.  That option needs a tag name to sort on. Additionally, the sort needs to be reversed so that HEIC/Jpg files are processed after the mov files, which is done by adding a dash before the tag name.
exiftool -fileorder -filename -tagsfromfile %d%f.HEIC <OtherCommandsHere> /path/to/files/

Replace the <OtherCommandsHere> with your actual rename commands.

* 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).

Rowan1002

Ok great, about to run that command, just before I do...

To check - that command will sort out the HEIC files, and then do I run the identical command (replacing the .HEIC with .JPG) after this command has completed to pick up the JPG's ?

StarGeek

That would be best.  While it's possible to combine the two, it makes it more complex.  Better to keep it simple.

Make sure and test with TestName first.
* 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).

Rowan1002

Ok, so I ran the below:

exiftool -fileorder -filename -tagsfromfile %d%f.HEIC -d '%Y%m%d-%H%M%S%%-03.c.%%e' /Users/james/Pictures/2019\ Revised

Result: 

- The files names have not changed.
- There is now a duplicate HEIC and MOV for each file in the folder.
- The weirdest thing is that all of the MOV files are rotated upside down?

Result Extract:

1 directories scanned
7696 image files updated
2508 image files unchanged

Extract Example:

Rowans-MBP:~ james$ exiftool -a -G1 -s -time:all /Users/james/Pictures/2019\ Originals/IMG\ -\ 6959.HEIC /Users/james/Pictures/2019\ Originals/IMG\ -\ 6959.mov
======== /Users/james/Pictures/2019 Originals/IMG - 6959.HEIC
[System]        FileModifyDate                  : 2020:01:18 15:52:42+00:00
[System]        FileAccessDate                  : 2020:05:27 21:50:55+01:00
[System]        FileInodeChangeDate             : 2020:05:27 17:48:17+01:00
[IFD0]          ModifyDate                      : 2019:07:01 09:13:16
[ExifIFD]       DateTimeOriginal                : 2019:07:01 09:13:16
[ExifIFD]       CreateDate                      : 2019:07:01 09:13:16
[ExifIFD]       SubSecTimeOriginal              : 266
[ExifIFD]       SubSecTimeDigitized             : 266
[GPS]           GPSTimeStamp                    : 08:13:09.94
[GPS]           GPSDateStamp                    : 2019:07:01
[ICC-header]    ProfileDateTime                 : 2017:07:07 13:22:32
[ICC-header2]   ProfileDateTime                 : 2017:07:07 13:22:32
[Composite]     SubSecCreateDate                : 2019:07:01 09:13:16.266
[Composite]     SubSecDateTimeOriginal          : 2019:07:01 09:13:16.266
[Composite]     GPSDateTime                     : 2019:07:01 08:13:09.94Z
======== /Users/james/Pictures/2019 Originals/IMG - 6959.mov
[System]        FileModifyDate                  : 2020:01:18 15:52:42+00:00
[System]        FileAccessDate                  : 2020:01:18 15:52:42+00:00
[System]        FileInodeChangeDate             : 2020:05:27 17:48:17+01:00
[QuickTime]     CreateDate                      : 2019:07:01 08:13:15
[QuickTime]     ModifyDate                      : 2019:07:01 08:13:17
[Track1]        TrackCreateDate                 : 2019:07:01 08:13:15
[Track1]        TrackModifyDate                 : 2019:07:01 08:13:17
[Track1]        MediaCreateDate                 : 2019:07:01 08:13:15
[Track1]        MediaModifyDate                 : 2019:07:01 08:13:17
[Track2]        TrackCreateDate                 : 2019:07:01 08:13:15
[Track2]        TrackModifyDate                 : 2019:07:01 08:13:17
[Track2]        MediaCreateDate                 : 2019:07:01 08:13:15
[Track2]        MediaModifyDate                 : 2019:07:01 08:13:17
[Track3]        TrackCreateDate                 : 2019:07:01 08:13:15
[Track3]        TrackModifyDate                 : 2019:07:01 08:13:17
[Track3]        MediaCreateDate                 : 2019:07:01 08:13:15
[Track3]        MediaModifyDate                 : 2019:07:01 08:13:17
[Track4]        TrackCreateDate                 : 2019:07:01 08:13:15
[Track4]        TrackModifyDate                 : 2019:07:01 08:13:17
[Track4]        MediaCreateDate                 : 2019:07:01 08:13:15
[Track4]        MediaModifyDate                 : 2019:07:01 08:13:17
[Keys]          CreationDate                    : 2019:07:01 09:13:15+01:00
    2 image files read
Rowans-MBP:~ james$ exiftool -a -G1 -s -time:all /Users/james/Pictures/2019\ Revised/IMG\ -\ 6959.HEIC /Users/james/Pictures/2019\ Revised/IMG\ -\ 6959.HEIC_original /Users/james/Pictures/2019\ Revised/IMG\ -\ 6959.mov /Users/james/Pictures/2019\ Revised/IMG\ -\ 6959.mov_original
======== /Users/james/Pictures/2019 Revised/IMG - 6959.HEIC
[System]        FileModifyDate                  : 2020:05:27 20:03:27+01:00
[System]        FileAccessDate                  : 2020:05:27 21:51:19+01:00
[System]        FileInodeChangeDate             : 2020:05:27 20:03:27+01:00
[IFD0]          ModifyDate                      : 2019:07:01 09:13:16
[ExifIFD]       DateTimeOriginal                : 2019:07:01 09:13:16
[ExifIFD]       CreateDate                      : 2019:07:01 09:13:16
[GPS]           GPSTimeStamp                    : 08:13:09.94
[GPS]           GPSDateStamp                    : 2019:07:01
[XMP-exif]      DateTimeOriginal                : 2019:07:01 09:13:16
[XMP-exif]      GPSDateTime                     : 2019:07:01 08:13:09
[XMP-xmp]       CreateDate                      : 2019:07:01 09:13:16
[XMP-xmp]       ModifyDate                      : 2019:07:01 09:13:16
[ICC-header]    ProfileDateTime                 : 2017:07:07 13:22:32
[ICC-header2]   ProfileDateTime                 : 2017:07:07 13:22:32
[Composite]     GPSDateTime                     : 2019:07:01 08:13:09.94Z
======== /Users/james/Pictures/2019 Revised/IMG - 6959.HEIC_original
[System]        FileModifyDate                  : 2020:01:18 15:52:42+00:00
[System]        FileAccessDate                  : 2020:05:27 21:51:30+01:00
[System]        FileInodeChangeDate             : 2020:05:27 20:03:27+01:00
[IFD0]          ModifyDate                      : 2019:07:01 09:13:16
[ExifIFD]       DateTimeOriginal                : 2019:07:01 09:13:16
[ExifIFD]       CreateDate                      : 2019:07:01 09:13:16
[ExifIFD]       SubSecTimeOriginal              : 266
[ExifIFD]       SubSecTimeDigitized             : 266
[GPS]           GPSTimeStamp                    : 08:13:09.94
[GPS]           GPSDateStamp                    : 2019:07:01
[ICC-header]    ProfileDateTime                 : 2017:07:07 13:22:32
[ICC-header2]   ProfileDateTime                 : 2017:07:07 13:22:32
[Composite]     SubSecCreateDate                : 2019:07:01 09:13:16.266
[Composite]     SubSecDateTimeOriginal          : 2019:07:01 09:13:16.266
[Composite]     GPSDateTime                     : 2019:07:01 08:13:09.94Z
======== /Users/james/Pictures/2019 Revised/IMG - 6959.mov
[System]        FileModifyDate                  : 2020:05:27 20:03:26+01:00
[System]        FileAccessDate                  : 2020:05:27 21:51:19+01:00
[System]        FileInodeChangeDate             : 2020:05:27 20:03:26+01:00
[QuickTime]     CreateDate                      : 2019:07:01 09:13:16
[QuickTime]     ModifyDate                      : 2019:07:01 09:13:16
[Track1]        TrackCreateDate                 : 2019:07:01 08:13:15
[Track1]        TrackModifyDate                 : 2019:07:01 08:13:17
[Track1]        MediaCreateDate                 : 2019:07:01 08:13:15
[Track1]        MediaModifyDate                 : 2019:07:01 08:13:17
[Track2]        TrackCreateDate                 : 2019:07:01 08:13:15
[Track2]        TrackModifyDate                 : 2019:07:01 08:13:17
[Track2]        MediaCreateDate                 : 2019:07:01 08:13:15
[Track2]        MediaModifyDate                 : 2019:07:01 08:13:17
[Track3]        TrackCreateDate                 : 2019:07:01 08:13:15
[Track3]        TrackModifyDate                 : 2019:07:01 08:13:17
[Track3]        MediaCreateDate                 : 2019:07:01 08:13:15
[Track3]        MediaModifyDate                 : 2019:07:01 08:13:17
[Track4]        TrackCreateDate                 : 2019:07:01 08:13:15
[Track4]        TrackModifyDate                 : 2019:07:01 08:13:17
[Track4]        MediaCreateDate                 : 2019:07:01 08:13:15
[Track4]        MediaModifyDate                 : 2019:07:01 08:13:17
[Keys]          CreationDate                    : 2019:07:01 09:13:15+01:00
[XMP-exif]      DateTimeOriginal                : 2019:07:01 09:13:16
[XMP-exif]      GPSDateTime                     : 2019:07:01 08:13:09
[XMP-xmp]       CreateDate                      : 2019:07:01 09:13:16
[XMP-xmp]       ModifyDate                      : 2019:07:01 09:13:16
[UserData]      DateTimeOriginal                : 2019:07:01 09:13:16
======== /Users/james/Pictures/2019 Revised/IMG - 6959.mov_original
[System]        FileModifyDate                  : 2020:01:18 15:52:42+00:00
[System]        FileAccessDate                  : 2020:05:27 21:51:18+01:00
[System]        FileInodeChangeDate             : 2020:05:27 20:03:26+01:00
[QuickTime]     CreateDate                      : 2019:07:01 08:13:15
[QuickTime]     ModifyDate                      : 2019:07:01 08:13:17
[Track1]        TrackCreateDate                 : 2019:07:01 08:13:15
[Track1]        TrackModifyDate                 : 2019:07:01 08:13:17
[Track1]        MediaCreateDate                 : 2019:07:01 08:13:15
[Track1]        MediaModifyDate                 : 2019:07:01 08:13:17
[Track2]        TrackCreateDate                 : 2019:07:01 08:13:15
[Track2]        TrackModifyDate                 : 2019:07:01 08:13:17
[Track2]        MediaCreateDate                 : 2019:07:01 08:13:15
[Track2]        MediaModifyDate                 : 2019:07:01 08:13:17
[Track3]        TrackCreateDate                 : 2019:07:01 08:13:15
[Track3]        TrackModifyDate                 : 2019:07:01 08:13:17
[Track3]        MediaCreateDate                 : 2019:07:01 08:13:15
[Track3]        MediaModifyDate                 : 2019:07:01 08:13:17
[Track4]        TrackCreateDate                 : 2019:07:01 08:13:15
[Track4]        TrackModifyDate                 : 2019:07:01 08:13:17
[Track4]        MediaCreateDate                 : 2019:07:01 08:13:15
[Track4]        MediaModifyDate                 : 2019:07:01 08:13:17
[Keys]          CreationDate                    : 2019:07:01 09:13:15+01:00
    4 image files read

StarGeek

Quote from: Rowan1002 on May 27, 2020, 05:04:32 PM
Ok, so I ran the below:

exiftool -fileorder -filename -tagsfromfile %d%f.HEIC -d '%Y%m%d-%H%M%S%%-03.c.%%e' /Users/james/Pictures/2019\ Revised

Uh, all you did here was copy ALL data from the HEIC files to the any file with a matching name.  Weren't you trying to rename files? You dropped the renaming part listed earlier.

Run
exiftool -restore_original /Users/james/Pictures/2019\ Revised
to restore from the _original files, which I believe are the duplicate files you mention.
* 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).

Rowan1002

#20
Oh man!

Ok I'm with you, will run the following command:

exiftool -fileorder -filename -tagsfromfile %d%f.HEIC -overwrite_original -d '%Y%m%d-%H%M%S%%-03.c.%%e' '-filename<CreateDate' DIR

Update:

Ran on 2 files, a HEIC files and associated MOV file (a live photos which have different date stamp due to time zone)

Seems to have worked, the HEIC and MOV are now dated and named the same. Will now run a similar command to pick up any JPG files with the same issues.

Rowan1002

#21
Ok so it looks to have worked, but just double checking at the moment. The steps I had to run are below.

StarGeek - what I have done seems a bit long winded, but maybe it's correct? Do you think I have carried out the right steps? I need to do this for like 50,000+ photos in different folders so if there's a way to make it simpler or merge commands (without it getting too complicated) that would be great - if not, I can go with these steps..

Step 1 (replace date in MOV file to that of the HEIC file with the same name, and then rename the files to the createdate stamp).

exiftool -fileorder -filename -tagsfromfile %d%f.HEIC -overwrite_original -d '%Y%m%d-%H%M%S%%-03.c.%%e' '-filename<CreateDate' DIR

Step 2 (replace date in MOV file to that of the JPG file with the same name, and then rename the files to the createdate stamp).

exiftool -fileorder -filename -tagsfromfile %d%f.JPG -overwrite_original -d '%Y%m%d-%H%M%S%%-03.c.%%e' '-filename<CreateDate' DIR

Step 3 - PNG Files (give them a Create Date)

PGN files have a datecreated tag and not a createdate tag. So before we can rename the files with a create date, we need to give the PGN file a create date using the below:

exiftool -if '$filetype eq "PNG"' '-createdate<datecreated' DIR

Should have added -overwrite_original, as when I ran this I got loads of duplicates.

Step 4 - Give JPG's with no MOV associated (ie. a JPG that was not a Live Photo) a create date if they do not have one, so that when we rename to Create Date, they get renamed too.

There are some JPG's that do not have a associated Mov and have no create date - they look like images received on WhatsApp. Therefore we need to use the tag in the file 'filemodifydate' to create a 'createdate' with the below which will then work for the name change.

exiftool -if 'not $createdate' '-createdate<filemodifydate' -P

Should have added -overwrite_original, as when I ran this I got loads of duplicates.

Step 5 - Rename for rest of files (HEIC and MOV already renamed by Step 1)

Really only want the below rename to pick up JPG'S and PNG's as we have already renamed the HEIC and MOV files...but ran on the whole directory.

exiftool -d '%Y%m%d-%H%M%S%%-03.c.%%e' '-filename<CreateDate' DIR

Note - one final note is, when you extract Photos (Unmodified Originals) from Mac Photos app, it seems that photos taken on Iphone in Portrait mode get extracted with an associated AAE Sidecar file - not sure what it does / it's purpose but just for reference. I have just deleted those and it seems like it doesn't affect the main picture file in any way

Rowan1002

#22
Hi,

Argh - I'm stuck again!

So Step 5 actually messes up what step 1 and 2 did.

Step 1 and Step 2 made all the HEIC (or JPG) and MOV files from a Live Photo get the same create data as eachother, and the file name of both became the same, which is the create date. Which was exactly as I wanted.

However, Step 5 messes it up and then they separate out again...and the HEIC and MOV are named based on their timezone again!

But I do need Step 5 because after the previous Step 1 and Step 2 sort the HEIC and Mov files out, Step 3 and 4 sort out the PGN and JPG files which are not related to Live Photos.

After Step 3 and Step 4, they then need renaming to their new CreateDate's....

Thanks, R

Rowan1002


StarGeek

Sorry, but I can't really comment on your problem except what I mentioned about the -api QuickTimeUTC option.  I believe that HEIC files store the date as UTC, but exiftool will extract the time as if the -api QuickTimeUTC was used.  MOV files will extract as UTC unless that option is used.
* 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).