+
+<chapter>
+ <title>Command-line tools</title>
+
+ <para>
+ DCP-o-matic includes some tools which allow DCP creation from the
+ command line or from scripting languages. This chapter covers the
+ use of those tools.
+ </para>
+
+ <para>
+ There are three command-line tools in DCP-o-matic.
+ <code>dcpomatic2_create</code> creates film directories, with the
+ associated metadata, from a list of content files. Then
+ <code>dcpomatic2_cli</code> runs the transcode process on these
+ film directories. Finally, <code>dcpomatic2_kdm_cli</code> can be
+ used to create KDMs.
+ </para>
+
+ <para>
+ Some applications will benefit from setting up the films using the
+ main DCP-o-matic GUI and then using <code>dcpomatic2_cli</code> to
+ do the encode. This allows, for example, setup on a relatively
+ low-powered machine before running the encode on a higher-powered
+ headless server.
+ </para>
+
+ <section>
+ <title><code>dcpomatic2_create</code></title>
+
+ <para>
+ The syntax for <code>dcpomatic2_create</code> is:
+ </para>
+
+ <para>
+ <code>dcpomatic2_create [OPTION] [CONTENT] [<CONTENT> ...]</code>
+ </para>
+
+ <para>
+ <code>[CONTENT]</code> are the files or folders that you want to use in the
+ DCP. They can be:
+ <itemizedlist>
+ <listitem>‘Movie’ files in almost any common format (e.g. MP4, MOV, MKV, etc.)</listitem>
+ <listitem>A folder containing and image sequence in almost any common format (e.g. TIFF, DPX etc.)</listitem>
+ <listitem>Sound files (e.g. WAV, MP3, AIFF)</listitem>
+ <listitem>Subtitles files (e.g. <code>.srt</code>, DCP XML, <code>.ssa</code> etc.)</listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The options are:
+ </para>
+
+ <itemizedlist>
+ <listitem><code>-v</code>, <code>--version</code> — show DCP-o-matic version</listitem>
+ <listitem><code>-h</code>, <code>--help</code> — show this help</listitem>
+ <listitem><code>-n</code>, <code>--name</code> — <name> film name</listitem>
+ <listitem><code>-t, --template <name></code> — template name</listitem>
+ <listitem><code>-c, --dcp-content-type <type></code> — FTR, SHR, TLR, TST, XSN, RTG, TSR, POL, PSA or ADV</listitem>
+ <listitem><code>--container-ratio <ratio></code> — 119, 133, 137, 138, 166, 178, 185 or 239</listitem>
+ <listitem><code>--content-ratio <ratio></code> — 119, 133, 137, 138, 166, 178, 185 or 239</listitem>
+ <listitem><code>-s, --still-length <n></code> — number of seconds that still content should last</listitem>
+ <listitem><code>--standard <standard></code> — SMPTE or interop (default SMPTE)</listitem>
+ <listitem><code>--no-use-isdcf-name></code> — do not use an ISDCF name; use the specified name unmodified</listitem>
+ <listitem><code>--no-sign</code>— do not sign the DCP</listitem>
+ <listitem><code>-o</code>, <code>--output <dir></code> — output directory</listitem>
+ </itemizedlist>
+
+ <para>
+ For example, to setup a film using a MP4 file you might do:
+ </para>
+
+ <para>
+ <code>dcpomatic2_create -o my_film --container-ratio 185 --content-ratio 185 -c FTR -n "My Film" Stuff.mp4</code>
+ </para>
+
+ <para>
+ This will create a folder called <code>my_film</code> which is ready for a DCP to be made by <code>dcpomatic2_cli</code>.
+ </para>
+
+ <para>
+ <code>dcpomatic2_create</code> will use any default settings that you have configured in the main DCP-o-matic preferences.
+ </para>
+ </section>
+
+ <section>
+ <title><code>dcpomatic2_cli</code></title>
+
+ <para>
+ The syntax for <code>dcpomatic2_cli</code> is:
+ </para>
+
+ <para>
+ <code>dcpomatic2_cli [OPTION] [FILM]</code>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem><code>-v</code>, <code>--version</code> — show DCP-o-matic version</listitem>
+ <listitem><code>-h</code>, <code>--help</code> — show this help</listitem>
+ <listitem><code>-f</code>, <code>--flags</code> — show flags passed to C++ compiler on build</listitem>
+ <listitem><code>-n</code>, <code>--no-progress</code> — do not print progress to stdout</listitem>
+ <listitem><code>-r</code>, <code>--no-remote</code> — do not use any remote servers</listitem>
+ <listitem><code>-t</code>, <code>--threads</code> — specify number of local encoding threads (overriding configuration)</listitem>
+ <listitem><code>-j</code>, <code>--json</code> <port> — run a JSON server on the specified port</listitem>
+ <listitem><code>-k</code>, <code>--keep-going</code> — keep running even when the job is complete</listitem>
+ <listitem><code>-s</code>, <code>--servers</code> — just display a list of encoding servers that DCP-o-matic is configured to use; don't encode</listitem>
+ <listitem><code>-d</code>, <code>--dcp-path</code> — echo DCP's path to stdout on successful completion (implies -n)</listitem>
+ <listitem><code>--dump</code> — just dump a summary of the film's settings; don't encode</listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For example, to encode a film called <code>my_film</code> you might do:
+ </para>
+
+ <para>
+ <code>dcpomatic2_cli my_film</code>
+ </para>
+ </section>
+
+ <section>
+ <title><code>dcpomatic2_kdm_cli</code></title>
+
+ <para>
+ The syntax for <code>dcpomatic2_kdm_cli</code> is:
+ </para>
+
+ <para>
+ <code>dcpomatic2_kdm_cli [OPTION] <FILM|CPL-ID></code>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem><code>-o</code>, <code>--output</code> — output file or directory</listitem>
+ <listitem><code>-f</code>, <code>--valid-from</code> — valid from time (in local time zone of the cinema) (e.g. "2013-09-28 01:41:51") or "now"</listitem>
+ <listitem><code>-t</code>, <code>--valid-to</code> — valid to time (in local time zone of the cinema) (e.g. "2014-09-28 01:41:51")</listitem>
+ <listitem><code>-d</code>, <code>--valid-duration</code> — valid duration (e.g. "1 day", "4 hours", "2 weeks")</listitem>
+ <listitem><code>--formulation</code> — modified-transitional-1, dci-any or dci-specific [default modified-transitional-1]</listitem>
+ <listitem><code>-z</code>, <code>--zip</code> — ZIP each cinema's KDMs into its own file</listitem>
+ <listitem><code>-v</code>, <code>--verbose</code> — be verbose</listitem>
+ <listitem><code>-c</code>, <code>--cinema</code> — specify a cinema, either by name or email address</listitem>
+ <listitem><code>--certificate</code> — file containing projector certificate</listitem>
+ <listitem><code>--cinemas</code> — list known cinemas from the DCP-o-matic settings</listitem>
+ <listitem><code>--dkdm-cpls</code> — list CPLs for which DCP-o-matic has DKDMs</listitem>
+ </itemizedlist>
+ </para>
+
+ </section>
+</chapter>
+
+
+
+<!-- ============================================================== -->