Skip to main content

Animation Effects

Complete guide to animation effects in the Zvid Package, including entrance and exit animations for all visual elements.

Overview

Animation effects allow you to add smooth entrance and exit animations to any visual element (text, images, videos, and SVGs). The animation system uses FFmpeg's xfade filter to create professional-looking transitions that enhance the visual appeal of your videos.

How Animations Work

The animation system creates smooth transitions by:

  1. Entrance Animations: Transitioning from a transparent background to your element
  2. Exit Animations: Transitioning from your element to a transparent background
  3. Timing Control: Using enterBegin, enterEnd, exitBegin, and exitEnd properties
  4. FFmpeg Integration: Leveraging FFmpeg's powerful xfade filter for smooth effects

Animation Properties

Timing Properties

PropertyTypeDefaultDescription
enterBeginnumber0When element starts appearing (seconds)
enterEndnumber0When entrance animation completes (seconds)
exitBeginnumberproject.durationWhen exit animation starts (seconds)
exitEndnumberproject.durationWhen element completely disappears (seconds)

Animation Properties

PropertyTypeDefaultDescription
enterAnimationstring | nullnullEntrance animation effect name
exitAnimationstring | nullnullExit animation effect name

Available Animation Effects

All supported animation effects are listed on the official FFmpeg xfade page.

Unsupported Animations

These animations are not yet supported: squeezeh, squeezev, hlwind, hrwind, vuwind, vdwind, coverleft, coverright, coverup, coverdown, revealleft, revealright, revealup, revealdown, zoomin, and distance

Fade Animations

fade - Standard fade in/out

{
enterAnimation: "fade",
exitAnimation: "fade",
enterBegin: 0,
enterEnd: 1, // 1-second fade in
exitBegin: 9, // Start fading out at 9s
exitEnd: 10 // Complete fade out at 10s
}

fadeblack - Fade through black

{
enterAnimation: "fadeblack",
exitAnimation: "fadeblack"
}

fadewhite - Fade through white

{
enterAnimation: "fadewhite",
exitAnimation: "fadewhite"
}

fadegrays - Fade through grayscale

{
enterAnimation: "fadegrays",
exitAnimation: "fadegrays"
}

Slide Animations

slideleft - Slide from/to left

{
enterAnimation: "slideleft", // Slides in from left
exitAnimation: "slideleft" // Slides out to left
}

slideright - Slide from/to right

{
enterAnimation: "slideright",
exitAnimation: "slideright"
}

slideup - Slide from/to top

{
enterAnimation: "slideup",
exitAnimation: "slideup"
}

slidedown - Slide from/to bottom

{
enterAnimation: "slidedown",
exitAnimation: "slidedown"
}

Smooth Slide Animations

smoothleft, smoothright, smoothup, smoothdown - Smoother slide transitions

{
enterAnimation: "smoothleft",
exitAnimation: "smoothright" // Can mix different directions
}

Wipe Animations

wipeleft, wiperight, wipeup, wipedown - Wipe effects

{
enterAnimation: "wiperight", // Wipes in from right
exitAnimation: "wipeleft" // Wipes out to left
}

wipetl, wipetr, wipebl, wipebr - Diagonal wipes

{
enterAnimation: "wipetl", // Wipe from top-left
exitAnimation: "wipebr" // Wipe to bottom-right
}

Shape Animations

circlecrop - Circular reveal/hide

{
c;
}

rectcrop - Rectangular reveal/hide

{
enterAnimation: "rectcrop",
exitAnimation: "rectcrop"
}

circleopen / circleclose - Circle opening/closing

{
enterAnimation: "circleopen",
exitAnimation: "circleclose"
}

horzopen / horzclose - Horizontal opening/closing

{
enterAnimation: "horzopen",
exitAnimation: "horzclose"
}

vertopen / vertclose - Vertical opening/closing

{
enterAnimation: "vertopen",
exitAnimation: "vertclose"
}

Diagonal Animations

diagbl, diagbr, diagtl, diagtr - Diagonal transitions

{
enterAnimation: "diagtl", // Diagonal from top-left
exitAnimation: "diagbr" // Diagonal to bottom-right
}

Slice Animations

hlslice / hrslice - Horizontal slices

{
enterAnimation: "hlslice", // Horizontal slice left
exitAnimation: "hrslice" // Horizontal slice right
}

vuslice / vdslice - Vertical slices

{
enterAnimation: "vuslice", // Vertical slice up
exitAnimation: "vdslice" // Vertical slice down
}

Creative Effects

dissolve - Dissolve effect

{
enterAnimation: "dissolve",
exitAnimation: "dissolve"
}

pixelize - Pixelation effect

{
enterAnimation: "pixelize",
exitAnimation: "pixelize"
}

radial - Radial wipe

{
enterAnimation: "radial",
exitAnimation: "radial"
}

hblur - Horizontal blur

{
enterAnimation: "hblur",
exitAnimation: "hblur"
}

Examples

Simple Fade Animation

{
type: "TEXT",
text: "Hello World",
x: 640, y: 360,
enterBegin: 0,
enterEnd: 1, // 1-second fade in
exitBegin: 9,
exitEnd: 10, // 1-second fade out
enterAnimation: "fade",
exitAnimation: "fade"
}

Quick Animation

{
type: "SVG",
svg: "<svg width=\"200\" height=\"150\" viewBox=\"0 0 200 150\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"0\" y=\"0\" width=\"200\" height=\"150\" fill=\"#ff6b35\" /></svg>",
x: 500, y: 200,
enterBegin: 5,
enterEnd: 5.5, // 0.5-second quick entrance
exitBegin: 7,
exitEnd: 7.3, // 0.3-second quick exit
enterAnimation: "dissolve",
exitAnimation: "dissolve"
}

Best Practices

Animation Design

  1. Consistency: Use similar animation styles throughout your video
  2. Timing: Match animation speed to content pace
  3. Direction: Use logical directions (entrance from one side, exit to opposite)
  4. Duration: Keep animations between 0.3-2 seconds for best effect

Visual Guidelines

  1. Entrance Direction: Consider where viewer attention should come from
  2. Exit Direction: Plan where attention should go next
  3. Element Hierarchy: More important elements can have more dramatic animations
  4. Content Relationship: Related elements can use similar animations

Common Animation Combinations

Professional Presentation

// Title: Dramatic entrance, subtle exit
{
enterAnimation: "slidedown",
exitAnimation: "fade"
}

// Content: Smooth entrance and exit
{
enterAnimation: "fade",
exitAnimation: "fade"
}

Social Media Style

// Quick, energetic animations
{
enterAnimation: "slideright",
exitAnimation: "slideleft",
}

Creative/Artistic

// Unique, eye-catching effects
{
enterAnimation: "dissolve",
exitAnimation: "pixelize",
enterBegin: 0,
enterEnd: 2, // Longer, more artistic timing
exitBegin: 5,
exitEnd: 7
}

Troubleshooting

Common Issues

  1. Animation Not Visible: Check timing properties and ensure enterEnd > enterBegin
  2. Choppy Animation: Increase animation duration or simplify effects
  3. Timing Conflicts: Ensure animations don't overlap unintentionally
  4. Performance Issues: Reduce simultaneous animations

Animation Tips

  1. Preview: Test animations with different durations to find the right feel
  2. Coordination: Plan animation timing with audio and other elements
  3. Accessibility: Ensure content is readable even during animations

Next Steps