ExifTool Forum

ExifTool => Newbies => Topic started by: Fulco on March 15, 2015, 08:43:49 AM

Title: Add keywords from CSV to MOV-files
Post by: Fulco on March 15, 2015, 08:43:49 AM
I am trying to import keywords into about 300 video files using a simple csv file that has several fields. I searched on the forum, but I could not find find an answer.

I managed to import GPS data to a group of MOV-files with this command line: exiftool -csv=Photo GPS.csv -overwrite_original -P DIR

The cvs file has this format:
First row: SourceFile,GPSLatitude,GPSLatitudeRef,GPSLongitude,GPSLongitudeRef
Rows with information: /Users/Fulco/Pictures/Video1.mov,52.372824' N ,North,4.893709' W ,East

But if I add a column of keywords exiftool does not write any of the data to the associated files. Exiftool returns the message "No SourceFile".

I use this format:
First row: SourceFile,Keywords,GPSLatitude,GPSLatitudeRef,GPSLongitude,GPSLongitudeRef;
Rows with information: Users/Fulco/Pictures/Video1.mov,"Keyword1, Keyword2, Keyword3",52.372824' N ,North,4.893709' W ,East

I use this command:
exiftool -csv=Photo keywords and GPS.csv -sep ", " -overwrite_original -P DIR

I tried it several times, but it didn't work. I would appreciate any help.

Fulco
The Netherlands
Title: Re: Add keywords from CSV to MOV-files
Post by: Phil Harvey on March 15, 2015, 09:05:48 AM
Hi Fulco,

You are writing XMP metadata to the MOV file, so you must limit yourself to the available XMP tags (https://exiftool.org/TagNames/XMP.html).  Instead of Keywords, use XMP-dc Subject.

Also, in your command you should have quotes around the file name if it contains spaces.

- Phil
Title: Re: Add keywords from CSV to MOV-files
Post by: Fulco on March 15, 2015, 10:20:23 AM
Hello Phil,

Thanks for your answer. I forgot to say in my first post that the same applies to JPG files. Do I have to use XMP-dc Subject as well?

When I use this command the keywords and subject will be embedded in MOV and JPG files: exiftool -sep ", " -keywords="Keyword1, Keyword2"  -sep ", " -keywords="Keyword1, Keyword2". What I understand now is that importing metadata from a csv file is only possible with XMP-dc Subject.

I changed SourceFile,Keywords,GPSLatitude,GPSLatitudeRef,GPSLongitude,GPSLongitudeRef into SourceFile,Subject,... but it didn't work.
Title: Re: Add keywords from CSV to MOV-files
Post by: Fulco on March 15, 2015, 10:22:58 AM
I mean this command: exiftool -sep ", " -keywords="Keyword1, Keyword2"  -sep ", " -subject="Keyword1, Keyword2"
Title: Re: Add keywords from CSV to MOV-files
Post by: Phil Harvey on March 15, 2015, 02:15:14 PM
You can import any type of metadata from CSV.

Please give more details than just "It doesn't work".  I have made my best guess about what you mean by this, but apparently there is something else wrong.

- Phil
Title: Re: Add keywords from CSV to MOV-files
Post by: Fulco on March 15, 2015, 03:52:02 PM
I only changed the column with the tag name Keywords into Subject:

SourceFile,Subject,GPSLatitude,GPSLatitudeRef,GPSLongitude,GPSLongitudeRef
/Users/Fulco/Pictures/Photo1.JPG,"Keyword1, Keyword2, Keyword3",52.372824' N ,North,4.893709' W ,East

I used this command:

exiftool -csv=/Users/Fulco/Pictures/GPS_Subject.csv -sep ", " -overwrite_original -P /Users/Fulco/Pictures

I attached the csv file. I appreciate if you can have a look at it.
Title: Re: Add keywords from CSV to MOV-files
Post by: Phil Harvey on March 16, 2015, 08:49:29 AM
The first line of your CSV file is:

"/Users/Fulco/Pictures/Photo1.JPG,""Keyword1, Keyword2, Keyword3"",52.372824' N ,North,4.893709' W ,East"

The quotes are all wrong.  It should look something like this this:

"/Users/Fulco/Pictures/Photo1.JPG","Keyword1, Keyword2, Keyword3","52.372824' N","North","4.893709' W","East"

- Phil
Title: Re: Add keywords from CSV to MOV-files
Post by: Fulco on March 17, 2015, 09:27:07 AM
When I store the text below in a txt file (UTF-8) than it works. Thanks for your help!

SourceFile,Subject,GPSLatitude,GPSLatitudeRef,GPSLongitude,GPSLongitudeRef
/Users/Fulco/Pictures/Video1.MOV,"Keyword1, Keyword2",52.372824,North,4.893709,East
/Users/Fulco/Pictures/Video2.MOV,"Keyword1, Keyword2",48.858391,North,2.294144,East