Read metadata and write it to XMP plus correct rec time with just one command

Started by Wladimir, October 06, 2021, 11:11:08 AM

Previous topic - Next topic

Wladimir

For my testing i used ExifToolGUI and in this the feature ExifTool Direct, where you can enter a command and run it.
I will try it with CMD. Thanks for the hint!

Regards, Wladimir

Wladimir

Unfortunately, when I do it with CMD, it's the same. The commands are executed again and again, although the "Exiftool" tag already exists.

StarGeek

Quote from: Wladimir on November 01, 2021, 01:09:33 PM
During the test there was only one video file in the folder and there are no sub-folders in this folder. The output was a bit confusing:

======== C:/Downloads/Folder/USA_Test/20170813_111724.mp4
======== C:/Downloads/Folder/USA_Test/20170813_111724.mp4
======== ./20170813_111724.mp4
    2 directories scanned
    3 image files updated
    2 directories scanned
    3 image files updated
Error: File not found - exiftool
<-END-

The message "Error: File not found - exiftool" is also confusing, as there is only one file in this folder and it has also been processed.

If you're using the exiftool GUI direct feature, you don't need to put exiftool in there.  What you are doing when you do that is running the command
exiftool -if "$-xmp:subject!~/Exiftool/i" "-alldates<filename" exiftool
In other words, you're telling exiftool to process exiftool as if it was a image/video.

Also, the output would be accurate.  From the docs on the -execute option
     The result is as if the commands were executed as separate command lines
Each subsequent -execute runs exiftool again, resulting in separate output.

Quote from: Wladimir on November 01, 2021, 01:09:33 PM
So my idea was to add a specific keyword, or in case of video a xmp-subject "Exiftool" after first execution of the command. And if next time this xmp-subject is present, then the command will not be executed again.

exiftool -if "$-xmp:subject!~/Exiftool/i" "-alldates<filename" -execute -if "$-xmp:subject!~/Exiftool/i" "-xmp:GPSLongitude<GPSLongitude" "-xmp:GPSLatitude<GPSLatitude" -execute -if "$-xmp:subject!~/Exiftool/i" "-xmp:subject+=Exiftool" -common_args -overwrite_original C:\Path\To\Folder\ -r -ext mp4 -fast2

I hate when I stare and stare at a command trying to figure it out, go off and test, and then I finally see the problem I should have saw the first time I looked.  Your -if statement is will never be true because you're checking against a tag called -xmp:subject] (leading hyphen) instead of xmp:subject.  It should be -if "$xmp:subject!~/Exiftool/i"
"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

Wladimir

THANKS VERY MUCH!! You are my hero! Now it works perfectly. Now I can prepare my videos perfectly for the photo / video server.

Regards, Wladimir