News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Add keywords from CSV to MOV-files

Started by Fulco, March 15, 2015, 08:43:49 AM

Previous topic - Next topic

Fulco

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

Phil Harvey

Hi Fulco,

You are writing XMP metadata to the MOV file, so you must limit yourself to the available XMP tags.  Instead of Keywords, use XMP-dc Subject.

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

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Fulco

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.

Fulco

I mean this command: exiftool -sep ", " -keywords="Keyword1, Keyword2"  -sep ", " -subject="Keyword1, Keyword2"

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Fulco

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.

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Fulco

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