Sorting Live Photos into a separate directory by create date

Started by jjmz, October 10, 2022, 12:40:16 PM

Previous topic - Next topic

jjmz

exiftool -ee -r -if '$Duration# < 4' "-Directory<DateTimeOriginal" -d "liv/%Y-%m-%d" -ext mov -ext mp4 .

I am trying to use this to sort all the live photo MOV files into a create date based directory.. It used to work, but now with ios16 and iphone14 pro however, this does not do anything.. I saw there are some live photo tags that are supported - which would be less hacky than the above, but I am unable to figure out if there is someway to use those to achieve my objective.. Any help would be appreciated

This is what I tried for the LivePhotoInfo

exiftool -ee -r -if '$LivePhotoInfo' "-Directory<DateTimeOriginal" -d "liv/%Y-%m-%d" -ext mov -ext mp4 .

I get the following error on those files..

Warning: No writable tags set from ...

StarGeek

That response shows that there isn't a DateTimeOriginal tag in the file.

Use this command to see what other time related tags are there
exiftool -api QuickTimeUTC -time:all -G1 -a -s file.mp4

If you see another accurate time stamp, you can add that to your existing command.  Odds are that the CreateDate tag will work.  Then you could use this command

exiftool -r -api QuickTimeUTC -if '$Duration# < 4' '-Directory<CreateDate' '-Directory<DateTimeOriginal' -d 'liv/%Y-%m-%d" -ext mov -ext mp4 .

I removed the -ee (-extractEmbedded) option because it didn't do anything in this command and added the -api QuickTimeUTC option which will adjust the CreateDate from UTC to your local time zone.

The above command will use DateTimeOriginal if it exists and fall back to CreateDate if the DateTimeOriginal doesn't exist.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

jjmz

interestingly another command used to sort ALL video files by date DOES sort those files by date into directories. So I think the issue is that it is not getting Duration? and so it skips on this command, but does sort them in the command that sorts ALL video files?

Phil Harvey

You could change the -if statement to this:

-if 'not $Duration or $Duration# < 4'

This will process the files if there is no Duration tag, or Duration is less than 4 seconds.

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