views:

206

answers:

1

Hi, I want to know if it is possible to get the decoded frames from FLVPlayback, or if it is known another alternative to access the decoded frames from a flash player. What I want to do is to manipulate the decoded frames before they get rendered on screen.

The video source could be an RTMP stream or a FLV (F4V) file.

Any hint is welcome :)

A: 

In what way do you wish to modify them?

If you need to do any per-pixel operation, and are not using Flash Player 10 (in which case you should look up Pixel Bender), you can use the BitmapData.draw() function to draw your frame into a BitmapData. You can then manipulate the pixels as you wish.

var bmp : BitmapData = new BitmapData(myVideo.width, myVideo.height, false);

// Each frame, do this:
bmp.draw(myVideo);

If you just simply want to apply some sort of generic filter, like blur, you can look up the flash.filters.* classes instead, e.g. BlurFilter, DropShadowFilter or ColorMatrixFilter.

richardolsson
Wow, thanks for your quick response. To be clear, for example I have a soccer video of res. 720x480 and I want to crop it having always the soccer ball in the middle of each frame. The position of the ball in each frame is known using a tracking algorithm (this point becomes the center of the new frame). I want to crop each frame of the video to for example 320x240 and then show the result on the player.
Christian
For what you are describing, I would simply use a 320x240 rectangular mask, and move the video around behind the mask.
richardolsson