Playing embedded videos in reverse

Often when you're using video in flash (embedded in the timeline), you'd like to be able to do one of these things:

  1. Play it backwards, using prevFrame() for example or
  2. Jump to an arbitrary frame using gotoAndStop(frame)

Unfortunately this isn't normally possible. This is because when video is encoded, it's not really storing every frame, it's storing the difference between frames. So frame 1 is stored in total, but frame 2 is really storing just the pixels that are different between frame 2 and frame 1, frame 3 is storing the differences between 2 and 3 etc.

The problem with this is that it's an inherrently one directional process - if you want to play a video backwards, the information isn't available. The solution? When you import a video into flash (by dropping it into the timeline) you can change your import settings to make it possible to play backwards.



If you set the "Key frame interval" to 1 (2 is also sometimes good, experiment for yourself for best results) playing backwards is now possible.

The benefits are:

  • The video will look better quality when stopped on any frame
  • The video can be played in reverse
  • You can jump to any frame in the video

The drawbacks:

  • There's only one but it's significant - massive increase in filesize! Often this is prohibitive :(
Check out the example and happy flashing!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

相关文章

Comments are closed