Advancing a video frame-by-frame with Flex and Flash Media Server

731 views Asked by At

I've got an Adobe Flash Media Server set up with some streaming videos (.f4v). I've got a Flex app that uses a VideoDisplay component to connect and play videos.

For this particular application, it will be important that users can pause a video and advance it slowly, one click at a time. Frame by frame would be pretty cool, if possible.

Currently I do this, which works fairly well for values > 0.1s

        protected function reverseFrame(event:MouseEvent):void
        {
            mainVideo.playheadTime -= 0.1; // seconds
        }

        protected function advanceFrame(event:MouseEvent):void
        {
            mainVideo.playheadTime += 0.1; // seconds
        }

I could probably calculate the rough time a frame take (from the metadata I suppose) but I'm not sure if that would be the best way of doing it. Also, sometimes when using small values such as 0.1s, it won't render the next image until I advance again.

I've seen that there are other components for playing Flash media, but I'm not sure if they provide any additional benefit over VideoDisplay.

2

There are 2 answers

0
Sean Fujiwara On BEST ANSWER

Flash 10.1 has NetStream.step for this purpose.

0
stressed_geek On

If you are flexible on your choice of media streaming server solution, I would suggest you take a look at Wowza Media Server instead of Flash Media Server.

Wowza supports features like fast foward, fast rewind, slow motion. It works by streaming the media at your desired speed eliminating the need to implement the same on the Flex client.

You can take a look at the following code example for the aforementioned functionality:

Wowza Media Server (fast foward, fast rewind, slow motion)