+
+<!-- ============================================================== -->
+<section>
+<title>The audio map</title>
+
+<para>
+The section at the bottom of the audio tab is the ‘audio
+map’. This governs how sound from the content will be arranged
+in the DCP.
+</para>
+
+<para>
+Down the left-hand side of the map is the list of audio channels in
+the currently-selected piece of content. These are labelled with two
+numbers; the first is the stream index within the content and the
+second is the channel number within that stream. Some content will
+have different streams for different languages or audio mixes. Along
+the top is each channel in the DCP. A green box means that the
+corresponding content channel will be copied into the corresponding
+DCP channel.
+</para>
+
+<para>
+When content channels are copied into DCP channels they can be done
+with variable gain. If, for example, you want to copy a channel
+as-is, you can set a gain of 0dB. Alternatively, if you want to mix
+two channels into one, you may want to use a gain of -6dB on each one
+to prevent clipping when the two channels are added.
+</para>
+
+<para>
+The green boxes of the audio mapping view tell you (very roughly) how
+much gain is applied to each channel. A full-height box means 0dB
+(i.e. unity) gain. Any less height indicates lower gain.
+</para>
+
+<para>
+To map one channel to another with 0dB gain, click in the empty box
+and it will turn green to reflect the mapping. A second click will
+turn the mapping back off. To set some other gain, right-click on the
+box to open the gain menu. This allows you to set
+<guilabel>Off</guilabel> (no mapping or negative infinity gain),
+<guilabel>Full</guilabel> (0dB gain), -6dB gain or
+<guilabel>Edit</guilabel> which allows you to set the required gain
+precisely.
+</para>
+
+<para>
+Consider, for example, the case in <xref linkend="fig-audio-map-eg1"/>.
+</para>
+
+<figure id="fig-audio-map-eg1">
+ <title>Audio map example 1</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/audio-map-eg1&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+Here, we have two channels in the source which are mapped to left and
+right, respectively, in the DCP. The full green boxes show that the
+mapping is at unity gain (0dB) in each case. Imagine that we modify
+the settings to those shown in <xref linkend="fig-audio-map-eg2"/>
+</para>
+
+<figure id="fig-audio-map-eg2">
+ <title>Audio map example 2</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/audio-map-eg2&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+We now have the content's streams mapped to left and right and also
+mixed together and placed in the DCP's centre channel. The smaller
+green boxes on the centre mappings show that those channels are added
+with some non-unity gain; you can see by hovering the mouse pointer
+over those boxes that the gain for content channels 1 and 2 is -6dB
+when being sent to the centre channel and 0dB when being sent to left
+and right.
+</para>
+
+<figure id="fig-audio-map-eg3">
+ <title>Audio map example 3</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/audio-map-eg3&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+As a final example, the map in <xref linkend="fig-audio-map-eg3"/>
+shows the mapping of a 5.1 source into a 5.1 DCP.
+</para>
+
+</section>
+
+
+<!-- ============================================================== -->
+<section>
+<title>Other controls</title>
+
+<para>
+‘Audio Gain’ is used to alter the volume of the
+soundtrack. The specified gain (in dB) will be applied to each sound
+channel of your content before it is written to the DCP.
+</para>
+
+<para>
+If you use a sound processor that DCP-o-matic knows about, it can help
+you calculate changes in gain that you should apply. Say, for
+example, that you make a test DCP and find that you have to run it at
+volume 5 instead of volume 7 to get a good sound level in the screen.
+If this is the case, click the <guilabel>Calculate...</guilabel>
+button next to the audio gain entry, and the dialogue box in <xref
+linkend="fig-calculate-audio-gain"/> will open.
+</para>
+
+<figure id="fig-calculate-audio-gain">
+ <title>Calculating audio gain</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/calculate-audio-gain&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+For our example, put 5 in the first box and 7 in the second and click
+<guilabel>OK</guilabel>. DCP-o-matic will calculate the audio gain
+that it should apply to make this happen. Then you can re-make the
+DCP (this will be reasonably fast, as the video data will already have
+been done) and it should play back at the correct volume with 7 on
+your sound-rack fader.
+</para>
+
+<para>
+Current versions of DCP-o-matic only know about the Dolby CP650 and
+CP750. If you use a different sound processor, and know the gain
+curve of its volume control, <ulink url="mailto:carl@dcpomatic.com">get in
+touch</ulink>.
+</para>
+
+<para>
+<guilabel>Audio Delay</guilabel> is used to adjust the synchronisation
+between audio and video. A positive delay will move the audio later
+with respect to the video, and a negative delay will move it earlier.
+</para>
+
+</section>
+</section>
+
+
+<!-- ============================================================== -->
+<section>
+<title>Subtitles</title>
+
+<para>
+The subtitles tab contains settings related to subtitles in your
+content, as shown in <xref linkend="fig-subtitles-tab"/>.
+</para>
+
+<figure id="fig-subtitles-tab">
+ <title>Subtitle settings tab</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/subtitles-tab&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+DCP-o-matic will extract subtitles from the content, if present, and
+they can be ‘burnt into’ the DCP (that is, they are
+included in the image and not overlaid by the projector) or included
+as a separate subtitle ‘asset’ within your DCP (in which
+case the projector overlays them onto the image on playback). The
+difference between these two arrangements is illustrated by <xref
+linkend="fig-burn-in"/> and <xref linkend="fig-discrete"/>
+</para>
+
+<figure id="fig-burn-in">
+ <title>Burnt-in subtitles</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata scale="80" fileref="diagrams/burn-in&dia;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<figure id="fig-discrete">
+ <title>Separate subtitles</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata scale="80" fileref="diagrams/discrete&dia;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+The advantage of separate subtitles is that the same video content can
+be used for DCPs in many different languages. This means that only a
+small text file needs to be changed for each target language, rather
+than a large video file. It also means that the time-consuming video
+encoding need only be done once for the project rather than once for
+every language.
+</para>
+
+<para>
+Note that subtitles come in two types: text and bitmap. Text
+subtitles are expressed as plain text and can be either burnt into the
+image or included as a separate subtitle asset within the DCP. Bitmap
+subtitles, on the other hand, are expressed as pre-rendered bitmaps.
+They cannot (yet) be added to the DCP as a separate asset and must be
+burnt into the image.
+</para>
+
+<para>
+Select the <guilabel>With Subtitles</guilabel> check-box to enable
+subtitles.
+</para>
+
+<para>
+The <guilabel>X Offset</guilabel> and <guilabel>Y Offset</guilabel>
+controls move the subtitles around within the image. The offsets are
+expressed as a percentage of the video frame size; 100% X offset is
+the entire width of the frame, and 100% Y offset is the entire height.
+Hence, to move the subtitles down by half the frame height you would
+use a Y offset of 50%.
+</para>
+
+<para>
+The <guilabel>X Scale</guilabel> and <guilabel>Y Scale</guilabel>
+controls scale the subtitles. Scale values of 1 make the subtitles
+the same size (relative to the size of the image) as they are on the
+original. Values lower than 1 make them smaller, and values higher
+make them larger. You can stretch the subtitles in either direction
+by specifying different values for X and Y scale. Subtitles from DVD
+and Blu Ray sources are frequently larger (relative to the video
+frame) than those typically used for DCP, so it is often useful to
+scale such subtitles down using these controls.
+</para>
+
+<para>
+The <guilabel>Stream</guilabel> control changes the subtitle stream
+that is used when the content has more than one.
+</para>
+
+</section>
+
+
+<!-- ============================================================== -->
+<section>
+<title>Timing</title>
+
+<para>
+The timing tab contains settings related to the timing of your
+content, as shown in <xref linkend="fig-timing-tab-detail"/>.
+</para>
+
+<figure id="fig-timing-tab-detail">
+ <title>Timing settings tab</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/timing-tab&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+Most of the timing tab's entries are <emphasis>time-codes</emphasis>.
+These are expressed as four numbers, as shown in <xref
+linkend="fig-timecode"/>.
+</para>
+
+<figure id="fig-timecode">
+ <title>Timecode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="diagrams/timecode&dia;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+<guilabel>Position</guilabel> is the time at which this piece of
+content should start within the DCP. In most cases, this will be
+<code>0:0:0:0</code> to make the content start at the beginning of the
+DCP.
+</para>
+
+<para>
+<guilabel>Full length</guilabel> is the length of the piece of
+content. This can only be set for still-image content: for video or
+sound content, it is fixed by the nature of the content file. If
+still-image content is being used you can set the length for which it
+should be displayed using this control.
+</para>
+
+<para>
+<guilabel>Trim from start</guilabel> specifies the amount that should be trimmed from the start of the content.
+</para>
+
+<para>
+<guilabel>Trim from end</guilabel> specifies the amount that should be trimmed from the end of the content.
+</para>
+
+<para>
+<guilabel>Play length</guilabel> indicates how long this piece of
+content will be once the trims have been applied. This will be equal
+to the full length minus <guilabel>trim-from-start</guilabel> and minus <guilabel>trim-from-end</guilabel>.
+</para>
+
+<para>
+<guilabel>Video frame rate</guilabel> specifies the frame rate for
+still-image content. It can also be used to override the detected
+frame rate of other content if DCP-o-matic has got it wrong.
+</para>
+
+<para>
+Each timecode control has a <guilabel>Set</guilabel> which you should
+click when you have entered a new value for a timecode. The
+<guilabel>Set</guilabel> button will make DCP-o-matic take account of
+any changes to the corresponding timecode.
+</para>
+
+</section>
+
+
+<!-- ============================================================== -->
+<section>
+<title>Video processing pipeline</title>
+
+<para>
+This section gives a little more detail about how DCP-o-matic process
+video as it takes it from a source and puts it into a DCP.
+</para>
+
+<para>
+Consider, as a somewhat over-the-top example, that we have a 720 x 576
+image which is letterboxed with 36 black pixels each at the top and
+bottom, and the video content within the letterbox should be presented
+in the DCP at ratio of 2.39:1 within a 1.85:1 frame (such as might
+happen with a trailer). The source image is shown in <xref
+linkend="fig-pipeline1"/>.
+</para>
+
+<figure id="fig-pipeline1">
+ <title>Example image to demonstrate video processing</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata scale="100" fileref="diagrams/pipeline1&dia;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+DCP-o-matic runs through the following steps when preparing an image for a DCP:
+</para>
+
+<itemizedlist>
+<listitem>Crop</listitem>
+<listitem>Scale</listitem>
+<listitem>Place in container</listitem>
+</itemizedlist>
+
+<para>
+First, some amount of the image can be cropped. This is almost always
+used to remove black borders (letterboxing and/or pillarboxing) around
+images.
+</para>
+
+<para>
+In our example image, we would use 36 pixels of crop from the top and
+bottom. This would give the new image shown in <xref
+linkend="fig-pipeline2"/>.
+</para>
+
+<figure id="fig-pipeline2">
+ <title>Example image after cropping</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata scale="100" fileref="diagrams/pipeline2&dia;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+The next step is to scale the image. Since this content should be
+presented in a 2.39:1 aspect ratio inside a 1.85:1 DCP we would select
+<guilabel>Scope</guilabel> from the <guilabel>Scale to</guilabel>
+option in the <guilabel>Video</guilabel> tab and
+<guilabel>Flat</guilabel> from the <guilabel>Container</guilabel>
+option in the <guilabel>DCP</guilabel> tab.
+</para>
+
+<para>The <guilabel>Scale to</guilabel> option should always be set to
+the aspect ratio at which the content should be seen. The
+<guilabel>Container</guilabel> option should be set to the preset that
+you want to use on the projector. Of course, these two settings will
+often be the same.
+</para>
+
+<para>
+Given the scaling and container information, DCP-o-matic will look at
+the DCP's container size, and then scale the source image up until one
+or both of its dimensions (width, height or both) fits the size of the
+container, all the while preserving the desired aspect ratio.
+</para>
+
+<para>
+In our example here, the DCP's container is specified as 1.85:1 (so
+that the DCP will play back correctly using the projector's
+‘Flat’ preset). At 2K, 1.85:1 is 1998 pixels by 1080.
+Scaling the source up whilst preserving its 1.85:1 aspect ratio will
+result in the image hitting the sides of the container first, at a
+size of 1998 x 836. This gives us a new version of the image as shown
+in <xref linkend="fig-pipeline3"/>.
+</para>
+
+<figure id="fig-pipeline3">
+ <title>Example image after cropping and scaling</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata scale="100" fileref="diagrams/pipeline3&dia;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+The final step is to place the image into the DCP. In this case,
+since we have a 2.39:1 image that should be presented as a 1.85:1 DCP,
+we have set the <guilabel>container</guilabel> in the
+<guilabel>DCP</guilabel> tab to be Scope. Since the content has been
+scaled to 1998 x 836, and a Flat container is 1998 x 1080, there will
+be some black bars at the top and bottom of the image. DCP-o-matic
+shares out this black equally, as shown in <xref
+linkend="fig-pipeline3"/>.
+</para>
+
+<figure id="fig-pipeline4">
+ <title>Example image in the DCP</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata scale="100" fileref="diagrams/pipeline4&dia;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+</section>
+
+</chapter>
+
+<chapter xml:id="ch-dcp" xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="en">
+<title>DCP settings</title>
+
+<para>
+This chapter describes the settings that apply to the whole DCP. The
+controls for these settings are in the <guilabel>DCP</guilabel> tab of
+the main window, as shown in <xref linkend="fig-dcp-tab"/>.
+</para>
+
+<figure id="fig-dcp-tab">
+ <title>DCP settings tab</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/dcp-tab&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+The first thing here is the name. This is generally set to the title
+of the film that is being encoded. If <guilabel>Use ISDCF
+name</guilabel> is not ticked, the name that you specify will be used
+as-is for the name of the DCP. If <guilabel>Use ISDCF name</guilabel>
+is ticked, the name that you enter will be used as part of a
+ISDCF-compliant name.
+</para>
+
+<para>
+Underneath the name field is a preview of the name that the DCP will
+get. To use a ISDCF-compliant name, tick the <guilabel>Use ISDCF
+name</guilabel> check-box. The ISDCF name will be composed using details
+of your content's soundtrack, the current date and other things that
+can be specified in the ISDCF name details dialogue box, which you can
+open by clicking on the <guilabel>Details</guilabel> button.
+</para>
+
+<para>
+If you want to take the ISDCF-compliant name that DCP-o-matic
+generates and modify it, click <guilabel>Copy as name</guilabel> and
+the ISDCF name will be copied into the <guilabel>Name</guilabel> box.
+You can then edit it as you wish. The DCP name should not matter (in
+that it should not affect how the DCP ingests or plays) but
+projectionists will appreciate it if you use the standard naming
+scheme as it makes it easier to identify details of the content.
+</para>
+
+<para>
+The <guilabel>Content Type</guilabel> option can be
+‘feature’, ‘trailer’ or whatever; select the
+required type from the drop-down list. On some projection systems
+this will affect where your content appears in the projector's server
+user interface, so take care to select an appropriate type.
+</para>
+
+<para>
+The <guilabel>Signed</guilabel> check-box sets whether or not the DCP
+is signed. This is rarely important; if in doubt, tick it.
+</para>
+
+<para>
+The <guilabel>Encrypted</guilabel> check-box will set whether the DCP
+should be encrypted or not. If this is ticked, the DCP will require a
+KDM to play back. Encryption is discussed in <xref
+linkend="ch-encryption"/>.
+</para>
+
+<para>
+If you use encryption DCP-o-matic will generate a random encryption
+key for you. To specify your own key, click the
+<guilabel>Edit..</guilabel> button next to the key.
+</para>
+
+<para>
+The <guilabel>Standard</guilabel> option specifies which of the two
+DCP standards DCP-o-matic should use. If in doubt, use SMPTE (the
+more modern of the two).
+</para>
+
+<para>
+At the bottom of the DCP tab are a further two tabs, one each to
+contain the settings for the DCP's video and audio parts.
+</para>
+
+<para>
+The <guilabel>Container</guilabel> option sets the ratio of the image
+in the DCP. If this ratio is different to the ratio used for any
+content, DCP-o-matic will pad the content with black. In simple cases
+this should be set to the same ratio as that for the the primary piece
+of video content. Alternatively, you might want to pillarbox a small
+format into a Flat container: in this case, select the small format
+for the content's ratio and ‘Flat’ for the DCP.
+</para>
+
+<para>
+The <guilabel>Frame Rate</guilabel> control sets the frame rate of
+your DCP. This can be a little tricky to get right. Ideally, you
+want it to be the same as the video content that you are using. If it
+is not the same, DCP-o-matic must resort to some tricks to alter your
+content to fit the specified frame rate. Frame rates are discussed in
+more detail in <xref linkend="ch-frame-rates"/>.
+</para>
+
+<para>
+The <guilabel>Use best</guilabel> button sets the DCP video frame rate
+to what DCP-o-matic thinks is the best given the content that you have
+added.
+</para>
+
+<para>
+<guilabel>Burn subtitles into image</guilabel> should be selected if
+you want DCP-o-matic to overlay the subtitles onto the video frame
+before encoding. Leave this un-ticked to include the subtitles
+separately in the DCP.
+</para>
+
+<para>
+The <guilabel>3D</guilabel> button will set your DCP to 3D mode if it
+is checked. A 3D DCP will then be created, and any 2D content will be
+made 3D compatible by repeating the same frame for both left and right
+eyes. A 3D DCP can be played back on many 3D systems (e.g. Dolby 3D,
+Real-D etc.) but not on a 2D system.
+</para>
+
+<para>
+The <guilabel>Resolution</guilabel> tab allows you to choose the
+resolution for your DCP. Use 2K unless you have content that is of
+high enough resolution to be worth presenting in 4K.
+</para>
+
+<para>
+The <guilabel>JPEG2000 bandwidth</guilabel>; setting changes how big
+the final image files used within the DCP will be. Larger numbers
+will give better quality, but correspondingly larger DCPs. The
+bandwidth can be between 50 and 250 megabits per second (Mbit/s).
+Most commercial DCPs use bit rates between 75 and 125 MBit/s.
+</para>
+
+<para>
+The <guilabel>Audio Channels</guilabel> control sets the number of
+audio channels that the DCP will have. If the DCP has any channels
+for which there is no content audio they will be replaced by silence.
+You can only set an even number of channels here, since that is
+required by the DCI standard. If you want an odd number of channels,
+set the DCP channel count to one greater than you need and the
+unused channel will be filled with silence.
+</para>
+
+<para>
+The <guilabel>Processor</guilabel> control allows you to select a
+process to apply to the audio before it goes into the DCP. Two processes are currently provided:
+</para>
+
+<itemizedlist>
+<listitem>Mid-side decode — this will take a L/R
+stereo input and extract the common part (corresponding to the
+‘Mid’ in a mid-side signal) into the DCP's centre channel.
+The remaining L/R parts will be kept in the L/R channels of the DCP.
+This may be useful to make near-field L/R mixes more compatible with
+cinema audio systems.</listitem>
+<listitem>Stereo to 5.1 up-mixer A — this will take a stereo input and up-mix it to ‘fake’ 5.1. The input L/R are treated as follows:
+<itemizedlist>
+<listitem>DCP L is input L bandpass-filtered between 1.9kHz and 4.8kHz.</listitem>
+<listitem>DCP R is input R bandpass-filtered between 1.9kHz and 4.8kHz.</listitem>
+<listitem>DCP C is input L mixed with input R, taken down by 3dB and then bandpass-filtered between 150Hz and 1.9kHz.</listitem>
+<listitem>DCP Lfe is input L mixed with input R, taken down by 3dB and then bandpass-filtered between 20Hz and 150Hz.</listitem>
+<listitem>DCP Ls is input L bandpass-filtered between 4.8kHz and 20kHz.</listitem>
+<listitem>DCP Rs is input R bandpass-filtered between 4.8kHz and 20kHz.</listitem>
+</itemizedlist>
+</listitem>
+</itemizedlist>
+
+<para>
+This upmixing algorithm is due to Gérald Maruccia.
+</para>
+
+
+<!-- ============================================================== -->
+<section>
+<title>Show audio</title>
+
+<para>
+The <guilabel>Show Audio</guilabel> button will instruct DCP-o-matic
+to examine the audio in your content and plot a graph of its level
+over time. This can be useful for getting a rough idea of how loud
+the sound will be in the cinema auditorium. A typical plot is shown
+in <xref linkend="fig-audio-plot"/>
+</para>
+
+<figure id="fig-audio-plot">
+ <title>Audio plot</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/audio-plot&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+The plot gives the audio level (vertical axis, in dB) with time
+(horizontal axis). 0dB represents full scale, so if there is anything
+near this you are in danger of clipping the projector's audio outputs.
+</para>
+
+<para>
+There are two plot types: the peak level and the RMS, which can be
+shown or hidden using the check-boxes on the right hand side of the
+window.
+</para>
+
+<para>
+The channel check-boxes will show or hide the plot(s) for
+the corresponding channels in the DCP.
+</para>
+
+<para>
+The smoothing slider applies a variable degree of temporal smoothing
+to the plots, which can make them easier to read in some cases.
+</para>
+
+<para>
+Obviously the audio plot is no substitute for listening in an
+auditorium, but it can be useful to get levels in the right rough area.
+</para>
+
+</section>
+
+</chapter>
+
+<chapter xml:id="ch-encryption" xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="en">
+<title>Encryption</title>
+
+<para>
+It is not required that DCPs be encrypted, but they can be. This
+chapter discusses the basic principles of DCP encryption, and how
+DCP-o-matic can create encrypted DCPs and KDMs for them.
+</para>
+
+
+<!-- ============================================================== -->
+<section>
+<title>Basics</title>
+
+<para>
+DCPs can be encrypted. This means that the picture and sound data are
+encoded in such a way that only cinemas ‘approved’ by the
+DCP's creators can read them. In particular, this means copies of the
+DCP can be distributed by insecure means: if an ne'er-do-well called
+Mallory obtains a hard drive containing an encrypted DCP, there is no
+way that he can play it. Only those cinemas who receive a correct key
+delivery message (KDM) can play the DCP.
+</para>
+
+
+<!-- ============================================================== -->
+<section>
+<title>How it works (in a nutshell)</title>
+
+<para>
+This section attempts to summarise how DCP encryption works. You can
+skip it if you like. You may need some knowledge of encryption
+methods to understand it.
+</para>
+
+<para>
+We suppose that we are trying to distribute a DCP, to
+Alice's cinema, without a troublemaker called Mallory being able to
+watch it himself.
+</para>
+
+<para>
+There are two main families of encryption techniques. The first,
+symmetric-key encryption, allows us to encode some data using some
+numeric key. After encoding, no-one can decode the data unless they
+know the key.
+</para>
+
+<para>
+The first step in a DCP encryption is to encode its data with some key
+using symmetric-key encryption. The encrypted DCP can then be sent
+anywhere, safe in the knowledge that even if Mallory got hold of a
+copy, he could not decrypt it.
+</para>
+
+<para>
+Alice, however, needs to know the key so she can play the DCP in her
+cinema. A simple approach might be for us to send Alice the key.
+However, if Mallory can intercept the DCP, he might also be able to
+intercept our communication of the key to Alice. Furthermore, if Alice
+happened to know Mallory, she could just send him a copy of the key.
+</para>
+
+<para>
+The clever bit in DCP encryption requires the use of public-key
+encryption. With this technique we can encrypt a block of data using
+some ‘public’ key. That data can then only be decrypted
+using a <emphasis>different</emphasis> ‘private’ key. The
+private and public keys are related mathematically, but it is
+extremely hard (or rather, virtually impossible) to derive the private
+key from the public key.
+</para>
+
+<para>
+Public-key encryption allows us to distribute the DCP's key to Alice
+securely. The manufacturer of Alice's projector generates a public
+and private key. They hide the private key deep inside the bowels of
+the projector (inside an integrated circuit) where no-one can read it.
+They then make the public key available to anyone who is interested.
+</para>
+
+<para>
+We take our DCP's symmetric key and encrypt it using the public key of
+Alice's projector. We send the result to Alice over email (using a
+format called a Key Delivery Message, or KDM). Her projector then
+decrypts our message using its private key, yielding the magic
+symmetric key which can decrypt the DCP.
+</para>
+
+<para>
+If is fine if Mallory intercepts our email to Alice, since the only
+key which can decrypt the message is the private key buried inside
+Alice's projector. The projector manufacturer is very careful that
+no-one ever finds out what this key is. Our DCP is secure: only Alice
+can play it back, since only her projector knows the key (even Alice
+does not).
+</para>
+
+</section>
+</section>
+
+
+<!-- ============================================================== -->
+<section>
+<title>Encryption using DCP-o-matic</title>
+
+<para>
+There are two steps to distributing an encrypted DCP. First, the
+DCP's data must be encrypted, and secondly KDMs must be generated for
+those cinemas that are allowed to play the DCP.
+</para>
+
+<para>
+The first part is simple: ticking the <guilabel>Encrypted</guilabel>
+box in the <guilabel>DCP</guilabel> tab of DCP-o-matic will encrypt
+the DCP using a random key that DCP-o-matic generates. The key will
+be written to the film's metadata file, which should be kept
+secure.
+</para>
+
+<para>
+A DCP that is generated with the <guilabel>Encrypted</guilabel> box
+ticked will not play on any projector as-is (it will be marked as
+‘locked’, or whatever the projector manufacturer's term
+is).
+</para>
+
+<para>
+The second part is to generate KDMs for the cinemas that you wish to
+allow to play your DCP. This is done using the <guilabel>Make
+KDMs</guilabel> option on the <guilabel>Jobs</guilabel> menu. This
+will open the KDM dialogue box, as shown in <xref linkend="fig-kdm"/>.
+</para>
+
+<figure id="fig-kdm">
+ <title>KDM dialog</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/kdm&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+In order to generate KDMs for a particular projector, you need to know
+its <emphasis>certificate</emphasis>. These are usually made
+available by the projector manufacturers as text files with a
+<code>.pem</code> extension.
+</para>
+
+<para>
+DCP-o-matic can store these certificates to make life easier. It
+stores details of cinemas and screens within those cinemas. Each
+screen has a certificate for its projector. DCP-o-matic can generate
+KDMs for any screens that it knows about.
+</para>
+
+<para>
+To add a cinema, click <guilabel>Add Cinema...</guilabel>. This opens
+a dialogue box into which you can enter the cinema's name, and
+optionally an email address. This email address can be used to
+get DCP-o-matic to deliver KDMs via email, but it is optional.
+</para>
+
+<para>
+Once you have added a cinema, select it by clicking on its name, then
+click <guilabel>Add Screen...</guilabel>. The resulting dialogue
+allows you to enter a name for the screen and load in its certificate
+from a file. The certificate should be in SHA256 PEM format.
+</para>
+
+<para>
+Alternatively, certificates for projection systems made by some
+manufacturers can be downloaded from databases provided by the
+manufacturer. Currently this is supported for Doremi and Dolby
+equipment. If you are targeting a screen with equipment by one of
+these manufacturers you can select Doremi or Dolby from the
+<guilabel>Server manufacturer</guilabel> selection and then click
+<guilabel>Download</guilabel>. In the next dialogue box, enter
+details of the screen and click <guilabel>Download</guilabel> and, all
+being well, the certificate will be fetched.
+</para>
+
+<para>
+Using the download system you will need to know the serial number of
+the media server in use in the screen. Most cinema projection or
+technical departments will know these serial numbers.
+</para>
+
+<para>
+Note that the reliability of the manufacturers' certificate databases
+cannot be guaranteed. It is vital that KDMs are tested by the
+destination cinema will in advance of show time to identify any
+problems.
+</para>
+
+<para>
+Once you have set up all the screens that you need KDMs for, select
+the CPL that you want to create the KDM for. You can use the
+drop-down list to select the CPLs in the current film project, or load
+a CPL from somewhere else. Select the cinemas and/or screens that you
+want KDMs for and fill in the start and end dates and times.
+</para>
+
+<para>
+You must also select the type of KDM that you want to generate. If in
+doubt, use <guilabel>Modified Transitional 1</guilabel>.
+</para>
+
+<para>
+Finally, choose what you want to do with the KDMs. They can be
+written to disk, to a location that you can specify by clicking
+<guilabel>Browse</guilabel>. Alternatively, if you choose
+<guilabel>Send by email</guilabel> the KDMs will be zipped up and
+emailed to the appropriate cinema email addresses. Click OK to
+generate the KDMs.
+</para>
+
+</section>
+
+</chapter>
+
+
+
+<!-- ============================================================== -->
+<chapter xml:id="ch-preferences" xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="en">
+<title>Preferences</title>
+
+<para>
+DCP-o-matic provides a few preferences which can be used to modify its
+behaviour. This chapter explains those options.
+</para>
+
+
+<!-- ============================================================== -->
+<section>
+<title>The preferences dialogue</title>
+
+<para>
+The preferences dialogue is opened by choosing
+<guilabel>Preferences...</guilabel> from the <guilabel>Edit</guilabel>
+menu. The dialogue is split into seven tabs.
+</para>
+
+<!-- ============================================================== -->
+<section>
+<title>General</title>
+
+<para>
+The general tab is shown in <xref linkend="fig-prefs-general"/>.
+</para>
+
+<figure id="fig-prefs-general">
+ <title>General preferences</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/prefs-general&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+
+<!-- ============================================================== -->
+<section>
+<title>Language</title>
+
+<para>
+If you tick the <guilabel>Set Language</guilabel> checkbox and choose
+a language from the list, that language will be used for DCP-o-matic.
+You will need to restart DCP-o-matic to see the new language.
+</para>
+
+<para>
+The translations for DCP-o-matic have been contributed by helpful
+users. If your language is not on the last, head to <ulink
+url="http://dcpomatic.com/i18n.php">the DCP-o-matic website</ulink> to
+read about how to contribute a translation.
+</para>
+</section>
+
+
+<!-- ============================================================== -->
+<section>
+<title>Threads</title>
+
+<para>
+When DCP-o-matic is encoding DCPs it can use multiple parallel threads
+to speed things up. Set this value to the number of threads
+DCP-o-matic should use. This should normally be the number of
+processors (or processor cores) in your machine. DCP-o-matic will try
+to set this up correctly when you run it for the first time.
+</para>
+
+</section>
+
+<!-- ============================================================== -->
+<section>
+<title>Updates</title>
+
+<para>
+The <guilabel>Check for updates on startup</guilabel> option, if
+enabled, will tell DCP-o-matic to check on <ulink
+url="http://dcpomatic.com/">dcpomatic.com</ulink> to see if there any
+newer versions of DCP-o-matic then the one you are running. If so, a
+dialogue box will open with a link to download the new version.
+available
+</para>
+
+<para>
+The <guilabel>Check for testing updates as well as stable
+ones</guilabel> option will also check for test updates as well as
+those that are formally ‘released’. This is useful if you
+like to live on the bleeding edge!
+</para>
+</section>
+
+</section>
+
+<!-- ============================================================== -->
+<section>
+<title>Defaults</title>
+
+<para>
+The defaults tab is shown in <xref linkend="fig-prefs-defaults"/>.
+</para>
+
+<figure id="fig-prefs-defaults">
+ <title>Defaults preferences</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/prefs-defaults&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+The options in this tab simply allow you to set up default values for
+various properties of new films.
+</para>
+
+</section>
+
+<!-- ============================================================== -->
+<section>
+<title>Servers</title>
+
+<para>
+The servers tab is shown in <xref linkend="fig-prefs-servers"/>.
+</para>
+
+<figure id="fig-prefs-servers">
+ <title>Servers preferences</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/prefs-servers&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+If <guilabel>Use all servers</guilabel> is ticked DCP-o-matic will
+locate encoding servers automatically (see <xref
+linkend="ch-servers"/>).
+</para>
+
+<para>
+Instead of this (or in addition) servers can be specified explicitly.
+To add a server, click <guilabel>Add...</guilabel> and enter the host
+name or IP address of the server to use.
+</para>
+
+</section>
+
+
+<!-- ============================================================== -->
+<section xml:id="sec-prefs-keys">
+<title>Keys</title>
+
+<para>
+The Keys tab (shown in <xref linkend="fig-prefs-keys"/>) holds options
+related to the keys and certificates used in some parts of DCP
+creation.
+</para>
+
+<figure id="fig-prefs-keys">
+ <title>Keys preferences</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/prefs-keys&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+At the top of the tab is the chain of certificates that will be used
+to sign DCPs and KDMs. DCP-o-matic creates a random chain when you
+first run it, so if you are happy to use a randomly-generated chain
+you can ignore the preferences. Otherwise, you can add or remove
+certificates from the chain using the <guilabel>Add...</guilabel> and
+<guilabel>Remove</guilabel> buttons.
+</para>
+
+<para>
+If you want DCP-o-matic to re-create the certificate chain (using new,
+random certificates) click <guilabel>Re-make
+certificates...</guilabel> and specify your organisation and common
+names in the dialogue box that opens.
+</para>
+
+<para>
+Underneath the certificate chain is the private key that corresponds
+to the leaf certificate in the chain. You can specify your own
+private key by clicking <guilabel>Load...</guilabel>. You must do
+this if you change the leaf certificate, so that the leaf private key
+corresponds to the public key held in the leaf certificate.
+</para>
+
+<para>
+The bottom of the tab specifies the certificate and private key that
+is used to decrypt DCPs if they are imported as sources to
+DCP-o-matic. If you want to import an encrypted DCP you will need to
+give the decryption certificate to the distributor of the DCP so that
+they can generate a DKDM for you. As with the certificate chain,
+DCP-o-matic will create a certificate and private key for you. You
+can also choose to load your own certificate and key.
+</para>
+
+</section>
+
+<!-- ============================================================== -->
+<section xml:id="sec-prefs-tms">
+<title>TMS</title>
+<titleabbrev xml:id="sec-prefs-tms-short">TMS preferences</titleabbrev>
+
+<para>
+The TMS tab (shown in <xref linkend="fig-prefs-tms"/>) gives some
+options for specifying details about your theatre management system
+(TMS). If you do this, and your TMS accepts SSH connections, you can
+upload DCPs directly from DCP-o-matic to the TMS using the
+<guilabel>Send DCP to TMS</guilabel> option in the
+<guilabel>Jobs</guilabel> menu.
+</para>
+
+<figure id="fig-prefs-tms">
+ <title>TMS preferences</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/prefs-tms&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+<guilabel>TMS IP address</guilabel> should be set to the IP address of
+your TMS, <guilabel>TMS target path</guilabel> to the place that DCPs
+should be uploaded to (which will be relative to the home directory of
+the SSH user). Finally, the user name and password are the
+credentials required to log into the TMS via SSH.
+</para>
+
+<para>
+Note that for this to work on Doremi servers you will need to set the
+<code>PasswordAuthentication</code> option in your server's
+<code>sshd_config</code> to <code>yes</code>.
+</para>
+
+</section>
+
+
+<!-- ============================================================== -->
+<section>
+<title>KDM email</title>
+
+<para>
+The KDM email is shown in <xref linkend="fig-prefs-kdm-email"/>.
+</para>
+
+<figure id="fig-prefs-kdm-email">
+ <title>KDM email preferences</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/prefs-kdm-email&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+This is a template for the email that is used to send KDMs out to
+cinemas. You can change it to say whatever you like. A few
+‘magic’ strings will be replaced by information from the
+KDM that is being sent:
+</para>
+
+<table>
+<title>‘Magic’ KDM strings</title>
+<tgroup cols='2' align='left' colsep='1' rowsep='1'>
+<tbody>
+<row>
+<entry><code>$CPL_NAME</code></entry><entry>DCP title</entry>
+</row>
+<row>
+<entry><code>$CINEMA_NAME</code></entry><entry>Cinema name</entry>
+</row>
+<row>
+<entry><code>$SCREENS</code></entry><entry>Name of screen or screens that KDMs are being generated for</entry>
+</row>
+<row>
+<entry><code>$START_TIME</code></entry><entry>The time from which the KDMs are valid</entry>
+</row>
+<row>
+<entry><code>$END_TIME</code></entry><entry>The time until which the KDMs are valid</entry>
+</row>
+</tbody>
+</tgroup>
+</table>
+
+<para>
+The <guilabel>Reset to default text</guilabel> will replace the current KDM email with DCP-o-matic's default.
+</para>
+
+</section>
+
+
+<!-- ============================================================== -->
+<section xml:id="sec-prefs-advanced">
+<title>Advanced</title>
+<titleabbrev xml:id="sec-prefs-advanced-short">Advanced preferences</titleabbrev>
+
+<para>
+The advanced preferences are shown in <xref linkend="fig-prefs-advanced"/>.
+</para>
+
+<figure id="fig-prefs-advanced">
+ <title>Advanced preferences</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshots/prefs-advanced&scs;"/>
+ </imageobject>
+ </mediaobject>
+</figure>
+
+<para>
+<guilabel>Maximum JPEG2000 bandwidth</guilabel> specifies the maximum
+bit-rate of JPEG2000 that DCP-o-matic will allow you to create. You
+are advised to leave this at 250Mbit/s in normal use for maximum DCP
+compatibility.
+</para>
+
+<para>
+<guilabel>Allow any DCP frame rate</guilabel> removes the limits on
+the DCP video frame rates that DCP-o-matic will create. This may be
+useful for experimentation. Again, you are strongly advised to leave
+this unticked for normal use.
+</para>
+
+<para>
+The four checkboxes labelled <guilabel>Log</guilabel> control what
+sort of messages DCP-o-matic writes to its log file when creating a
+DCP. It is useful to leave <guilabel>General</guilabel>,
+<guilabel>Warnings</guilabel> and <guilabel>Errors</guilabel> ticked
+as this makes the log files useful for tracking down bugs.
+</para>
+
+<para>
+The <guilabel>Timing</guilabel> checkbox will enable extra log entries
+to allow developers to investigate and optimize the speed of
+DCP-o-matic. It will significantly increase the size of the log files
+that are generated, so in normal use it is best to leave this
+unticked.