Subtitles

A subtitle text file contains line by line listings of each subtitle in a video. Subtitles are used to display text at a specific time in a video. If the video will not have subtitles, you may skip ahead to the next section; however, it is still advised to read this section to understand how subtitles are added to a video.

Multiple subtitle files are allowed — one file per subtitle track. This allows for the creation of a subtitle file for each language, as some languages may require different start and end times due to the lengths of the subtitles in that language and the time it takes to read.

  1. Select the Subtitle track to be used by selecting a track from the drop down next to Subtitle Text. Up to 15 tracks are available — Tracks 0-14.
  2. Press the browse button to select the subtitle text file to be used on that track.

Figure 5: Choose a subtitle track and browse for a file.

The first line of the subtitle file (other than any comment lines) should contain the display interval in milliseconds (typically 1000). This value is as a base for determining the start and end times of each subtitle. Each line following the first includes three pieces of information: The start time, the end time, and the message ID. The message ID will be used in code to display the appropriate string of text. Alternatively, this parameter could be used as the actual string to be displayed as the subtitle. For a detailed explanation on how to use subtitles in Flash files, please refer to Getting Started: Working with Videos in ActionScript.

Single Line Subtitle Format

start time, end time, messageID

Contents of an Example Subtitle.txt File

1000
2000, 5000, This is the first subtitle.
8000, 11000, subtitleId2

Re-encoding the Sample Video with Subtitles

  1. Open the Scaleform Video Encoder.
  2. Load C:\Program Files\Autodesk\Scaleform\GFx SDK 4.6\Bin\Tools\VideoEncoder\sample.avi
  3. Press the browse button next to the Cue Point File text field, and locate and load the file sample_cue_points.txt – this file is found in the same location as sample.avi
  4. Press the browse button next to the text field directly below the Subtitle Text dropdown, and locate and load the file sample_subtitles.txt — this file is found in the same location as sample.avi.
  5. Press Encode to begin encoding the sample movie with default settings.
  6. When the encoding process completes successfully, launch the Scaleform Player from your desktop shortcut (Scaleform Media Player) and then drag and drop the file getting_started_with_video_tutorial.swf onto it.
  7. Take note of the subtitles as they are displayed at the bottom of the video in the video player. They should occur at 2-5 seconds and again at 8-11 seconds.