Overview of the Final Cut Pro XML Interchange Format

The Final Cut Pro XML Interchange Format was designed to describe every element in a Final Cut Pro project in a human-readable, XML-based format. Final Cut Pro can import and export this format, opening a world of possibilities limited only by your ability to generate and process XML documents.

Because Final Cut Pro supports XML, you are no longer limited to creating clips, bins, and sequences within Final Cut Pro. You can create your own Final Cut Pro projects outside of Final Cut Pro, using any software or platform you want, as long as you generate a valid Final Cut Pro XML file. Even if you don’t want to create Final Cut Pro XML from scratch, you can practice working with Final Cut Pro XML by exporting a clip or sequence to an XML file, opening it in a text editing application, making minor modifications, and then importing the modified XML file back into Final Cut Pro.

For example, if you have 100 clips that all have “Koffee House” in the name, and you want to change the names to “Coffee House,” you can export the clips to Final Cut Pro XML, open the XML file in a text editing application, find “Koffee” and replace with “Coffee,” and then import the resulting XML file back into Final Cut Pro.

You may also want to use XML when working with text generators or superimposed graphics. For example: You have a sequence with hundreds of subtitle text generators, and you want to subtly change the color or position of each subtitle. Manually moving each subtitle in Final Cut Pro would be extremely time-consuming. Instead, you can export the sequence as XML and then find and replace all of the positional parameters or color settings at once.

These examples are only the beginning. You can also change clip In and Out points, change the order of clips in sequences, or modify effect parameters. The more you experiment, the more potential you will discover for modifying Final Cut Pro elements using XML.

Main Final Cut Pro XML Elements

This section describes some of the main elements of the Final Cut Pro XML Interchange Format. Here is an example of a simple Final Cut Pro XML file. The code below represents a Browser clip whose media file is offline.

<?xml version=”1.0” encoding=”UTF-8”?>
<!DOCTYPE xmeml>
<xmeml version=”4”>
<clip>
<name>Coffee house wide shot</name>
<duration>362</duration>
<rate>
<ntsc>TRUE</ntsc>
<timebase>30</timebase>
</rate>
</clip>
</xmeml>

An explanation of the sample code above follows.

Every Final Cut Pro XML file requires the first three elements:

  • <?xml> element: This defines the document as an XML file. The example above shows an <?xml> element with two attributes: version and encoding.
  • <!DOCTYPE> element: Every XML document requires a Document Type Definition, or DTD. The DTD for the Final Cut Pro XML Interchange File Format is called xmeml.
  • <xmeml> element: This is the root element of every Final Cut Pro XML file. Every document should end with a closing </xmeml> tag.

The <clip> element defines a Browser clip in Final Cut Pro. The <clip> element above contains the following elements:

  • <name> element: This is the name of the clip.
  • <duration> element: This is the duration of the clip, in frames.
  • <rate> element: This is the frame rate of the clip. The <rate> element contains a <timebase> element that determines the clip’s frame rate and an <ntsc> element that determines whether the clip frame rate is actually 29.97 fps or 30 fps.

For a complete list of Final Cut Pro XML Interchange Format elements, see the documentation for the Final Cut Pro XML Interchange Format at http://developer.apple.com/appleapplications.

Example: Creating an XML File and Importing It into Final Cut Pro

Final Cut Pro always exports verbose XML, which means that every element and subelement is included. However, when you import XML, Final Cut Pro accepts sparse XML, which means that you only need to provide a limited number of required elements: you can create fairly terse XML, and Final Cut Pro fills in missing information with default information.

To create an XML file and import it into a Final Cut Pro project
  1. Open a text editing application such as TextEdit.

    Note: This example assumes you are using TextEdit, the built-in text editing application that comes with Mac OS X. TextEdit is located in the Applications folder on your hard disk.

  2. If a new window doesn’t already exist, choose File > New (or press Command-N).

  3. Type or copy and paste sample XML code into the new TextEdit window.

    Errors in XML code will result in errors during import. Make sure you type carefully and check your work.

  4. Choose Format > Make Plain Text (or press Command-Shift-T).

    This ensures that your file is saved as a plain text file, not a Rich Text Format (RTF) file. The file extension should become .txt.

  5. Choose File > Save.

  6. In the Save dialog, navigate to the Desktop.

  7. Name the file “example.xml,” then click Save.

    If you receive a message about appending .txt to the end of the filename, click Don’t Append.

  8. Open Final Cut Pro.

  9. Close any open projects, then choose File > New Project (or press Command-Shift-N).

  10. Choose File > Import > XML, navigate to “example.xml,” and click Choose.

    The Import XML window appears.

  11. Choose the current project name from the Destination pop-up menu.

  12. Leave all other settings as they are currently set, then click OK.

    A new offline clip named “Coffee house wide shot” appears in the Browser.

If you receive an error message, you should reopen your XML file in TextEdit to make sure you entered the sample code correctly. Simple typos, such as mismatched beginning and ending tags, can cause the error “XML translation was aborted due to a critical error.” Also, make sure your file is a plain text file, not an RTF file.