Renaming Live photo MOV along with JPG

Started by DoubleGoodbye, July 17, 2020, 10:27:29 PM

Previous topic - Next topic

DoubleGoodbye

I know this is a common problem, and I have seen lots of discussions about it, but I cannot seem to crack the problem after many hours of trying.

Lets say I have these three files:

KM2017-1.JPG
KM2017-1.MOV
KM2017-1.XMP

I would like to rename these, based on the DateTimeOriginal in the .JPG to

2017/2017-01-01/2017-01-01_0001.JPG
2017/2017-01-01/2017-01-01_0001.MOV
2017/2017-01-01/2017-01-01_0001.XMP

So I try this:


exiftool -ext jpg -ext xmp -ext mov -d "%Y/%Y-%m-%d/%Y%m%d%%+.4nc.%%le" "-filename<DateTimeOriginal" -tagsfromfile %d%f.jpg .


And the MOV and XMP do not come along for the ride. I feel like I am just random trial and erroring now, but nothing seems to be clocking with me about what I am doing wrong.

Any assistance greatly appreciated.

StarGeek

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

DoubleGoodbye

Thanks for your response, pretty sure I have read that thread, but will give it another go.

I know have this, and pulling my hair out, as now nothing is actually happening

exiftool -ext xmp -ext mov -ext jpg -ext cr2 -ext png -ext jpeg -fileorder -FileName -d "%Y/%Y-%m-%d/%Y%m%d%%+.4nc.%%le" -TagsFromFile %d%f.jpg -TagsFromFile %d%f.jpeg -TagsFromFile %d%f.heic "-FileName<$CreateDate" .

DoubleGoodbye

I am guessing it is the way I am using tagsFromFile here. Obviously it errors as some don't exist, but I thought it would just work if at least one of them was found. But given I want the sequence to apply across all files so like this for example:

20200101_0001.jpg
20200101_0002.heic

I can't seem to find a way to do this.


StarGeek

Quote from: DoubleGoodbye on July 18, 2020, 12:10:13 AM
I am guessing it is the way I am using tagsFromFile here. Obviously it errors as some don't exist, but I thought it would just work if at least one of them was found.
Exiftool will only process one file at a time.  There is no linkage between files.  The example command you give would most likely process the files in alphabetical order, though that depends upon the file system.  As such, it would try to process jpgs before it processed the MOV and XMP files.  But since those two rely upon the date in the jpg file, they will fail because the jpg has already been moved.

The link I gave shows the example of using the -FileOrder option to reverse the sort order of the files, so the XMP and MOV get processed first before the jpg, so they can read the data from the jpg

QuoteBut given I want the sequence to apply across all files so like this for example:

20200101_0001.jpg
20200101_0002.heic

I can't seem to find a way to do this.

I'm not quite sure what you mean by this.  Those files have different names.  Exiftool can't really connect those without a lot of work.

There is one big mistake with your second command
-TagsFromFile %d%f.jpg -TagsFromFile %d%f.jpeg -TagsFromFile %d%f.heic "-FileName<$CreateDate"

One key statement from the docs on the -TagsFromFile option
     If no tags are specified, then all possible tags (see note 1 below) from the source file are copied to same-named tags in the preferred location of the output file
The result is that exiftool will first look for the file specified by %d%f.jpg.  Because no tags are listed, it will try to copy ALL tags from that file if it exists.  It will then attempt the same with %d%f.jpeg.  Finally, it gets to %d%f.heic.  Here, a tag copy is specified and it will try to rename the current file based upon the CreateDate in the matching heic file.

I believe what you want would actually be
-TagsFromFile %d%f.jpg "-FileName<$CreateDate" -TagsFromFile %d%f.jpeg "-FileName<$CreateDate" -TagsFromFile %d%f.heic "-FileName<$CreateDate"
Since these are all trying to copy to the Filename pseudo-tag, only the last, valid option will be processed.  So in this example, copying from the heic has the highest precedent.  If that file doesn't exist, then the .jpeg file will be used.  If that doesn't exist, the the .jpg file will be used.

If you have heic files and jpg files with the same base name, then you need to be aware of the precedence order so that you don't rename the file you want to copy the data from before the other files.
* 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).