Applications of the Interchange Format

This chapter describes three tools based on the Final Cut Pro XML Interchange Format that developers might create to help streamline certain postproduction tasks. It includes these sections:

Enhancing a Batch List

A filmmaker may generate tens or hundreds of hours of footage during production. Frequently, this footage is logged into a word processor, spreadsheet, or database program. The filmmaker may then use this information to create a batch list for import into Final Cut Pro.

Using the Final Cut Pro XML Interchange Format, a developer can create a simple tool that greatly enhances the capabilities of the traditional batch list, integrating into it many of the editing decisions usually expressed in a paper edit. For example, the tool can translate information from a spreadsheet file into an interchange format document that represents separated bins of clips, predefined sequences containing selected categories of clips, and even clips with effects already applied.

Listing 5-1 shows a brief example of an enhanced batch list in the interchange format. In this example, there is a single bin with five offline clips. The logging information entered for each clip in the spreadsheet has also allowed the tool (at the user's request) to set up a sequence of all the clips of a couple dancing.

Listing 5-1  An enhanced batch list

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xmeml>
<xmeml version="5">
<project>
    <name>EnhancedBatchList</name>
    <children>
        <bin>
            <name>Dance shots</name>
            <children>
                <clip id="Bloomies">
                    <name>Bloomies</name>
                    <duration>248</duration>
                    <rate>
                        <ntsc>TRUE</ntsc>
                        <timebase>30</timebase>
                    </rate>
                    <logginginfo>
                        <lognote>couple</lognote>
                    </logginginfo>
                    <timecode>
                        <string>02:12:02;17</string>
                        <source>source</source>
                        <reel>
                            <name>002</name>
                        </reel>
                    </timecode>
                </clip>
                <clip id="Jeremy Solo">
                    <name>Jeremy Solo</name>
                    <duration>188</duration>
                    <rate>
                        <ntsc>TRUE</ntsc>
                        <timebase>30</timebase>
                    </rate>
                    <logginginfo>
                        <lognote>solo male</lognote>
                        <good>FALSE</good>
                    </logginginfo>
                    <timecode>
                        <string>02:42:35;14</string>
                        <source>source</source>
                        <reel>
                            <name>002</name>
                        </reel>
                    </timecode>
                </clip>
                <clip id="Johnny n Cari">
                    <name>Johnny n Cari</name>
                    <duration>148</duration>
                    <rate>
                        <ntsc>TRUE</ntsc>
                        <timebase>30</timebase>
                    </rate>
                    <logginginfo>
                        <lognote>couple</lognote>
                        <good>FALSE</good>
                    </logginginfo>
                    <timecode>
                        <string>02:41:42;10</string>
                        <source>source</source>
                        <reel>
                            <name>002</name>
                        </reel>
                    </timecode>
                </clip>
                <clip id="Overhead">
                    <name>Overhead</name>
                    <duration>321</duration>
                    <rate>
                        <ntsc>TRUE</ntsc>
                        <timebase>30</timebase>
                    </rate>
                    <logginginfo>
                        <lognote>group</lognote>
                        <good>FALSE</good>
                    </logginginfo>
                    <timecode>
                        <string>02:39:26;28</string>
                        <source>source</source>
                        <reel>
                            <name>002</name>
                        </reel>
                    </timecode>
                </clip>
                <clip id="Round n Round">
                    <name>Round n Round</name>
                    <duration>308</duration>
                    <rate>
                        <ntsc>TRUE</ntsc>
                        <timebase>30</timebase>
                    </rate>
                    <logginginfo>
                        <lognote>couple</lognote>
                        <good>FALSE</good>
                    </logginginfo>
                    <timecode>
                        <string>02:12:18;07</string>
                        <source>source</source>
                        <reel>
                            <name>002</name>
                        </reel>
                    </timecode>
                </clip>
            </children>
        </bin>
        <sequence id="Couples">
            <name>Couples</name>
            <duration>704</duration>
            <rate>
                <ntsc>TRUE</ntsc>
                <timebase>30</timebase>
            </rate>
            <timecode>
                <rate>
                    <ntsc>TRUE</ntsc>
                    <timebase>30</timebase>
                </rate>
                <string>01:00:00;00</string>
                <frame>107892</frame>
                <source>source</source>
                <displayformat>DF</displayformat>
            </timecode>
            <media>
                <video>
                    <track>
                        <clipitem>
                            <name>Bloomies</name>
                            <start>0</start>
                            <end>248</end>
                            <file id="Bloomies1"/>
                        </clipitem>
                        <clipitem>
                            <name>Johnny n Cari</name>
                            <start>248</start>
                            <end>396</end>
                            <file id="Johnny n Cari"/>
                        </clipitem>
                        <clipitem>
                            <name>Round n Round</name>
                            <start>396</start>
                            <end>704</end>
                            <file id="Round n Round"/>
                        </clipitem>
                    </track>
                </video>
            </media>
        </sequence>
    </children>
</project>
</xmeml>

Simplifying Subtitling

Using the capabilities of the Final Cut Pro XML Interchange Format and text generators, a developer can create a tool or suite of tools to help simplify and streamline the subtitling process.

First, an editor completes the offline edit without subtitles. Then the editor adds a new slug video track and creates through edits at the points where the subtitling should change. For those parts of the video where no subtitling should appear, the editor deletes the matching portion of the slug track.

The editor then exports the sequence in the interchange format. The slug track in the resulting document contains the start and end information required to correctly specify the start and end of a text generator for each subtitle.

In addition, the editor puts text for the subtitles in a database or spreadsheet.

The subtitling tool now reads the exported file for the start and end information, and the spreadsheet or database for the actual subtitle text. It then generates a new interchange format document that substitutes a text generator for each section of the slug track, providing the appropriate subtitle text for each generator.

The editor then imports this new interchange format file and make any necessary refinements or adjustments.

Listing 5-2 shows an abbreviated example of a project with two subtitles.

At line numbered 1, the first subtitle generator effect uses the id attribute. The first generator effect in the track can set all the parameters, such as fontname, fontsize, and origin, and so on.

At line numbered 2, the next generator effect in the track can reference this id and use the same settings, overriding only the str parameter to change the subtitle text. This means you can change parameters, such as the font or text style, in the first generator effect and have the changes apply to all the subtitles in the sequence. (At line numbered 3, the encoding details for the audio tracks are omitted.)

Listing 5-2  Subtitling

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xmeml>
<xmeml version="5">
<sequence id="SampleSubtitles">
    <name>SampleSubtitles</name>
    <duration>219</duration>
    <rate>
        <ntsc>TRUE</ntsc>
        <timebase>30</timebase>
    </rate>
    <timecode>
        <rate>
            <ntsc>TRUE</ntsc>
            <timebase>30</timebase>
        </rate>
        <string>01:00:00;00</string>
        <frame>107892</frame>
        <source>source</source>
        <displayformat>DF</displayformat>
    </timecode>
    <media>
        <video>
            <track>
                <clipitem>
                <name>Rob Dialog</name>
                <duration>751</duration>
                <rate>
                <ntsc>TRUE</ntsc>
                <timebase>30</timebase>
                </rate>
                <in>0</in>
                <out>219</out>
                <start>0</start>
                <end>219</end>
                <file id="Rob Dialog1">
                <name>Rob Dialog</name>
                <pathurl>file://localhost/NTSC%20TutorialDance%20Shots/Rob%20Dialog</pathurl>
                    <media>
                        <video/>
                    </media>
                </file>
                </clipitem>
            </track>
            <track>
                <generatoritem>
                    <name>Text</name>
                    <duration>3600</duration>
                    <rate>
                        <ntsc>TRUE</ntsc>
                        <timebase>30</timebase>
                    </rate>
                    <in>1650</in>
                    <out>1784</out>
                    <start>0</start>
                    <end>134</end>
                    <enabled>TRUE</enabled>
                    <anamorphic>FALSE</anamorphic>
                    <alphatype>black</alphatype>
                    <effect id = "subtitle">// 1
                        <name>Text</name>
                        <effectid>Text</effectid>
                        <effectcategory>Text</effectcategory>
                        <effecttype>generator</effecttype>
                        <mediatype>video</mediatype>
                        <parameter>
                            <parameterid>str</parameterid>
                            <name>Text</name>
                            <value>If you look at the Lindy Hop&#13;you'll see a couple just moving</value>
                        </parameter>
                        <parameter>
                            <parameterid>fontname</parameterid>
                            <name>Font</name>
                            <value>Futura</value>
                        </parameter>
                        <parameter>
                            <parameterid>fontsize</parameterid>
                            <name>Size</name>
                            <valuemin>0</valuemin>
                            <valuemax>1000</valuemax>
                            <value>36</value></parameter>
                        <parameter>
                        <parameterid>fontstyle</parameterid>
                            <name>Style</name>
                            <valuemin>1</valuemin>
                            <valuemax>4</valuemax>
                            <valuelist>
                                <valueentry>
                                    <name>Plain</name>
                                    <value>1</value>
                                </valueentry>
                                <valueentry>
                                    <name>Bold</name>
                                    <value>2</value>
                                </valueentry>
                                <valueentry>
                                    <name>Italic</name>
                                    <value>3</value>
                                </valueentry>
                                <valueentry>
                                    <name>Bold/Italic</name>
                                    <value>4</value>
                                </valueentry>
                            </valuelist>
                            <value>3</value>
                        </parameter>
                        <parameter>
                        <parameterid>fontalign</parameterid>
                        <name>Alignment</name>
                        <valuemin>1</valuemin>
                        <valuemax>3</valuemax>
                        <valuelist>
                            <valueentry>
                                <name>Left</name>
                                <value>1</value>
                            </valueentry>
                            <valueentry>
                                <name>Center</name>
                                <value>2</value>
                            </valueentry>
                                <valueentry><name>Right</name>
                                <value>3</value>
                            </valueentry>
                        </valuelist>
                        <value>2</value>
                        </parameter>
                        <parameter>
                            <parameterid>fontcolor</parameterid>
                            <name>Font Color</name>
                            <value>
                                <alpha>255</alpha>
                                <red>255</red>
                                <green>255</green>
                                <blue>255</blue>
                            </value>
                        </parameter>
                        <parameter>
                        <parameterid>origin</parameterid>
                            <name>Origin</name>
                            <value>
                                <horiz>0</horiz>
                                <vert>0.34375</vert>
                            </value>
                        </parameter>
                    </effect>
                    <sourcetrack>
                        <mediatype>video</mediatype>
                    </sourcetrack>
                </generatoritem>
                <generatoritem>
                    <start>135</start>
                    <end>219</end>
                    <effect id ="subtitle2">// 2
                        <name>Text</name>
                        <effectid>Text</effectid>
                        <effectcategory>Text</effectcategory>
                        <effecttype>generator</effecttype>
                        <mediatype>video</mediatype>
                        <parameter>
                            <parameterid>str</parameterid>
                            <name>Text</name><value>They're constantly moving&#13;they're always on the go</value>
                        </parameter>
                    </effect>
                </generatoritem>
                <enabled>TRUE</enabled>
                <locked>FALSE</locked>
            </track>
        </video>
        <audio>     // 3
            . . .
        </audio>
    </media>
</sequence>
</xmeml>

Choosing Effect Parameters

Many effects have multiple parameters that offer a wide range of choices. Finding the right combination of settings for a desired effect can be a time-consuming task. To help an editor more quickly identify appropriate parameter settings, a developer can create a "parameter exploration" tool that quickly displays a range of alternative treatments for a clip in the Canvas.

The tool asks an editor to choose a clip and an effect, and then to specify the parameters to be varied and the increments for the variations. The tool then generates an interchange format document for import into Final Cut Pro.

Figure 5-1 shows what the tool might produce. In this case, the clip is a still frame and the applied effect is Color Corrector 3-way. The original clip (in the center) and six variations are displayed in the Canvas.

Figure 5-1  Multiple parameter variations in the Canvas
Multiple parameter variations in the Canvas

Listing 5-3 displays part of the interchange format document created by the tool. It shows two of the seven tracks. In particular, note these points:

At line numbered 1, the stillframe element indicates that the clip is a still frame.

At line numbered 2, duration is set to 2. (Note that for still frames, the value for duration indicates time in minutes, rather than the number of frames.)

Lines numbered 3 through 8 are the parameters in the effect that vary from clip to clip. In the second track, they change at lines numbered 11 through 16.

At line numbered 9, the clip is scaled to fit with the other clips in the Canvas window.

At line numbered 10, the horizontal and vertical settings for the Center parameter control the position of the clip in the Canvas. These values are changed for the second clip at line numbered 17.

Listing 5-3  Effect parameter settings

<track>  <!-- the first track -->
    <clipitem>
        <name>Faux Fur.jpg</name>
        <duration>3901</duration>
        <rate>
            <ntsc>TRUE</ntsc>
            <timebase>30</timebase>
        </rate>
        <in>1800</in>
        <out>2100</out>
        <start>0</start>
        <end>300</end>
        <stillframe>TRUE</stillframe>// 1
        . . .
        <file id="Faux Fur.jpg1">
            <name>Faux Fur.jpg</name>
            <pathurl>file://localhost/Faux%20Fur.jpg</pathurl>
            <duration>2</duration>
            <media>
                <video>
                    <duration>2</duration>// 2
                    <stillframe>TRUE</stillframe>
                    <samplecharacteristics>
                        <width>720</width>
                        <height>480</height>
                    </samplecharacteristics>
                </video>
            </media>
        </file>
        <filter>
            <enabled>TRUE</enabled>
            <start>-1</start>
            <end>-1</end>
            <effect id = "colorcorrector3way">
                <name>Color Corrector 3-way</name>
                <effectid>Color Corrector 3-way</effectid>
                <effectcategory>Color Correction</effectcategory>
                <effecttype>filter</effecttype>
                <mediatype>video</mediatype>
                <parameter>
                    <parameterid>dispmode</parameterid>
                    <name>Display Mode</name>
                    . . .
                    <value>1</value>
                </parameter>
                <parameter>
                    <parameterid>label1</parameterid>
                    <name>Blacks Controls</name>
                </parameter>
                <parameter>
                    <parameterid>blacklevel</parameterid>
                    <name>Level</name>
                    <valuemin>-196</valuemin>
                    <valuemax>254</valuemax>
                    <value>0</value>
                </parameter>
                <parameter>
                    <parameterid>b_hue</parameterid>
                    <name>Angle</name>
                    <valuemin>-180</valuemin>
                    <valuemax>180</valuemax>
                    <value>-33</value> // 3
                </parameter>
                <parameter>
                    <parameterid>b_mag</parameterid>
                    <name>Magnitude</name>
                    <valuemin>0</valuemin>
                    <valuemax>200</valuemax>
                    <value>0</value> // 4
                </parameter>
                <parameter>
                    <parameterid>label2</parameterid>
                    <name>Midrange Controls</name>
                </parameter>
                <parameter>
                    <parameterid>mids</parameterid>
                    <name>Level</name>
                    <valuemin>0</valuemin>
                    <valuemax>200</valuemax>
                    <value>100</value>
                </parameter>
                <parameter>
                    <parameterid>m_hue</parameterid>
                    <name>Angle</name>
                    <valuemin>-180</valuemin>
                    <valuemax>180</valuemax>
                    <value>-33</value> // 5
                </parameter>
                <parameter>
                    <parameterid>m_mag</parameterid>
                    <name>Magnitude</name>
                    <valuemin>0</valuemin>
                    <valuemax>200</valuemax>
                    <value>0</value> // 6
                </parameter>
                <parameter>
                    <parameterid>label3</parameterid>
                    <name>Highlight Controls</name>
                </parameter>
                <parameter>
                    <parameterid>highlights</parameterid>
                    <name>Level</name>
                    <valuemin>64</valuemin>
                    <valuemax>509</valuemax>
                    <value>255</value>
                </parameter>
                <parameter>
                    <parameterid>h_hue</parameterid>
                    <name>Angle</name>
                    <valuemin>-180</valuemin>
                    <valuemax>180</valuemax>
                    <value>-33</value> // 7
                </parameter>
                <parameter>
                    <parameterid>h_mag</parameterid>
                    <name>Magnitude</name>
                    <valuemin>0</valuemin>
                    <valuemax>200</valuemax>
                    <value>0</value> // 8
                </parameter>
                . . .  <!-- other parameter settings are defaults -->
            </effect>
        </filter>
        <filter>
            <effect id = "basicmotion">
                <name>Basic Motion</name>
                <effectid>basic</effectid>
                <effectcategory>motion</effectcategory>
                <effecttype>motion</effecttype>
                <mediatype>video</mediatype>
                <parameter>
                    <parameterid>scale</parameterid>
                    <name>Scale</name>
                    <valuemin>0</valuemin>
                    <valuemax>1000</valuemax>
                    <value>25</value> // 9
                </parameter>
                <parameter>
                    <parameterid>center</parameterid>
                    <name>Center</name>
                    <value>// 10
                        <horiz>-2.98023e-08</horiz>
                        <vert>-0.00524935</vert>
                    </value>
                </parameter>
            </effect>
        </filter>
        . . .
    </clipitem>
    <enabled>TRUE</enabled>
    <locked>FALSE</locked>
</track>
<track>  <!-- start of the second track -->
    <clipitem>
        . . .
        <filter>
            <enabled>TRUE</enabled>
            <start>-1</start>
            <end>-1</end>
            <effect id = "colorcorrector3way">
                . . .
                <parameter>
                    <parameterid>b_hue</parameterid>
                    <name>Angle</name>
                    <valuemin>-180</valuemin>
                    <valuemax>180</valuemax>
                    <value>-12</value> // 11
                </parameter>
                <parameter>
                    <parameterid>b_mag</parameterid>
                    <name>Magnitude</name>
                    <valuemin>0</valuemin>
                    <valuemax>200</valuemax>
                    <value>20</value>// 12
                </parameter>
                <parameter>
                    <parameterid>m_hue</parameterid>
                    <name>Angle</name>
                    <valuemin>-180</valuemin>
                    <valuemax>180</valuemax>
                    <value>-12</value> // 13
                </parameter>
                <parameter>
                    <parameterid>m_mag</parameterid>
                    <name>Magnitude</name>
                    <valuemin>0</valuemin>
                    <valuemax>200</valuemax>
                    <value>20</value>// 14
                </parameter>
 
                <parameter>
                    <parameterid>h_hue</parameterid>
                    <name>Angle</name>
                    <valuemin>-180</valuemin>
                    <valuemax>180</valuemax>
                    <value>-12</value> // 15
                </parameter>
                <parameter>
                    <parameterid>h_mag</parameterid>
                    <name>Magnitude</name>
                    <valuemin>0</valuemin>
                    <valuemax>200</valuemax>
                    <value>20</value> // 16
                </parameter>
            </effect>
        </filter>
        <filter>
            <effect id = "basicmotion">
                . . .
                <parameter>
                    <parameterid>center</parameterid>
                    <name>Center</name>
                    <value>// 17
                        <horiz>--0.275591</horiz>
                        <vert>-0.167979</vert>
                    </value>
                </parameter>
            </effect>
        </filter>
        . . .
    </clipitem>
    <enabled>TRUE</enabled>
    <locked>FALSE</locked>
</track>

Other Possibilities

Here are some other possible projects and tools based on the Final Cut Pro XML Interchange Format: