Can't write keywords to multiple files

Started by J4c06r1nw1s, October 20, 2021, 10:17:11 AM

Previous topic - Next topic

J4c06r1nw1s

If I want to write keywords on a single file then it works.

exiftool -Keywords='Plex' '/volume1/homes/username/Photos/SORTED/DJI/DJI_AIR_2S/2021/09/09/Plex Versions/Optimized for TV/DJI_AIR_2S__2021-09-09_10.22.14__0009.mp4'


But with multiple files, it doesn't write the keywords. Why doesn't this work?

DIR='/volume1/homes/username/Photos/SORTED'

find $DIR -type f -name '*.mp4' -path '*/Plex Versions/*' ! -path '*/@eaDir/*' > $DIR/temp.txt

exiftool \
    -@ $DIR/temp.txt \
    -Keywords='Plex' \
    '-*Date<${FileName;s/.*(\d{4}-\d{2}-\d{2}_\d{2}.\d{2}.\d{2}).*/$1/}' -wm w \
    '-FileModifyDate<${FileName;s/.*(\d{4}-\d{2}-\d{2}_\d{2}.\d{2}.\d{2}).*/$1/}' \
    -api QuickTimeUTC \
    -overwrite_original \
    -progress

exiftool -a -s -G1 -time:all -Keywords -@ $DIR/temp.txt

rm $DIR/temp.txt
Using ExifTool v12.37 on Linux

StarGeek

In what way doesn't it work?  Is an error message thrown?

My guess is that you don't think it works because your Keywords isn't showing up in Plex.  But if you take a look at what you actually wrote to the file, you'll see that your command writes to XMP-pdf:Keywords, a PDF tag.

So this is probably FAQ #3. Find a file that already shows your keywords and run the command in FAQ #3 to see where that data is located.
* 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).

J4c06r1nw1s

It does not write a keyword tag.

exiftool -keywords -r '/volume1/homes/username/Photos/SORTED/DJI/test/DJI_AIR_2S/2021/09/09/Plex Versions/Optimized for TV' -i '@eaDir'  -ext mp4

Then it won't show any keywords.
Using ExifTool v12.37 on Linux

StarGeek

I suggest you break it down and run each command manually to see what is going wrong.  There's nothing obviously wrong with your command.
* 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).

J4c06r1nw1s

I have now rearranged the commands and now it works. :D

DIR='/volume1/homes/username/Photos/SORTED'

find $DIR -type f -name '*.mp4' -path '*/Plex Versions/*' ! -path '*/@eaDir/*' > $DIR/temp.txt

# exiftool \
#     -@ $DIR/temp.txt \
#     -Keywords='Plex' \
#     '-*Date<${FileName;s/.*(\d{4}-\d{2}-\d{2}_\d{2}.\d{2}.\d{2}).*/$1/}' -wm w \
#     '-FileModifyDate<${FileName;s/.*(\d{4}-\d{2}-\d{2}_\d{2}.\d{2}.\d{2}).*/$1/}' \
#     -api QuickTimeUTC \
#     -overwrite_original \
#     -progress

exiftool \
    '-*Date<${FileName;s/.*(\d{4}-\d{2}-\d{2}_\d{2}.\d{2}.\d{2}).*/$1/}' -wm w \
    '-FileModifyDate<${FileName;s/.*(\d{4}-\d{2}-\d{2}_\d{2}.\d{2}.\d{2}).*/$1/}' \
    -api QuickTimeUTC \
    -overwrite_original \
    -Keywords='Plex' \
    -@ $DIR/temp.txt \
    -progress

exiftool -a -s -G1 -time:all -Keywords -@ $DIR/temp.txt

rm $DIR/temp.txt
Using ExifTool v12.37 on Linux