Copying metadata, one to many, that starts with the same filename

Started by peho, July 27, 2019, 02:41:06 PM

Previous topic - Next topic

peho

I've tried a lot of options but failed.
Is it possible to copy from a file that starts with for '2019-07-01-12-12-12.mp4' to all JPG that starts with that filename.
For instance:
From:
'2019-07-01-12-12-12.mp4'
To:
'2019-07-19 12-07-54.MP4-00.00.08.741.jpeg'
'2019-07-19 12-07-54.MP4-00.00.09.741.jpeg'
'2019-07-19 12-07-54.MP4-00.00.11.741.jpeg'
'2019-07-19 12-07-54.MP4-00.00.12.741.jpeg'

OR

'2019-07-01-12-12-12.mp4'
To:
'2019-07-19 12-07-54-aaa.jpeg'
'2019-07-19 12-07-54-bbb.jpeg'
'2019-07-19 12-07-54-ccc.jpeg'
'2019-07-19 12-07-54-ddddd.jpeg'

StarGeek

Is there a mistake in your example?  You are copying from 2019-07-01-12-12-12.mp4 to 2019-07-19 12-07-54.MP4-00.00.08.741.jpeg.  Different day, minute and second, as well as replacing a dash with a space in the jpg name.

This can be done with the -TagsFromFile option, but it's hard to give you more help without verifying that your example is correct or not.
* 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).

peho

Sorry, yes, there was a mistake.


From:
'2019-07-19 12-07-54.mp4'
To:
'2019-07-19 12-07-54.MP4-00.00.08.741.jpeg'
'2019-07-19 12-07-54.MP4-00.00.09.741.jpeg'
'2019-07-19 12-07-54.MP4-00.00.11.741.jpeg'
'2019-07-19 12-07-54.MP4-00.00.12.741.jpeg'

OR

'2019-07-19 12-07-54.mp4'
To:
'2019-07-19 12-07-54-aaa.jpeg'
'2019-07-19 12-07-54-bbb.jpeg'
'2019-07-19 12-07-54-ccc.jpeg'
'2019-07-19 12-07-54-ddddd.jpeg'

StarGeek

Assuming that the jpegs are in the same directory as the MP4, your command would be something like
exfitool -ext jpeg -TagsFromFile %d%19f.mp4 -TAG1 -TAG2 /path/to/jpegs

The %19f part takes the first 19 characters from the jpg currently being processed to be used as the source filename for the MP4.

If the MP4 is in a different directory, replace %d with the path to that directory.  Replace TAG1, TAG2 with the actual tag names you wish to copy.  If you just what exiftool to copy what it can, then remove that part.  Understand though that there usually isn't a direct correlation between video tags and image tags.  You may have to redirect the specific video tags into specific image tags, e.g. "-IMAGETAG<VIDEOTAG"
* 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).

peho