GuidesRealText and RealPix

RealText and RealPix

Developer.com content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.


RealNetworks’ has recently released the beta test version of its new G2 Player and Server system. G2 stands for Generation 2, and represents a major step forward for the company. With new system, RealNetworks has, for the first time, embraced open standards. The player is based on a plug-in architecture that allows for the relatively simple implementation of new media types without having to download a new version each time a that new protocol is supported. Currently the G2 player is only available for Windows, but RealNetworks has promised versions for Mac and Unix in the future.

Perhaps the most significant advancement is the support of XML. The final release of the G2 player will support SMIL, or Synchronized Multimedia Integration Language the XML extension for the presentation of time-based multimedia recently recommended by the World Wide Web Consortium. RealNetworks has also extended SMIL with two new media types: RealText and RealPix. Both are XML-based declarative document formats and allow sophisticated manipulation of text and image files. Both formats can be used on their own, or incorporated into a SMIL presentation. In addition to the ability to “stream” a preset list of text and images to a player, the G2 system allows the “broadcast” of updated content to connected players as will. This opens up possible applications such as up to the minute news headlines or real-time stock tickers combined with streaming audio and video presentations.

RealText

RealText markup is quite similar to HTML and uses many of the same text formatting tags. All contents of a RealText document are contained within the <window> tag and are stored in files with the .rt extension. There are four window types: generic (the default mode), ScrollingNews, TickerTape, Marquee, and TelePrompter. The markup is basically the same for all window types, the main difference is the mode of presentation. For the purpose of this article, we will work with the generic window type, which will allow the use of all the major tags. The G2 authoring guide is available for free from RealNetworks and covers all the window types in depth.

A generic .rt document, markup and all, is not much larger than its text content. For example, to create a presentation that displays a new line of text every 5 seconds looks like this:


The high railings of the Prospects rippled past their gaze.

This is quite simple, and not all that exciting. The use of the <clear/> tag in the next example, clears the window, and allows for a more dynamic presentation of the same text.


The high railings of the Prospects rippled past their gaze.

The <time/> tags allow control over when text appears in a presentation and the duration of its display. This allows for a greater level of control than the use of the <clear/> tag:


The high railings of the Prospects rippled past their gaze.

RealText supports appearance tags as well. Most of the basic HTML tags, like bold, italic, underline, are supported, as well as ordered and unordered lists and preformatted text. The <font/> tag supports font size, face, color, and background color.

Hyperlinks are also supported and can be used to link to another .rt file, launch a Web page in a browser window, execute a “mailto” command, or RealPlayer commands.

The final example incorporates a number of appearance tags and a hyperlink that launches a browser window and opens a Web page related to the text:


The high railings of the Prospects rippled
past their gaze.




RealPix

The RealPix markup format is very simple to create and very complex behaviors can be generated by very compact code. All contents of a RealPix document are contained within the <imfl> tag and are stored in files with the .rp extension. RealPix supports GIF, JPEG, STiNG, and bitmap image formats.

The first example is a 20 second long sequence of three JPEG images. It begins with a fade in from black, does a 5-millisecond crossfade between each image, and ends by fading to black.

The <head/> tag contains all the attributes of the presentation. In this case, the time format has been set to milliseconds. Time can also be specified in the

dd:hh:mm:ss.xyz
, where dd=days, hh=hours, mm=minutes, ss=seconds and xyz=milliseconds. Also specified in the <head/> is the minimum bitrate for the presentation, and the size of the canvas for the images.










The next presentation fleshes out the same presentation with a title, author and copyright information and a URL that allows a Web page to be launched in a browser window when the presentation is clicked on. All of these attributes are contained within the documents <head/>.

RealPix allows for a wide variety of transition effects, other than fades. The next example illustrates the use of the “push” wipe. The new transition code, which only required the changing of two lines, looks like this:




Effects can be applied to single images. The <viewchange/> tag allows for zoom and pan effects as shown in the next example.

The zoom in is accomplished with the following code:

The

x
and

y
coordinates of the source region to be enlarged are specified with the

srcx
and

srcy
. The

srcw
and

srch
tags specify the size of the section to be enlarged. At the end of this transition, the 160×120 source has been blown up to 320×240.

The panning is accomplished with the following code:

By changing the x-axis to 0, and keeping the dimensions the same, the image is panned to the left.

The images in this presentation have been modified with the JPEGTRAN utility included with the G2 authoring guide from RealNetworks. JPEGTRAN modifies the files for streaming so that packet loss has less destructive consequences for the image quality.

The examples in the article have only touched on the possibilities of these two media types. Many good examples are available on RealNetworks’ G2 showcase site. When combined with SMIL, RealText and RealPix can be used to create very sophisticated interactive multimedia presentations. Since presentations are created using distributed media, they are easy to update and maintain and their media content is reusable. Considering the installed base of over 1.5 million G2 players, and RealNetworks new commitment to open standards, these formats are realistic alternatives to proprietary technologies like Shockwave and PowerPoint.

John Maxwell Hobbs is a musician and has been working with computer multimedia for over fifteen years. He is currently in charge of multimedia development at Ericsson CyberLab New York. His interactive composition Web Phases was recently one of the winners of ASCI’s Digital ’98 competition and is currently on exhibit at the New York Hall of Science. He is also on the board of directors of Vanguard Visions, an organization dedicated to fostering the work of artists experimenting with technology. He is the former producing director for The Kitchen in New York City.


Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Latest Posts

Related Stories