Shell Commands for Submitting Compressor Jobs

You can run the Compressor application from the command line using the Compressor command, with a number of command-line options for submitting jobs.

In the command-line descriptions below, angle brackets < > indicate a mandatory argument in a command, and brackets [ ] indicate an optional argument.

Synopsis

Below is a synopsis of the command for submitting a job to a cluster. The Compressor command is located in /Applications/Compressor.app/Contents/MacOS/.

Compressor [‑clustername <name>][‑clusterid <username:password@ipaddress:portNumber>] [‑batchfilepath <path>] [‑batchname <batchname>] [‑priority <value>] [‑jobpath <path>] [‑settingpath <path>] [‑destinationpath <path>] [‑info <xml>] [‑timeout <seconds>] [‑help] [‑show]

In this example, ‑jobpath, ‑settingpath, and ‑destinationpath, in that order, can be repeated as many times as the number of jobs you want to submit.

Note: Not all the options are necessary. For example, you can specify the cluster either by its ‑clustername or by its ‑clusterid. You do not need to specify both. If both are specified, only ‑clusterid is used.

Additionally, if you specify ‑batchfilepath, then ‑jobpath, ‑settingpath, and ‑destinationpath are not necessary because the previously saved batch file already contains information about the job, settings, and destination.

Example of ‑batchfilepath:

Compressor ‑clustername "This Computer" ‑batchfilepath "/Volumes/Hermione/SavedCompressorBatches/FreeChampagne.compressor"

Once the job is submitted successfully, this command displays the batch ID (identifier) and job ID (identifier) in the shell, and you can monitor the progress of a batch in Share Monitor.

Command Options

This table provides information about each of the command options for submitting jobs.

Submission command option
Description
‑clustername <name>
Use to specify the name of the cluster to which you want to send the job. Using the cluster name, Compressor looks for the cluster on the network in order to use it.
‑password <value>
User password for the cluster specified by -clusterid or -clustername.
‑batchname <name>
Use to specify a name for the batch so that you can easily recognize it in Share Monitor.
‑clusterid <user name:password@IP address:port number>
Optionally, you can use ‑clusterid to enter the cluster ID (IP address) and port number instead of using ‑clustername. (When you enter the cluster ID and port number, less time is required to find the cluster on the network.) Enclose the IP address and port as follows:
"tcp://<ip address>:<port>"
Also, if your cluster requires a password, you must supply a password that is set for QuickClusters in the Apple Qmaster Sharing window in Compressor, or for manually created clusters, in Apple Qadministrator. The format is -clusterid [username:password]@<ip address>:<port>. The username is not checked, so it can be any username, but the password must be valid. You can also use -password with -clusterid as follows:
-clusterid @<ip address>:<port> -password <password> Use Compressor -show to see a cluster’s ip address and port number (clusterid).
‑priority <value>
Specifies the priority level for a job.
‑jobpath <url>
Specifies the location of the source file.
‑settingpath <url>
Specifies the location of the settings for the job.
‑destinationpath <url>
Specifies the destination file URL for the job.
‑info <xml>
Gives detailed information for a batch or a job.
‑timeout <seconds>
Use to specify the number of seconds before Compressor can quit when looking for a cluster. The default value is 30. A value of 0 puts no limit on the time out and allows Compressor to browse the network for as long as it needs to find the cluster.
‑show
Shows the ID information for the cluster specified with ‑clustername or ‑clusterid, or for all clusters if no cluster is specified.
‑help
Displays information regarding the required parameters for the Compressor command.

Example of Compressor Commands

Following are examples of code for submitting common Compressor commands.

Cluster Names and IDs on a Local Network

The following command lists all of the cluster names and IDs on the local network.

/Applications/Compressor.app/Contents/MacOS/Compressor -show -timeout 10

This command has the following elements:

  • Identifies where Compressor is located (the quotation marks are used because of the space in “Final Cut Pro”).

  • Shows all cluster names and IDs found.

  • Sets the command to time out after ten seconds.

Submit a Job with No Password

The following submits a job to a cluster identified by a name that does not have a password.

/Applications/Compressor.app/Contents/MacOS/Compressor -clustername MyCluster -batchname "My First Batch" -jobpath ~/Movies/MySource.mov -settingpath ~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting -destinationpath ~/Movies/MyOutput.mp4 -timeout 5

This command has the following elements:

  • Identifies where Compressor is located.

  • Sends this job to the cluster named MyCluster.

  • Assigns the batch name My First Batch (the quotation marks are used because of the spaces).

  • Finds the MySource.mov file for the job at ~/Movies/MySource.mov.

  • Uses the MPEG-4 setting at ~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting (the “\” character is used in this case to retain the space in “Application Support”).

  • Writes the output file, named MyOutput.mp4, to the ~/Movies folder.

  • Sets the command to time out after five seconds of looking for the cluster.

Submit a Job with a Password

The following submits a job to a cluster identified by a name that does have a password.

/Applications/Compressor.app/Contents/MacOS/Compressor -clustername MyCluster -password testpassword -batchname "My First Batch" -jobpath ~/Movies/MySource.mov -settingpath ~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting -destinationpath ~/Movies/MyOutput.mp4 -timeout 5

This command has the following elements:

  • Identifies where Compressor is located.

  • Sends this job to the cluster named MyCluster.

  • Submits the password “testpassword.”

  • Assigns the batch name My First Batch.

  • Finds the MySource.mov file for the job at ~/Movies/MySource.mov.

  • Uses the MPEG-4 setting at ~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting.

  • Writes the output file, named MyOutput.mp4, to the ~/Movies folder.

  • Sets the command to time out after five seconds of looking for the cluster.

Submit a Job Using a Cluster ID and No Password

The following submits a job to a cluster identified by an IP address that does not have a password.

/Applications/Compressor.app/Contents/MacOS/Compressor -clusterid "tcp://192.168.1.148:62995" -batchname "My First Batch" -jobpath ~/Movies/MySource.mov -settingpath ~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting -destinationpath ~/Movies/MyOutput.mp4 -timeout 5

This command has the following elements:

  • Identifies where Compressor is located.

  • Sends this job to the cluster with the IP address of tcp://192.168.1.148 at port 62995.

  • Assigns the batch name My First Batch.

  • Finds the MySource.mov file for the job at ~/Movies/MySource.mov.

  • Uses the MPEG-4 setting at ~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting.

  • Writes the output file, named MyOutput.mp4, to the ~/Movies folder.

  • Sets the command to time out after five seconds of looking for the cluster.

Submit a Job Using a Cluster ID and an Inline Password

The following submits a job to a cluster identified by an IP address, with a user name and an inline password.

/Applications/Compressor.app/Contents/MacOS/Compressor -clusterid "tcp://username:testpassword@192.168.1.148:62995" -batchname "My First Batch" -jobpath ~/Movies/MySource.mov -settingpath ~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting -destinationpath ~/Movies/MyOutput.mp4 -timeout 5

This command has the following elements:

  • Identifies where Compressor is located.

  • Sends this job as “username” with the pasword “testpassword” to the cluster with the IP address of tcp://192.168.1.148 at port 62995.

  • Assigns the batch name My First Batch.

  • Finds the MySource.mov file for the job at ~/Movies/MySource.mov.

  • Uses the MPEG-4 setting at ~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting.

  • Writes the output file, named MyOutput.mp4, to the ~/Movies folder.

  • Sets the command to time out after five seconds of looking for the cluster.

Submit a Job Using a Cluster ID and a Password

The following submits a job to a cluster identified by an IP address using a password, but does not specify a user name.

/Applications/Compressor.app/Contents/MacOS/Compressor -clusterid "tcp://192.168.1.148:62995" -password testpassword -batchname "My First Batch" -jobpath ~/Movies/MySource.mov -settingpath ~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting -destinationpath ~/Movies/MyOutput.mp4 -timeout 5

This command has the following elements:

  • Identifies where Compressor is located.

  • Sends this job to the cluster with the IP address of tcp://192.168.1.148 at port 62995 with the pasword “testpassword.”

  • Assigns the batch name My First Batch.

  • Finds the MySource.mov file for the job at ~/Movies/MySource.mov.

  • Uses the MPEG-4 setting at ~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting.

  • Writes the output file, named MyOutput.mp4, to the ~/Movies folder.

  • Sets the command to time out after five seconds of looking for the cluster.