2 Replies Latest reply on Nov 21, 2011 12:24 AM by Stianbl2

    Buffering .FLV to memory (array)?



      I need to buffer a .FLV file to memory/array, saving each frame as BitmapData.

      This way I can scroll through the video (forward and backward) without any lag.


      Hi guys!

      I've got a problem here, and I'm stuck trying to figure it out..


      In my application, I'm going to have an interactive video, which works like this:


      When the app starts, a compressed .flv file is buffered and loaded into memory.

      When it's loaded, the user can interact with the movie clip by clicking and dragging in the image.


      The movie clip is a 360 degree render of an object, and the user will be able to rotate around it.


      The buffered .flv is 2mb in size, and this is what the user sees when he's dragging/rotating in the image (to make it rotate smoothly). When the user releases the mouse button, the image will refresh with the corresponding image from the JPG folder (containing 360 pre-rendered images of the same animation, but in higher resolution).


      - - -


      I might not be the best person to explain my problem but I hope you guys will understand my problem.


      A quick breakdown of what I need:


      I've got a 360 degree render of an object (which makes a turn-table animation of the object) This is saved into two formats:

      1x Compressed .FLV video for smooth rotation (using this low-res version when the user is rotating the view)

      360x high-res .jpg images, one for each degree of the animation. This image is loaded whenever the user releases the mouse after rotating the view. That way, the user can rotate with ease, and still see the high-res version when he stops rotating.


      - - -


      Here is my current code that works, but this code buffers the FLV from the videoDisplay when it's drawn to the screen, which limits the BitmapData to captur ethe current resolution of the videoDisplay. If I scale my windows while buffering, the stored/buffered images will also be scaled, which leaves me with bitmaps stored with different resolutions in one array.


      So I need to be able to store this flv to buffer/array before it's drawn on the screen, or at least be able to store the frames in it's original resolution (1280x720).


      Does anyone have any good ideas? =D


      Heres relevant parts of my code:


      [Click the link for code]

      Posting the code in this forum only made it into tables..




      Sorry, lots of code here, but this should be all the relevant code you need to understand my problem