Carlpedia
Child pages
  • Exif Metadata Extraction Tool

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Table of Contents

 

In the Archives we use ExifTool by Phil Harvey to extract tagged metadata from file, particularly images.

Software:

http://www.sno.phy.queensu.ca/~phil/exiftool/

Documentation:

http://www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html

Example of syntax:

exiftool -csv -r /Users/nwilson/Desktop/20120430_3_publicationsphotos_2001 > /Users/nwilson/Desktop/20120430_3_publicationsphotos_2001/meta/metadata.csv

  • Writes a csv file of all tagged metadata, recursively going through all of Users/nwilson/Desktop/20120430_3_publicationsphotos_2001 and writing that information to /Users/nwilson/Desktop/20120430_3_publicationsphotos_2001/meta/metadata.csv

exiftool -X /Volumes/ARCHIVES/SIPS/1-unprocessed/20120605_HonorsCompsTheater2012/THE_TEMPEST_10_27_2011.mp4 > /Users/nwilson/Desktop/metadata.xml 

  • Writes an XML file of all tagged metadata non-recursively for THE_TEMPEST_10_27_2011.mp4 and writes the results to metadata.xml.

exiftool -r -X /Volumes/ARCHIVES/SIPS/11-Bagit/20120429_NoonNewsBulletinSamples1996 > /Volumes/ARCHIVES/SIPS/11-Bagit/20120429_NoonNewsBulletinSamples1996/meta/exif.xml

  • Writes and XML file of all tagged metadata recursively for 20120429_NoonNewsBulletinSamples1996 and writes the result to a new xml file in /Volumes/ARCHIVES/SIPS/11-Bagit/20120429_NoonNewsBulletinSamples1996/meta/exif.xml

exiftool -r -X /Volumes/ARCHIVES/SIPS/11-Bagit/20120429_NoonNewsBulletinSamples1996 > /Volumes/ARCHIVES/SIPS/11-Bagit/20120429_NoonNewsBulletinSamples1996/meta/exif.xml ; exiftool -X /Volumes/ARCHIVES/SIPS/1-unprocessed/20120605_HonorsCompsTheater2012/THE_TEMPEST_10_27_2011.mp4 > /Users/nwilson/Desktop/metadata.xml

  • Writes an XML file first for all files in the 20120429_NoonNewsBulletinSamples1996 directory, and then an XML file for THE_TEMPEST_10_27_2011.mp4.  The ";" separator allows you to run a series of commands.  For more information on different conditions you can apply see: http://www.comptechdoc.org/os/linux/manual2/runningcommands.html

Batch Processing - Setup and Running

Creates a batch process for extracting metadata on a series of directories and those directory contents.  Note: All directories to be processed must be in the same directory.  

ExifTool will create 2 output files named "exif.xml" and "exif.csv" and place them in a folder called "meta" in the directory being processed.  If no meta directory is present, the script will make one.

Setup

Open a terminal by going to Applications/Utilities/Terminal

Open bash_profile by typing "nano ~/.bash_profile"

Paste in the following text:

exifbatch()
{
echo "----------------------"
echo "Extracting tagged metadata for all directories in "$1"."
echo "----------------------"
for dir in "$1"/*; do

if test -d "$dir"; then

if test ! -d "$dir"/meta; then

echo "----------------------"

echo "No 'meta' subdirectory exists in "$dir". Creating a 'meta' directory in "$$

echo "----------------------"

mkdir "$dir"/meta

fi

echo "----------------------"
echo "Extracting tagged metadata from "$dir" and writing results to "$dir"/meta/exif.xml."
echo "----------------------"
exiftool -r -X "$dir" > "$dir"/meta/exif.xml
exiftool -csv -r "$dir" > "$dir"/meta/exif.csv
fi

done

echo "----------------------"
echo "Tagged metadata extraction complete."
echo "----------------------"
}

Hit Control O and Return to write your changes.  

Hit Control X to exit.

Close and restart the terminal.

Running

Enter in the terminal "exifbatch PATHTODIRECTORY"

Every directory in the PATHTODIRECTORY you gave will each be bagged up one after the other.