用于提交 Compressor 作业的 Shell 命令

您可以使用 Compressor 命令从命令行运行 Compressor 应用程序,有很多命令行选项可用于提交作业。

在下面的命令行描述中,尖括号 < > 表示命令中的必选参数,方括号 [ ] 表示可选参数。

概要

以下是将作业提交到群集的命令概要。Compressor 命令位于“/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]

在此示例中,‑jobpath‑settingpath‑destinationpath(顺序如示例中所示)的重复次数可达到您想要提交的作业数。

备注: 并非所有选项都是必须的。例如,您可以通过群集的 ‑clustername ‑clusterid 来指定群集。您无需两个都指定。如果两个都指定,则只会使用 ‑clusterid

此外,如果您指定了 ‑batchfilepath,就不再需要 ‑jobpath‑settingpath‑destinationpath,因为先前存储的批处理文件已经包含有关作业、设置和目的位置的信息。

‑batchfilepath 的示例:

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

一旦成功提交作业,此命令将会在 Shell 中显示批处理 ID(标识符)和作业 ID(标识符),并且您可以在 Share Monitor 中监视批处理的进度。

命令选项

此表提供了用于提交作业的每个命令选项的信息。

提交命令选项
描述
‑clustername <name>
用于指定您要将作业发送到的群集的名称。使用群集名称,Compressor 会在网络上查找该群集从而使用它。
‑password <value>
-clusterid-clustername 指定的群集的用户密码。
‑batchname <name>
用于指定批处理的名称,以便您在 Share Monitor 中轻松地识别该批处理。
‑clusterid <user name:password@IP address:port number>
您可以选择性地使用 ‑clusterid 来输入群集 ID(IP 地址)和端口号,而非使用 ‑clustername。(当您输入群集 ID 和端口号时,在网络上找到该群集所需的时间会更少。)依照如下方式将 IP 地址和端口括起来:
"tcp://<ip address>:<port>"
此外,如果群集需要密码,您必须提供在 Compressor 的“Apple Qmaster 共享”窗口中设定给 QuickCluster 的密码,或者为在 Apple Qadministrator 中手动创建的群集提供密码。格式为 -clusterid [username:password]@<ip address>:<port>。用户名称不会加以检查,因此可以是任何用户名称,但密码必须是有效的。您也可以将 -password-clusterid 一起使用,如下所示:
-clusterid @<ip address>:<port> -password <password> 使用 Compressor -show 来查看群集的 IP 地址和端口号 (clusterid)。
‑priority <value>
指定作业的优先级。
‑jobpath <url>
指定源文件的位置。
‑settingpath <url>
指定作业的设置的位置。
‑destinationpath <url>
指定作业的目的位置文件 URL。
‑info <xml>
给出一个批处理或作业的详细信息。
‑timeout <seconds>
用于指定秒数,Compressor 在查找群集时如果超出该时间将会退出。默认值为 30。值为 0 时对超时没有限制,可让 Compressor 以它需要的时间浏览网络来查找群集。
‑show
显示使用 ‑clustername‑clusterid 指定的群集的 ID 信息,如果没有指定群集,则显示所有群集的 ID 信息。
‑help
显示 Compressor 命令所需参数相关的信息。

Compressor 命令的示例

以下是用于提交常用 Compressor 命令的代码示例。

本地网络上的群集名称和 ID

以下命令会列出本地网络上的所有群集名称和 ID。

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

该命令有以下元素:

  • 标识 Compressor 所在的位置(使用引号的原因是“Final Cut Pro”中有空格)。

  • 显示找到的所有群集名称和 ID。

  • 将命令设定为在十秒钟后超时。

在不提供密码的情况下提交作业

以下示例会将作业提交到用名称(不提供密码)来标识的群集。

/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

该命令有以下元素:

  • 标识 Compressor 所在的位置。

  • 将此作业发送到名为 MyCluster 的群集。

  • 给批处理指定名称“My First Batch”(使用引号的原因是名称中有空格)。

  • 为作业找到 MySource.mov 文件,位于“~/Movies/MySource.mov”。

  • 使用 MPEG-4 设置,位于“~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting”(在这里使用了“\”字符,是为了保留“Application Support”中的空格)。

  • 将名为 MyOutput.mp4 的输出文件写入“~/Movies”文件夹。

  • 将命令设定为在查找群集五秒钟后超时。

在提供密码的情况下提交作业

以下示例会将作业提交到用名称(提供了密码)来标识的群集。

/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

该命令有以下元素:

  • 标识 Compressor 所在的位置。

  • 将此作业发送到名为 MyCluster 的群集。

  • 提交密码“testpassword”。

  • 给批处理指定名称“My First Batch”。

  • 为作业找到 MySource.mov 文件,位于“~/Movies/MySource.mov”。

  • 使用 MPEG-4 设置,位于“~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting”。

  • 将名为 MyOutput.mp4 的输出文件写入“~/Movies”文件夹。

  • 将命令设定为在查找群集五秒钟后超时。

使用群集 ID 并在不提供密码的情况下提交作业

以下示例会将作业提交到用 IP 地址(不提供密码)来标识的群集。

/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

该命令有以下元素:

  • 标识 Compressor 所在的位置。

  • 将此作业发送到 IP 地址为 tcp://192.168.1.148、端口号为 62995 的群集。

  • 给批处理指定名称“My First Batch”。

  • 为作业找到 MySource.mov 文件,位于“~/Movies/MySource.mov”。

  • 使用 MPEG-4 设置,位于“~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting”。

  • 将名为 MyOutput.mp4 的输出文件写入“~/Movies”文件夹。

  • 将命令设定为在查找群集五秒钟后超时。

使用群集 ID 和内联密码提交作业

以下示例会将作业提交到用 IP 地址(带用户名称和内联密码)来标识的群集。

/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

该命令有以下元素:

  • 标识 Compressor 所在的位置。

  • 以“username”作为用户名称、“testpassword”作为密码,将此作业发送到 IP 地址为 tcp://192.168.1.148、端口号为 62995 的群集。

  • 给批处理指定名称“My First Batch”。

  • 为作业找到 MySource.mov 文件,位于“~/Movies/MySource.mov”。

  • 使用 MPEG-4 设置,位于“~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting”。

  • 将名为 MyOutput.mp4 的输出文件写入“~/Movies”文件夹。

  • 将命令设定为在查找群集五秒钟后超时。

使用群集 ID 和密码提交作业

以下示例会将作业提交到用 IP 地址(使用密码,但不指定用户名称)来标识的群集。

/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

该命令有以下元素:

  • 标识 Compressor 所在的位置。

  • 以“testpassword”作为密码,将此作业发送到 IP 地址为 tcp://192.168.1.148、端口号为 62995 的群集。

  • 给批处理指定名称“My First Batch”。

  • 为作业找到 MySource.mov 文件,位于“~/Movies/MySource.mov”。

  • 使用 MPEG-4 设置,位于“~/Library/Application\ Support/Compressor/Settings/MPEG-4.setting”。

  • 将名为 MyOutput.mp4 的输出文件写入“~/Movies”文件夹。

  • 将命令设定为在查找群集五秒钟后超时。