Captioning for RealPlayer
Creating a RealText File

Introduction

RealPlayer uses SMIL to combine media content with a RealText (.rt) file. The .rt file contains the captions themselves and information about how and when they should appear. The SMIL file is really just a pointer file. It contains information about where and how your captions and media content should display.

RealText and video are combined with SMIL and sent to RealPlayer

How RealText Works

RealText files are text files that have an .rt extension. They can be created using a text editor or MAGpie. If you're a MAGpie user, be sure to read our MAGpie tips. Here's a sample RealText file:

<window bgcolor="000000" duration="05.15">
<font size="+1" face="Arial" color="#FFFFFF">
<time begin="0"/>
<clear/>
<center>
Dorothy: Toto, I don't think we're in Kansas anymore.
</center>
<time begin="03.2"/>
<clear/>
<i>[barking]</i>
<time begin="00:00:05.15"/>
<clear/>
</font>
</window>

View this RealText caption file (RealPlayer required)

RealText is structured very similarly to HTML. In fact, several HTML tags are allowed in RealText and may be used to format the way text appears. RealText is based on XML and is not case sensitive.

Let's take a look at the example RealText file a little more closely.

<window>

The <window> tag contains properties for the entire captions window or area. Bgcolor is the background color for the area. This is typically black. Colors can be defined as color names or RGB values. The duration value should be equal to the duration of the media clip that is being captioned. Duration times in RealText can be expressed several ways. By default, any numbers added will be interpreted as seconds. 03.2 represents 3.2 seconds. You can also use the following:

  • h - Hours. Example [2.5h = 2 hours, 30 minutes]
  • min - Minutes. Example [2.75min = 2 minutes, 45 seconds]
  • s - Seconds. Example [15.55s = 15 seconds, 550 milliseconds]
  • ms - Milliseconds. Example [670.2ms = 670.2 milliseconds]

You can also express time attributes in a hh:mm:ss.xy format. 00:00:05.15 from the example above, represents 0 hours (the first two numbers), 0 minutes (the second set of numbers), 5 seconds (the third set of numbers) and 15/100ths of a second.

You can also add width and height values for the RealText file, though we'll be using SMIL to set this up later. The window tag must be closed at the end of the RealText file.

<font>

This tag defines what your text will look like. Size can be in whole numbers or relative numbers. Sizes work the same as in HTML. Size=3 would be about 12 point. For accessibility reasons, you should use relative font sizes. +1 is usually the best for most captions. You can also define the font face - sans serif fonts like Helvetica and Arial usually display the best and are easiest to read.

The color property defines the color of the text. It is usually set to white when the background is black. Ensure that there is plenty of contrast. Notice that the # sign is optional in color values. You can also use several HTML color names (i.e., red, etc.). The font tag must be closed.

<time/>

The time tag indicates the beginning of a new caption. The begin value should be equal to the elapsed time in the movie where you want the caption to appear. Your first caption should always begin at 0. Notice the /> at the end. This is the standard way of closing some XML tags. The time tag does not have a matching closing tag.

<clear/>

This tag is used to clear the caption display to make room for a new caption. If you do not clear the caption area, the captions will continue displaying on consecutive lines until they are no longer visible.

<center>

Most captions are centered. Use this tag to center the captions. If all of your captions are centered, you can surround all of the time tags with the center tags. Captions that are not surrounded with the <center> tag will be left-aligned.

Creating a RealText File

You can create the caption file using any text editor, MAGpie, or Hi-Caption. Because of the complexity of RealText files, it is usually best to use a captioning program like MAGpie to enter caption times. If you are a MAGpie user, be sure to read our MAGpie suggestions. You can, however, create the RealText file in any text editor. It is a standard text file with the .rt file extension. The following will help you create a standard SAMI file without any special formatting.

Instructions

  1. Open a text editor, such as Notepad or SimpleText.
  2. It is easiest to start with a standard template, so copy and paste our example from above or download our sample (Right click > Save Target As). If you double click a RealText file, it will probably open in RealPlayer. To edit the RealText file, open it in your text editor (File > Open).
  3. Now that you have a template, make any formatting changes that you would like to the window and font tags. You must use correct HTML formatting. Our template contains the most common formatting for web captions. Enter the duration of your media clip in the duration line of the window tag.
  4. Save your file as filename.rt. Be sure it is saved as a text file type with the .rt extension.
  5. Add several empty time tags before beginning. This makes it so you don't have to retype the code that repeats for each caption. Use copy and paste to make this easier. Copy this:
    <time begin="0"/><clear/>
    <center>
    </center>

    and paste it multiple times inside of the <font> and </font> tags.
  6. Open the media file you want to caption in RealPlayer.
  7. Press play and review it until there is a logical breaking point in the dialog after a sentence or so and press pause. You may have to press forward or rewind, or use the time slider to be more accurate.
  8. Enter the text that you want to display for the caption between the first two center tags. Your file should contain something like this:
    <time begin="0"/><clear/>
    <center>I am the first line of captions.
    </center>
  9. Before you review the next section of your media file in RealPlayer, enter the begin value for the next time tag. The next section of text will begin where the first caption ends, so enter the start value for the next caption now, before reviewing what its text will be. Remember that each time tag specifies the beginning of a new caption. RealPlayer does not display fractions of a second (it only displays minutes and seconds), so you will have to guess where the breaking point is in fractions of a second (or ignore fractions of a second all together and just round to the nearest second). Use the slider to give you a better idea. If the break is about half way between two seconds, enter .50 (or half a second). If it is nearer to the next second, enter something like .80. You do not have to be totally accurate. Sometimes you will adjust times up or down slightly based on the length of the caption. If your second caption starts about halfway between 4 and 5 seconds into the movie, enter 4.5 for the second time tag's beginning value.
  10. Press play in RealPlayer and find the next breaking point.
  11. Enter the text you just reviewed to the area between the center tags for the time tag for which you just added the begin value. Add the time for the next caption and repeat this process for the entire media clip.
  12. Your last time code should have a value that is the same as the duration value and it should contain only a <clear/> tag so nothing displays. RealPlayer will never cut off your captions or media clip if one is shorter than the other. It will play until the longest one is over. Making both of them the same length will ensure that everything works correctly.
  13. Make sure that you have the proper formatting, text, and that there are no mistakes in the RealText code.
  14. Save your file in the text editor, then open it in RealPlayer by double clicking the file or selecting File > Open in RealPlayer. Make sure that the captions look right. If you get an error when opening the file in RealPlayer, it probably means that there is an error in the RealText code.

Advice for RealText files

  • Clean up your RealText files if you create them with MAGpie. (Read the Instructions for cleaning up RealText files.)
  • Use relative values for font sizes. This will make captions more accessible to those with visual disabilities. +1 is usually okay.

You can do some amazing things with RealText files, including scrolling and ticker tape captions, adding links, positioning captions, and controlling the player. Learn how at RealText Authoring Guide - external link.

Although most captions use generic formatting, you can also use the following formatting styles (select the links to view the caption types in RealPlayer):

  • Generic - A generic window with a text display in it. Captions are typically replaced by the next caption.
  • ScrollingNews - The text scrolls from the bottom to the top of the window at a constant rate.
  • TickerTape - The text is displayed next to the window's top or bottom edge and loops from right to left.
  • Marquee - It loops like the TickerTape, but the text is vertically centered within the window.
  • TelePrompter - Text arriving at the bottom edge of the window pushes the text above it up so a new line may be displayed.

Suggestions for MAGpie Users

If you use MAGpie to create your RealText files (which is the way we suggest doing it), you will save a lot of time over creating the file manually, but there are a few things you will want to know.

  • MAGpie 1.0 enters a font size of 1 for your RealText file. This is nearly unreadable. MAGpie 2 adds an absolute font size. I suggest using a relative value of +1 for your font size. This way the font will scale based on the user's default font settings and will be more accessible to those who may have low vision.
  • MAGpie 1.0 enters <br> tags at the end of each line, even if it is the last or only line in the caption display. <br> tags at the end of the each caption section can be removed.
  • You don't have to add a <clear/> tag to clear out each caption display before starting a new one. If captions are short, you can display more than one at a time. If the captions are short, you can remove the <clear/> tag to give the user more time to read them. You can enter a <clear/> tag after three or four lines of captioning.
  • MAGpie 2.0 positions text formatting tags for your entire RealText file within the first <time> tag and sometimes scattered throughout your RealText file. If all of your captions have the same style, then you can just use one set of formatting tags before the first <time> tag and remove all other formatting tags from your RealText file.

Sample RealText File

Here is an example of the shell that we use for all of our captioning.

<window bgcolor="000000" wordwrap="true" duration="00:00:02.00">
<font size="+1" face="Arial" color="#FFFFFF">
<center>
<time begin="00:00:00.00"/><clear/>
First caption here.
<time begin="00:00:01.00"/><clear/>
Final caption here.
<time begin="00:00:02.00"/><clear/>
</center>
</font>
</window>

The duration property of the <window> tag should be set to the length of your media file. Make sure your first <time> tag is set to 00:00:00.00 and your final <time> tag is empty and has the same value as the duration property.

WebAIM is an initiative of:
Center for Persons with Disabilities (CPD) Utah State University