FORUMS: list search recent posts

How?: Give user ability to change video playback framerate.

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Graham Calhoun
How?: Give user ability to change video playback framerate.
on Dec 29, 2007 at 4:59:35 pm

Hi all,

My first posting here. I'm learning Flash CS3 and AS 3.0 and am just a notch above a rank novice. With that in mind, if this is something easily accomplished, I would enjoy seeing some code which I could (hopefully) dissect and understand. If it's not so simple, perhaps some keywords which could point me in the right direction to learning about this topic.

For background, what I'm working on is video specific content. This content is not played over the web, but is a file download to the clients computer because the video is so large. It is to be used as a medical illustration for marketing purposes. Right now, I've created a custom flv playback interface with the typical play, pause, stop and scroll functionality.

The client would like for me to add button functionality to change the playback speed to 1X, 2X, 4X and 8X for the video. To be clear, the interface would include 4 buttons each of which would speed up the playback rate by 2, 4 and 8 times respectively (and 1X to get back to normal speed). To me, this seems like a task to tell the player to skip frames in order to speed up playback rate, but maybe it's a function of changing the framerate to double, quadruple etc.

Additionally, I would want to be sure that upon hitting a button, the speed change would not alter the frame position from which this change occurred. In other words, if the speed change button were depressed during playback at frame 2,397, the playback wouldn't jump back to frame 0 or anything like that.

And also, if the player is paused while playing at, let's say, 4X speed, and the client switches to using the scrub bar, I would want to be sure that scrubbing would allow viewing of every frame, and not skip frames if that is how speeding up the video is accomplished.

Any help or guidance would be greatly appreciated.



Return to posts index

Ross Gerbasi
Re: How?: Give user ability to change video playback framerate.
on Jan 2, 2008 at 5:31:32 pm

This maybe easy enough to tackle by just using a enterframe management setup. If you are importing the FLV into the flash IDE, just drop it into a movieclip

then maybe something like this

somesprite.addEventListener(Event.ENTER_FRAME, manage)

public function manage(e:event):void{
videomovieclip.gotoAndStop(videomovieclip.currentFrame + speed)

Then just vary the speed variable. If you have audio this could become madness though.. If you are bringing the video in dynamically you might want to try the same idea but using video position instead of currentFrame to control where you want to be... This also is messy... sadly flash doesn't provide anyway for doing video framerate changes...

Here are some entries on slow motion you can check on if your interested in doing bitmap data in an array... speeding it up shouldn't be a much different concept


Return to posts index

Graham Calhoun
Re: How?: Give user ability to change video playback framerate.
on Jan 4, 2008 at 4:35:37 am


Thank you for your response. I will look into what you've said and see if I can make it work.



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved