When you’re integrating Final Cut Server with other products, you often find yourself writing scripts to perform various tasks. One of those tasks might be to create a new project, or a production as it’s called in Final Cut Server. Because a production can have a number of attributes, a great way to do this is to create a template production and then make copies of it (or clones) when you want to create subsequent projects. To do so, you’ll use the fcsvr_client command, along with the clone verb. The -name option will allow you to set the name of the production which would then be followed by the unique ID of the production template that you manually create using the Final Cut Server application. Presuming we are creating a production called Emerald with a template of /project/298, we could use the following:
fcsvr_client clone –name Emerald /project/298
If we wanted to get the ID of this project, we would then use:
fcsvr_client search –crit Emerald /project
We could then go a step further and actually create an asset in this new project by using the –projaddr option for createasset. In the below example, we’ll presume that the new project ID was 299 and then create an asset called Emerald1.mov that is stored on a device with an ID of 5 as well as provide a description and a tag:
fcsvr_client createasset –background –projaddr /project/299 pa_asset_media /dev/5/Emerald1.mov CUST_DESCRIPTION=”Emerald throwing food at daddy” CUST_KEYWORDS=”food fight”
Now to throw it all together in a little script that could be fired off through another application that can be kicked off from another application. In the below, we assume that it is a bash script that was handed a project name via $1, a device ID in $2 and a file name in $3:
#!/bin/bash
fcsvr_client clone –name $1 /project/298
MyProjectID = fcsvr_client search –crit “$1” /project
/usr/bin/logger “Production $MyProjectID with name of $1 created”
fcsvr_client createasset –background –projaddr /project/$MyProjectID pa_asset_media /dev/$2/$3 CUST_DESCRIPTION=”Automatically uploaded file” CUST_KEYWORDS=”movie, automated”
/usr/bin/logger “Asset $3 on device $2 created in production $1”
If we had just wanted to create the asset, we could have simply used line 5, placing the Project ID in $1 by changing out $MyProjectID with $1. We could also use Transmogrifier to easily return the assetID once it has been created in Final Cut Server, allowing that to be returned to the application that might be calling up this script. This allows you to integrate the asset and production creation part of Final Cut Server with other solutions, such as a PHP web upload application, FileMaker or even another Digital Asset Management solutions.