Skip to Content

Tools & Guidelines
Authoring Captions for Flash

Previous | ccPlayer Help Contents | ccPlayer Home

Choosing an authoring environment

There are a number of ways to create caption content. One factor to consider is how the captions will be stored. The following options are available for captions recognized by CCforFlash, ccPlayer, and ccMP3Player:

  • embedded in the FLV (CCforFlash and ccPlayer only)
  • external text file
  • internal text object (CCforFlash only)
If the caption information is to be embedded within the Flash video (FLV) file, use a special authoring program, such as Captionate. If the caption information is to be stored in an external text file or internal text object, the caption content will need to be structured in a timed-text format. The two current formats CCforFlash, ccPlayer and ccMP3Player recognize are:

If you are familiar with either of these formats, you can use a text editor to create the caption content yourself. However, it is extremely important that you use an editor that saves your file with UTF-8 encoding; otherwise, some characters may not display properly.

The difficulty with using a text editor is that you need to manually provide the timecodes which indicate when captions are to be displayed or, in some cases, erased. To help you calculate these timecodes, you could use a video player that displays the playback time. However, programs are available, such as the Media Access Generator (MAGpie), which combine a text editor with video playback to automate the process of setting display and erase times for captions.

Adding captions with MAGpie

Flash Video

Currently, MAGpie does not play back FLV video types. In order to caption Flash videos, save the movie in an intermediate format, such as .mov or .avi, and import that into MAGpie. Once the video has been captioned, the caption file can be exported in either the TTML or QTtext caption formats. The FLV video is then used for playback with the accompanying caption file.

MP3

While MAGpie will import an MP3 file for captioning, some users have noticed that after authoring the captions, the timing lags when played back in a Flash SWF or the ccMP3Player. The problem appears to be within MAGpie. The solution is to use QuickTime to convert your MP3 file to a .wav file and import that file into MAGpie. The exported caption file can then be used with the original MP3 file.

Flash SWF

Captions can only be synchronized to the timeline of Flash movies that are linear. At this time, MAGpie is unable to import Flash SWF file types. Flash does have an export to movie that allows the Flash movie to be exported as a QuickTime .mov file (or Windows .avi on the PC). The exported movie can then be imported into MAGpie.

Another, more time-consuming method, would be to author the captions in a text editor and determine the timing by dividing the frame number where the caption should appear by the frames per second of the movie. For example:

  • Caption to appear at frame 235
  • Frame rate of movie is 12 frames per second
  • Start time of the caption is 235/12 = 19.58 seconds

Styling captions

TTML-formatted captions can contain style settings globally in the <body>, <div> or <p> tags, or inline using the <span> tag. At this time, QTtext styles are only recognized globally. Inline QTtext styles are ignored.

Internal captions via ActionScript

In order to house the caption content inside ActionScript, all line breaks need to be removed from the caption content and any quotation marks should be escaped using the backslash. A sample of an internal TTML caption text string is shown below:



var _captStr:String="<?xml version="1.0" encoding="UTF-8"?><tt xml:lang="en" xmlns="http://www.w3.org/2006/04/ttaf1" xmlns:tts="http://www.w3.org/2006/04/ttaf1#styling"><head><styling><style id="b1" tts:fontWeight="normal" tts:color="#cccc00"/></styling></head><body><div xml:lang="en" style="b1"><p begin="00:01.00" end="00:03.00">The first caption.</p><p begin="00:03.00" end="00:05.00">The second caption.</p><p begin="00:06.00" end="00:10.00">The third caption.</p></div></body></tt>"


Caption-display options

Please note: The means to change the display option can only be done via the API of CCforFlash, ccPlayer or ccMP3Player.

Pop-on caption display option

The pop-on caption display mode is most widely used for Web-based video content. In this mode, each caption block replaces the preceding one. Captions can be any number of lines that will fit in the caption area, dependent on the style settings of the caption. If there is a long pause between captions, an end time may be added to clear the caption area sooner. All caption-storage options (embedded, external, and internal) are able to display pop-on captions.

Roll-up caption display option

The roll-up caption display option allows for captions to be displayed in a manner similar to that for live-broadcast television: each caption row is rolled up vertically as the next one below appears. In this mode, any end times or durations are ignored. Each caption is limited to a single line based on the style settings. The caption area is cleared by inserting a blank caption at the time when the display should be cleared. Embedded captions cannot be displayed in roll-up mode.

Last updated: September 28, 2011


Previous | ccPlayer Help Contents | ccPlayer Home