Jump to content
Search Community

Call frame image on VideoLoader pause?

HyperNerd test
Moderator Tag

Recommended Posts

Hello! I am looking for a way to have VideoLoader call a corresponding image frame on pause. So, let's say I have VideoLoader playing an f4v video at 30fps and I would have a folder with jpg frames saved out in matching 30 fps sequence. For example, how could I go about coding pause returns matching frame? Say, on frame 120 of f4v and show 120.jpg?

 

Hope this idea makes sense...

Link to comment
Share on other sites

In the world of VideoLoader and Flash video in general, frames work a bit differently than they do in the Flash timeline.

 

Depending on how your video is encoded, keyframes will be created at certain intervals and what you see in between keyframes is sort of interpolated. http://www.therealtimeweb.com/index.cfm/2006/5/10/flvkeyframes

 

The image a video displays at any point in time is described in time. Video is controlled by going to a certain time and Flash player will then figure out the nearest keyframe based on time. 

 

So you can tinker around with some math and try to figure out the closest frame based on the current videoTime of the VideoLoader. 

 

Have you considered using AS3's bitmap api to just take a screengrab of the video when it is paused? That seems much more efficient than generating and loading a bunch of bitmaps. 

 

Basic bitmap concepts: http://www.flashandmath.com/howtos/bddraw/

 

This tutorial is more than you need, but it shows the power of capturing from video

http://hub.tutsplus.com/tutorials/carve-up-a-video-in-real-time-with-as3--active-9020

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...