previous next

Chapter 16: Transition Effects

You can enhance your presentation's appeal by adding visual effects that occur when any type of visual clip starts or stops. With more than a hundred transition effects available, your streaming presentation can include special effects found in professional video production. You can also use transition effects to create a streaming slideshow from still images.

Understanding Transition Effects

A transition occurs every time a clip starts or stops playing. If you do not use a transition effect, the clip simply appears when it starts playing and, depending on its fill attribute, disappears when it stops playing. Using transition effects makes these transitions more visually compelling. Instead of just appearing onscreen, the clip might slowly fade in from a solid color. Or, a five-point star might expand from the center of a region to reveal the clip. Instead of just disappearing when it stops playing, a clip might crossfade into the clip that plays next.

Examples of Transition Effects

Examples of Transition Effects

Timelines and Transition Effects

By default, each transition lasts one second, but you can make a transition last any length of time. Using transition effects does not affect a presentation's timeline. For example, a two-second transition applied to the end of a clip occurs during the last two seconds that the clip plays. If it is applied to the beginning of the clip, it occurs during the first two seconds of playback.

For More Information: For instructions on doing this, see "Setting a Transition Effect's Duration".

Layouts and Transition Effects

You can use a transition effect with any visual clip regardless of the layout you've defined, or whether another clip precedes or follows the clip that uses the effect. When a clip starts, the area it covers is treated as its background, whether that area is a region color, a clip in another region, or a clip in the same region. A transition effect simply introduces the clip over, or removes the clip from, its background. So when you use transitions with a sequence of clips, the clips do not have to be the same size.

Animations and Transition Effects

Transition effects are distinct from the SMIL animations described in Chapter 17. A transition effect is a special effect that occurs when a clip starts or stops playing. An animation, on the other hand, is a special effect that occurs while a clip plays. You can use both transition effects and animations in the same presentation. You can even apply them to the same clip. But you define them separately.

Audio and Transition Effects

A transition effect does not change a clip's audio level. If you slowly fade into a video, for example, the audio plays normally throughout the fade. You can change a clip's audio level, however, by animating the clip region's soundLevel attribute. See "Controlling Audio Volume in a Region" for information about soundLevel. Chapter 17 describes SMIL animations.

Multiple Clips with Transition Effects

Transition effects are applied to individual clips. Two clips playing in separate regions might end at the same time and use the same transition effect, such as a wipe transition that travels from left to right. In this case, two separate wipe transitions occur, one for each clip. Each transition effect is confined to the region in which the clip plays. You cannot make a single transition effect apply to both clips. For example, you cannot make the left-to-right wipe effect travel across the entire root-layout area, ushering in a new clip to each region as it passes over the region.

Summary of Transition Effects Tags

The following SMIL sample illustrates the functions and relationships of the tags used to create transition effects. The remainder of this chapter describes how to use these tags and their attributes to define and apply transition effects:

<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
<head>
<transition id="ID1" ...defines a transition type and duration.../>
<transition id="ID2" ...defines a transition type and duration.../>
...
</head>
<body>
<seq>
<ref src="..." transIn="ID1" ...assigns a transition for the clip beginning.../>
<ref src="..." transOut="ID2" ...assigns a transition for the clip end.../>
...
</seq>
</body>
</smil>

Defining Transition Types

The SMIL file header section defines the transition effects your presentation uses. The following example defines three transition effects after the layout:

<head>
<layout>
...layout defined here...
</layout>
<transition id="fade1" type="fade" subtype="crossfade"/>
<transition id="wipe1" type="pushWipe" subtype="fromTop"/>
<transition id="rad1" type="radialWipe" subtype="counterTopBottom"/>
</head>

Each transition is defined by a separate <transition/> tag that typically has at least three attributes, which are described in the following table.

Basic Transition Effects Attributes
Attribute Function
id Sets a unique ID used to assign the transition to clips. For rules about creating IDs, see "SMIL Tag ID Values".
type Identifies a group of transition effects. This attribute is required.
subtype Determines which member of the transition type group is used.

The following sections describe the various types and subtypes for transition effects. For convenience, the transition effects are grouped in families that share broad similarities, such as edge wipes and iris wipes. In defining a transition, you specify only the type and subtype, however.

Note: Most transitions listed in the following sections have an SMPTE (Society of Motion Picture and Television Engineers) code. This code is provided for persons who want to find the SMIL transition effect that corresponds to a specific SMPTE transition. SMPTE codes are not used when defining SMIL transition effects, though.

Tip: To display samples of transition effects in RealPlayer, get the zipped HTML version of this guide as described in "How to Download This Guide to Your Computer".

Edge Wipe Transition Effects

In the edge wipe family, an "edge" moves over the first clip, revealing the second clip. As an analogy, imagine a car covered with snow. As the windshield wiper moves, its edge reveals the underlying windshield. In these transitions, the edge may be different shapes, such as a straight line, a wedge, or a zigzag. The first subtype listed for each type in the following table is the default.

Edge Wipe Transition Effects
Type Subtype SMPTE Transition Appearance
barWipe leftToRight 1 A bar moves from left to right.
topToBottom 2 A bar moves from top to bottom.
boxWipe topLeft 3 A box expands from the upper-left corner to the lower-right corner.
topRight 4 A box expands from the upper-right corner to the lower-left corner.
bottomRight 5 A box expands from the lower-right corner to the upper-left corner.
bottomLeft 6 A box expands from the lower-left corner to the upper-right corner.
topCenter 23 A box expands from the top edge's midpoint to the bottom corners.
rightCenter 24 A box expands from the right edge's midpoint to the left corners.
bottomCenter 25 A box expands from the bottom edge's midpoint to the top corners.
leftCenter 26 A box expands from the left edge's midpoint to the right corners.
fourBoxWipe cornersIn 7 A box shape expands from each of the four corners toward the center.
cornersOut 8 A box shape expands from the center of each quadrant toward the corners of each quadrant.
barnDoorWipe vertical 21 A central, vertical line splits and expands toward the left and right edges.
horizontal 22 A central, horizontal line splits and expands toward the top and bottom edges.
diagonalBottomLeft 45 A diagonal line from the lower-left to upper-right corners splits and expands toward the opposite corners.
diagonalTopLeft 46 A diagonal line from upper-left to lower-right corners splits and expands toward the opposite corners.
diagonalWipe topLeft 41 A diagonal line moves from the upper-left corner to the lower-right corner.
topRight 42 A diagonal line moves from the upper right corner to the lower-left corner.
bowTieWipe vertical 43 Two wedge shapes slide in from the top and bottom edges toward the center.
horizontal 44 Two wedge shapes slide in from the left and right edges toward the center.
miscDiagonalWipe doubleBarnDoor 47 Four wedge shapes split from the center and retract toward the four edges.
doubleDiamond 48 A diamond connecting the four edge midpoints simultaneously contracts toward the center and expands toward the edges.
veeWipe down 61 A wedge shape moves from top to bottom.
left 62 A wedge shape moves from right to left.
up 63 A wedge shape moves from bottom to top.
right 64 A wedge shape moves from left to right.
barnVeeWipe down 65 A "V" shape extending from the bottom edge's midpoint to the opposite corners contracts toward the center and expands toward the edges.
left 66 A "V" shape extending from the left edge's midpoint to the opposite corners contracts toward the center and expands toward the edges.
up 67 A "V" shape extending from the top edge's midpoint to the opposite corners contracts toward the center and expands toward the edges.
right 68 A "V" shape extending from the right edge's midpoint to the opposite corners contracts toward the center and expands toward the edges.
zipZagWipe leftToRight 71 A zigzag shape moves from left to right.
topToBottom 72 A zigzag shape moves from top to bottom.
barnZigZagWipe vertical 73 The vertical, central line splits in a zigzag pattern and moves toward the left and right edges.
horizontal 74 The horizontal, central line splits in a zigzag pattern and moves toward the top and bottom edges.

View it now! (requirements for viewing this sample)
These samples show all edge wipe transition effects run in the forward and reverse directions.

Iris Wipe Transition Effects

A transition effect in the iris wipe family reveals a clip through an expanding shape. For example, a star can expand from the center of the transition area to reveal a new clip. The first subtype listed for each type in the following table is the default.

Iris Wipe Transition Effects
Type Subtype SMPTE Transition Appearance
irisWipe rectangle 101 A rectangle expands from the center.
diamond 102 A four-sided diamond expands from the center.
triangleWipe up 103 A triangle pointed toward the top edge expands from the center.
right 104 A triangle pointed toward the right edge expands from the center.
down 105 A triangle pointed toward the bottom edge expands from the center.
left 106 A triangle pointed toward the left edge expands from the center.
arrowHeadWipe up 107 An arrowhead shape pointed toward the top edge expands from the center.
right 108 An arrowhead shape pointed toward the right edge expands from the center.
down 109 An arrowhead shape pointed toward the bottom edge expands from the center.
left 110 An arrowhead shape pointed toward the left edge expands from the center.
pentagonWipe up 111 A pentagon pointed toward the top edge expands from the center.
down 112 A pentagon pointed toward the bottom edge expands from the center.
hexagonWipe horizontal 113 A hexagon with flat sides at top and bottom expands from the center.
vertical 114 A hexagon with flat sides at left and right expands from the center.
ellipseWipe circle 119 A circle expands from the center.
horizontal 120 A horizontal ellipse expands from the center.
vertical 121 A vertical ellipse expands from the center.
eyeWipe horizontal 122 An eye shape, its corners pointing left and right, expands from the center.
vertical 123 An eye shape, its corners pointing up and down, expands from the center.
roundRectWipe horizontal 124 A horizontal rectangle with rounded corners expands from the center.
vertical 125 A vertical rectangle with rounded corners expands from the center.
starWipe fourPoint 127 A four-pointed star expands from the center.
fivePoint 128 A five-pointed star expands from the center.
sixPoint 129 A six-pointed star expands from the center.
miscShapeWipe heart 130 A heart shape expands from the center.
keyhole 131 A keyhole shape expands from the center.

View it now! (requirements for viewing this sample)
These samples show all iris wipe transition effects run in the forward and reverse directions.

Clock Wipe Transition Effects

The clock wipe family includes transition effects in which a clip is revealed by a radial sweep, similar to the second hand sweeping around the face of a clock. The first subtype listed for each type in the following table is the default.

Clock Wipe Transition Effects
Type Subtype SMPTE Transition Appearance
clockWipe clockwiseTwelve 201 A radial hand sweeps clockwise from the twelve o'clock position.
clockwiseThree 202 A radial hand sweeps clockwise from the three o'clock position.
clockwiseSix 203 A radial hand sweeps clockwise from the six o'clock position.
clockwiseNine 204 A radial hand sweeps clockwise from the nine o'clock position.
pinWheelWipe twoBladeVertical 205 Two radial hands sweep clockwise from the twelve and six o'clock positions.
twoBladeHorizontal 206 Two radial hands sweep clockwise from the nine and three o'clock positions.
fourBlade 207 Four radial hands sweep clockwise.
fanWipe centerTop 211 A fan unfolds from the top edge, the fan axis at the center.
centerRight 212 A fan unfolds from the right edge, the fan axis at the center.
top 231 A fan unfolds from the bottom, the fan axis at the top edge's midpoint.
right 232 A fan unfolds from the left, the fan axis at the right edge's midpoint.
bottom 233 A fan unfolds from the top, the fan axis at the bottom edge's midpoint.
left 234 A fan unfolds from the right, the fan axis at the left edge's midpoint.
doubleFanWipe fanOutVertical 213 Two fans, their axes at the center, unfold from the top and bottom.
fanOutHorizontal 214 Two fans, their axes at the center, unfold from the left and right.
fanInVertical 235 Two fans, their axes at the top and bottom, unfold from the center.
fanInHorizontal 236 Two fans, their axes at the left and right, unfold from the center.
singleSweepWipe clockwiseTop 221 A radial hand sweeps clockwise from the top edge's midpoint.
clockwiseRight 222 A radial hand sweeps clockwise from the right edge's midpoint.
clockwiseBottom 223 A radial hand sweeps clockwise from the bottom edge's midpoint.
clockwiseLeft 224 A radial hand sweeps clockwise from the left edge's midpoint.
clockwiseTopLeft 241 A radial hand sweeps clockwise from the upper-left corner.
counterClockwiseBottomLeft 242 A radial hand sweeps counter-clockwise from the lower-left corner.
clockwiseBottomRight 243 A radial hand sweeps clockwise from the lower-right corner.
counterClockwiseTopRight 244 A radial hand sweeps counter-clockwise from the upper-right corner.
doubleSweepWipe parallelVertical 225 Two radial hands sweep clockwise and counter-clockwise from the top and bottom edges' midpoints.
parallelDiagonal 226 Two radial hands sweep clockwise and counter-clockwise from the left and right edges' midpoints.
oppositeVertical 227 Two radial hands attached at the top and bottom edges' midpoints sweep from right to left.
oppositeHorizontal 228 Two radial hands attached at the left and right edges' midpoints sweep from top to bottom.
parallelDiagonalTopLeft 245 Two radial hands attached at the upper-left and lower-right corners sweep down and up.
parallelDiagonalBottomLeft 246 Two radial hands attached at the lower-left and upper-right corners sweep down and up.
saloonDoorWipe top 251 Two radial hands attached at the upper-left and upper-right corners sweep down.
left 252 Two radial hands attached at the upper-left and lower-left corners sweep to the right.
bottom 253 Two radial hands attached at the lower-left and lower-right corners sweep up.
right 254 Two radial hands attached at the upper-right and lower-right corners sweep to the left.
windshieldWipe right 261 Two radial hands attached at the midpoints of the top and bottom halves sweep from right to left.
up 262 Two radial hands attached at the midpoints of the left and right halves sweep from top to bottom.
vertical 263 Two sets of radial hands attached at the midpoints of the top and bottom halves sweep from top to bottom and bottom to top.
horizontal 264 Two sets of radial hands attached at the midpoints of the left and right halves sweep from left to right and right to left.

View it now! (requirements for viewing this sample)
These samples show all clock wipe transition effects run in the forward and reverse directions.

Matrix Wipe Transition Effects

The matrix wipe family includes transition effects in which a clip is revealed by a series of sequential tiles that follow a pattern, such as a spiral. In the following table, the first subtype listed for each type is the default.

Matrix Wipe Transition Effects
Type Subtype SMPTE Transition Appearance
snakeWipe topLeftHorizontal 301 Tiles move in a horizontal zigzag from the upper-left corner.
topLeftVertical 302 Tiles move in a vertical zigzag from the upper-left corner.
topLeftDiagonal 303 Tiles move in a diagonal zigzag from the upper-left corner.
topRightDiagonal 304 Tiles move in a diagonal zigzag from the upper-right corner.
bottomRightDiagonal 305 Tiles move in a diagonal zigzag from the lower-right corner.
bottomLeftDiagonal 306 Tiles move in a diagonal zigzag from the lower-left corner.
spiralWipe topLeftClockwise 310 Tiles spiral clockwise from the upper-left corner.
topRightClockwise 311 Tiles spiral clockwise from the upper-right corner.
bottomRightClockwise 312 Tiles spiral clockwise from the lower-right corner.
bottomLeftClockwise 313 Tiles spiral clockwise from the lower-left corner.
topLeftCounterClockwise 314 Tiles spiral counter-clockwise from the upper-left corner.
topRightCounterClockwise 315 Tiles spiral counter-clockwise from the upper-right corner.
bottomRightCounterClockwise 316 Tiles spiral counter-clockwise from the lower-right corner.
bottomLeftCounterClockwise 317 Tiles spiral counter-clockwise from the lower-left corner.
parallelSnakesWipe verticalTopSame 320 Tiles move in two vertical zigzags, lines headed the same direction, starting from the upper-left and upper-right corners.
verticalBottomSame 321 Tiles move in two vertical zigzags, lines headed the same direction, starting from the lower-left and lower-right corners.
verticalTopLeftOpposite 322 Tiles move in two vertical zigzags, lines headed opposite directions, starting from the upper-left and lower-right corners.
verticalBottomLeftOpposite 323 Tiles move in two vertical zigzags, lines headed opposite directions, starting from the lower-left and upper-right corners.
horizontalLeftSame 324 Tiles move in two horizontal zigzags, lines headed the same direction, starting from the upper-left and lower-left corners.
horizontalRightSame 325 Tiles move in two horizontal zigzags, lines headed the same direction, starting from the upper-right and lower-right corners.
horizontalTopLeftOpposite 326 Tiles move in two horizontal zigzags, lines headed opposite directions, starting from the upper-left and lower-right corners.
horizontalTopRightOpposite 327 Tiles move in two horizontal zigzags, lines headed opposite directions, starting from the upper-right and lower-left corners.
diagonalBottomLeftOpposite 328 Two tile zigzags move outward in opposite directions from the diagonal line connecting the lower-left and upper-right corners.
diagonalTopLeftOpposite 329 Two tile zigzags move outward in opposite directions from the diagonal line connecting the upper-left and lower-right corners.
boxSnakesWipe twoBoxTop 340 Two lines of tiles spiral inward, starting in the upper corners and moving vertically.
twoBoxBottom 341 Two lines of tiles spiral inward, starting in the lower corners and moving vertically.
twoBoxLeft 342 Two lines of tiles spiral inward, starting in the left corners and moving horizontally.
twoBoxRight 343 Two lines of tiles spiral inward, starting in the right corners and moving horizontally.
fourBoxVertical 344 Four lines of tiles spiral inward, starting in the four corners and moving vertically.
fourBoxHorizontal 345 Four lines of tiles spiral inward, starting in the four corners and moving horizontally.
waterfallWipe verticalLeft 350 Tiles cascade vertically from the left in a waterfall effect.
verticalRight 351 Tiles cascade vertically from the right in a waterfall effect.
horizontalLeft 352 Tiles cascade horizontally from the left in a waterfall effect.
horizontalRight 353 Tiles cascade horizontally from the right in a waterfall effect.

View it now! (requirements for viewing this sample)
These samples show all matrix wipe transition effects run in the forward and reverse directions.

Fade, Push, and Slide Transition Effects

This transition family, which has no corresponding SMPTE codes, includes fades that let you blend images into one another, or fade an image into or out of a solid color. The push and wipe transition effects allow a second clip to push the first clip out of the way, or to slide over it. In the following table, the first subtype for a certain type is the default.

Fade, Push, and Slide Transition Effects
Type Subtype Transition Appearance
fade crossfade The clip fades into the clip that follows it.
fadeFromColor The clip fades in from a solid color.
fadeToColor The clip fades out into a solid color.
pushWipe fromLeft The clip pushes out the preceding clip from left to right.
fromRight The clip pushes out the preceding clip from right to left.
fromTop The clip pushes out the previous clip from top to bottom.
fromBottom The clip pushes out the previous clip from bottom to top.
slideWipe fromLeft The clip slides over the preceding clip from left to right.
fromRight The clip slides over the preceding clip from right to left.
fromTop The clip slides over the previous clip from top to bottom.
fromBottom The clip slides over the previous clip from bottom to top.

Note: Push wipe transition effects are not currently functional in RealPlayer.

For More Information: With color fades, see See "Defining Colors and Border Blends" for information on color values.

View it now! (requirements for viewing this sample)
This sample demonstrates all fade, push, and slide transition effects.

Modifying Transition Effects

The following sections describe optional <transition/> tag attributes that modify the appearance of the transition effects. The following table summarizes these attributes.

Attributes for Modifying Transition Effects
Attribute Value Default Function Reference
borderColor blend|color_value black Defines the border color. click here
borderWidth pixels 0 Specifies the border size. click here
direction forward|reverse forward Sets the direction of movement. click here
dur time_value 1s Specifies the effect duration. click here
endProgress 0.0-1.0 1.0 Halts the effect before it finishes. click here
fadeColor color_value black Sets the color for fade transitions. click here
horzRepeat integer 1 Multiplies the effect horizontally. click here
startProgress 0.0-1.0 0.0 Starts the effect at a midway point. click here
vertRepeat integer 1 Multiplies the effect vertically. click here

Setting a Transition Effect's Duration

By default, each transition effect lasts one second, but you can change this by adding a dur attribute to the <transition/> tag. As described in "Timelines and Transition Effects", changing a transition effect's duration does not affect the presentation duration. In the following example, the transition effect takes three seconds to complete:

<transition id="fade1" type="fade" subtype="crossfade" dur="3s"/>

To use the same transition type but vary the transition speeds, define the transition multiple times, each time with a different ID and duration. For example, the following tags define the same transition type and subtype, but the first effect lasts two seconds whereas the second effect lasts four seconds:

<transition id="fan1" type="fanWipe" subtype="top" dur="2s"/>
<transition id="fan2" type="fanWipe" subtype="top" dur="4s"/>

For More Information: The dur attribute uses the standard SMIL timing values, which are described in "Specifying Time Values".

Reversing a Transition Effect's Direction

Using direction="reverse", you can change the direction a transition effect runs. For example, the following transition effect reveals the clip in a four-point star that expands outward:

<transition id="p1" type="starWipe" subtype="fourPoint"/>

Reversing the direction creates a four-point star that contracts inward:

<transition id="p2" type="starWipe" subtype="fourPoint" direction="reverse"/>

For some transition effects, you can simply use a different subtype rather than include the attribute direction="reverse". For example, this transition effect:

<transition id="p3" type="pushWipe" subtype="fromRight"/>

is equivalent to this transition effect:

<transition id="p4" type="pushWipe" subtype="fromLeft" direction="reverse"/>

Note: Reversing the direction of a transition effect that has no specific starting or ending point, such as crossfade, has no visual effect.

Using Partial Transition Effects

Each transition effect has a starting appearance and an ending appearance. For example, an expanding star transition normally starts as a single point in the center of the transition area. It ends after the star has expanded out of the transition area. You can set a different point where a transition effect starts with startProgress:

<transition id="wipe1" type="pushWipe" subtype="fromLeft" startProgress="0.25"/>

The startProgress attribute takes a value from 0.0 (normal starting point) to 1.0 (normal ending point). This value represents a percentage. For example, startProgress="0.25" means that when the transition effect starts, it appears to be 25 percent complete already. It then flows to its end point over the course of its specified duration.

Additionally, you can use endProgress, which also takes a value from 0.0 to 1.0 to indicate how far the transition effect progresses before it ends. The following example defines a keyhole-shape transition effect that ends when the keyhole has expanded to half of its normal ending size:

<transition id="key" type="miscShapeWipe" subtype="keyhole" endProgress="0.5"/>

View it now! (requirements for viewing this sample)
Here, you can view samples of partial transition effects.

Tips for Using Partial Transition Effects

Repeating Transition Effects Horizontally or Vertically

When you repeat a transition effect, the effect appears multiple times instead of just once. For example, an expanding star transition effect normally begins in the center of the clip and expands toward the clip's edges. By repeating this effect twice horizontally and twice vertically, you make a separate star shape expand in each of the clip's quadrants, as shown in the following illustration.

Repeating Star Transition Effect

Repeating Star Transition Effect

You repeat a transition effect by adding the horzRepeat or vertRepeat attribute to a <transition/> tag. Each attribute takes as a value a positive integer that defines how many times the transition effect repeats horizontally or vertically, respectively. For example, the following transition effect defines two four- point stars that appear side-by-side:

<transition id="starHorz" type="starWipe" subtype="fourPoint" horzRepeat="2"/>

To have these stars appear one on top of the other, you repeat the effect vertically:

<transition id="starVert" type="starWipe" subtype="fourPoint" vertRepeat="2"/>

You can combine horzRepeat and vertRepeat attributes in the same tag. The following example creates a grid of nine transition effects by defining three horizontal repetitions and three vertical repetitions:

<transition id="nineStar" type="starWipe" subtype="fourPoint" horzRepeat="3"
vertRepeat="3"
/>

Tip: Think of these attributes as defining a table. The horzRepeat attribute defines the number of columns, and the vertRepeat attribute defines the number of rows.

View it now! (requirements for viewing this sample)
This example demonstrates repeating transition effects.

Setting a Border Width

All transition effects except fades have borders. When a clip slides over another clip from left to right, for example, the border is the new clip's right edge. By default, the border width is 0 (zero), meaning the border is not accentuated. By adding a borderWidth attribute to a <transition/> tag, you can make the border more apparent. This attribute takes as a value a positive integer that sets the border's pixel width. The following example sets a two-pixel border width:

<transition id="wipe1" type="pushWipe" subtype="fromLeft" borderWidth="2"/>

By default, the border is black, but you can use any other RGB color. You can also make the border blend the clip with its background. The following section explains how to do this.

Defining Colors and Border Blends

Transition effects that fade to or from a color, as well as transition effects that set border widths, can include color values, which are described in Appendix C. The following example defines a transition effect in which the clip fades to a solid red:

<transition id="redFade" type="fade" subtype="fadeToColor" fadeColor="red"/>

If you define a border width as described in the preceding section, you can use the borderColor attribute to set the border color:

<transition id="wipe1" type="pushWipe" subtype="fromLeft" borderWidth="2"
borderColor="#AFBC08"/>

Alternatively, you can use borderColor="blend" to make the border blend the clip into its background. This typically creates a blurring effect along the border:

<transition id="wipe1" type="pushWipe" subtype="fromLeft" borderWidth="16"
borderColor="blend"
/>

Tip: When using borderColor="blend", you typically need to set borderWidth to 10 pixels or higher to notice the blending effect.

View it now! (requirements for viewing this sample)
This example demonstrates border colors and border blends.

Assigning Transition Effects to Clips

After you define <transition/> tags in the SMIL file header, you assign the transition effects to clips using transIn and transOut attributes in each clip source tag. You can assign transition effects only to clip source tags, not to <seq>, <par>, or <excl> groups. Any type of clip can use a transition, but because transitions are visual, they do not affect a clip's audio track.

The transIn attribute makes the transition effect occur as the clip starts to play. The transOut attribute makes the effect occur as the clip finishes playing. Each attribute takes as a value the ID defined in a <transition/> tag. For example, suppose that you define the following two transition effects:

<transition id="fromBlue" type="fade" subtype="fadeFromColor" fadeColor="blue"/>
<transition id="toBlue" type="fade" subtype="fadeToColor" fadeColor="blue"/>

In the SMIL file body, you could the assign the effects to a sequence of two videos like this:

<seq>
<video src="video1.rm" transIn="fromBlue" transOut="toBlue" .../>
<video src="video2.rm" transIn="fromBlue" transOut="toBlue" .../>
</seq>

In the preceding example, each video fades up from a solid blue when it starts, then fades down to solid blue when it ends. It's not necessary to use both the transIn and transOut attributes for each clip, though. In the following example, the first video starts playing without any transition. As the first clip ends and the second clip starts, there's a fade to blue and then a fade up. When the second clip stops playback, it disappears from the screen:

<seq>
<video src="video1.rm" transOut="toBlue"/>
<video src="video2.rm" transIn="fromBlue" fill="remove"/>
</seq>

Note: A transition effect assigned with a transOut attribute always obeys SMIL timing rules. If a video normally plays for two minutes, but has a dur="3min" value to lengthen its active period, the transition effect occurs after three minutes.

Using Clip Fills with Transition Effects

The section "Setting a Fill" explains the fill attribute, which makes the clip disappear or remain visible when it finishes playing. Which values you use for fill can also affect transition effects. The following sections explain how best to use the fill attribute with transition effects.

Defining a Transition Fill for a Sequence of Clips

When you apply transition effects to a sequence of clips, use fill="transition" to keep a clip onscreen long enough for a transition to occur. The transition value does nothing when a transition is not applied to the clip. Suppose you want to use a three-second radial wipe like the following to introduce each new video in a sequence:

<transition id="fan1" type="fanWipe" subtype="top" dur="3s"/>

You could apply this transition effect to the beginning of each clip. In a standard sequence of clips, though, each clip disappears as soon as it stops playing. The transition effect that introduces the next clip therefore operates against the region's background color. To keep clips onscreen during transitions, add fill="transition" to each clip's source tag:

<seq>
<video src="video1.rm" transIn="fan1" fill="transition"/>
<video src="video2.rm" transIn="fan1" fill="transition"/>
...more clips that use fill="transition"...
<video src="video6.rm" transIn="fan1" fill="remove"/>
</seq>

In this sequence, each fill="transition" attribute keeps the clip onscreen for three seconds (the duration of the transition effect) after the clip ends playback, long enough for the transition effect to complete. This does not lengthen the presentation timeline. The three seconds used for each transition effect overlap the first three seconds that each new clip plays.

Note: If a clip in a sequence uses a begin value to delay its playback, a fill="transition" value in the preceding clip freezes that clip until the clip with the begin value starts to play and the transition effect completes. For more on begin, see "Using a Begin Time with a Clip".

Tip: In a long sequence of clips, add fillDefault="transition" to the <seq> tag. You do not then need to add fill="transition" to every clip tag. For more on fillDefault, see "Specifying a Default Fill".

Setting a Fill in Parallel Groups

When you use parallel groups, a fill="transition", fill="remove" or fill="freeze" attribute in a clip source tag can affect when a transition occurs. Suppose that you define a two-second fade to black:

<transition id="toBlack" type="fade" subType="fadeToColor" dur="2s"/>

You next apply this transition to both an image and a video playing in parallel. In the following example, the image clip has a fill="remove" attribute and a 30- second duration. The clip begins to fade out at 28 seconds into the parallel group's timeline, disappearing much sooner than the video, which has a 154- second duration:

<par>
<img src="..." region="image" transOut="toBlack" fill="remove" dur="30s"/>
<video src="..." region="video" transOut="toBlack" dur="154s"/>
</par>

To make the image fade out only after its duration has elapsed, you would use fill="transition" as shown in the following example. In this case, the image disappears 32 seconds after it begins to play:

<par>
<img src="..." region="image" transOut="toBlack" fill="transition" dur="30s"/>
<video src="..." region="video" transOut="toBlack" dur="154s"/>
</par>

To make the image begin to fade out two seconds before the video finishes playing, you would use fill="freeze" as shown in the following example:

<par>
<img src="..." region="image" transOut="toBlack" fill="freeze" dur="30s"/>
<video src="..." region="video" transOut="toBlack" dur="154s"/>
</par>

Transition Effects Examples

The following sections illustrate how to use transition tags and attributes to create various transition effects. To see more examples, get the zipped HTML version of this guide as described in "How to Download This Guide to Your Computer", and view the Sample Files page.

Fading to a Color Between Clips

One of the simplest transition effects is to fade up from or down to a color. The following example shows a sequence of two videos. There is a two-second fade from blue as each video starts, and a two-second fade to blue when each video ends. Each video is centered within the video region and appears at its normal size. A begin="2s" value is used with each video to insert a short delay before each transition occurs:

<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
<head>
<layout>
<root-layout width="320" height="240" backgroundColor="blue"/>
<region id="video_region"/>
<regPoint id="middle" left="50%" top="50%" regAlign="center"/>
</layout>
<transition id="fromBlue" type="fade" subtype="fadeFromColor"
fadeColor="blue" dur="2s"/>
<transition id="toBlue" type="fade" subtype="fadeToColor"
fadeColor="blue" dur="2s"/>
</head>
<body>
<seq>
<video src="video2.rm" region="video_region" regPoint="middle"
transIn="fromBlue" transOut="toBlue" begin="2s" fill="remove"/>
<video src="video1.rm" region="video_region" regPoint="middle"
transIn="fromBlue" transOut="toBlue" begin="2s" fill="remove"/>
</seq>
</body>
</smil>

View it now! (requirements for viewing this sample)
Click this sample to view simple color fades.

Crossfading Videos

In a simple variation of the preceding example, the first video fades up from green when it starts to play, and the second video fades down to green when it ends. When the first video stops and the second video starts, though, the two videos crossfade into each other. Clips do not need to be the same size to crossfade into each other:

<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
<head>
<meta name="title" content="Crossfading Videos"/>
<meta name="author" content="RealNetworks, Inc."/>
<meta name="copyright" content="(c)2002 RealNetworks, Inc."/>
<layout>
<root-layout width="360" height="280" backgroundColor="#87CF87"/>
<region id="video_region" width="320" height="240" left="20" top="20"/>
<regPoint id="middle" left="50%" top="50%" regAlign="center"/>
</layout>
<transition id="fromGreen" type="fade" subtype="fadeFromColor"
fadeColor="#87CF87" dur="2s"/>
<transition id="toGreen" type="fade" subtype="fadeToColor" fadeColor="#87CF87"
dur="2s"/>
<transition id="xFade" type="fade" subtype="crossfade" dur="2s"/>
</head>
<body>
<seq>
<video src="video2.rm" region="video_region" transIn="fromGreen" begin="2s"
fill="transition" regPoint="middle"/>
<video src="video3.rm" region="video_region" transIn="xFade" transOut="toGreen"
fill="remove" regPoint="middle"/>
</seq>
</body>
</smil>

View it now! (requirements for viewing this sample)
Click this sample to watch video clips crossfade.


RealNetworks, Inc. ©2002, 2004 RealNetworks, Inc. All rights reserved.
For more information, visit RealNetworks
Click here if the Table of Contents frame is not visible at the left side of your screen.
previous next