Hot Folder Script: Apply XML Metadata to ingested Video Assets

This tutorial walks you through a sample Perl script running on a hot folder on a Linux server. You can apply similar concepts to write scripts that run on a Windows Server. In fact, if you install Cygwin on the Windows Server, you could even run a Perl script directly on Windows, if you prefer Perl as the scripting language. But, there is no restriction in Zoom about which programming language to use.

Purpose: Parse a CatDV XML file containing metadata per video (QuickTime MOV) file, ingest the QuickTime MOV files in the Hot Folder, while applying the metadata from a corresponding XML to each Video file. After import, delete all the files including the metadata

A full copy of the Perl script can be downloaded from here. To add this script to the Hot Folder configuration, you must use the parent BASH Script that executes the Perl script.

Line 37: read the list of files in the $HOT_FOLDER directory

Line 44: Create a Zoom parse-able metadata file in a TAB delimited format. The multiple XML metadata files will be converted into this single TAB delimited file latter.

Line 57: Parse the metadata in the incoming XML file as follows:

Line 108: We first look for the MOV file by ignoring any .XML file we find

Line 128: Once we find a non-XML file to import, we check if a corresponding file with a .XML extension exists in the Hot Folder. For e.g., if the MOV file is history-world.mov, then the XML file we look for would be history-world.xml

Line 131: We invoke an XML reader to read the metadata from the XML file.

Line 167: Write the metadata header line with TAB delimited column names

Line 173: Converts each XML property to a TAB delimited value.

 For example from the above XML, the BTCX60-000203.mov and BTCX60-000307.mov  will be ingested with metadata applied as following:

NAME TAPE IN OUT DURATION TIMECODE BIN TYPE CATALOG POSTER…
BTCX60-000203.mov 001 9:20:23;00 9:49:24;03 0:29:01;03 29.97 Usuario1 BTX DV Movie/Clip CATALOGO FINAL ther/whofol/BTCX60-000203.mov/9_32_49_25.jpg..
BTCX60-000307.mov 002 6:20:23;00 6:32:14;01 0:29:01;03 29.97 Usuario1 BTX DV Movie/Clip CATALOGO FINAL ther/whofol/BTCX60-000307.mov/6_27_49_25.jpg…

 

The above Tab delimited file is parse-able by the Zoom import command.

Line 72: The Zoom import command with the -mf option to read the metadata along with the MOV files to ingested.

Line 85: Run the Zoom import command

As mentioned earlier, a full copy of the Perl script can be downloaded from here. To add this script to the Hot Folder configuration, you must use the parent BASH Script that executes the Perl script.

 

Leave a Comment