George Profenza
George Profenza

Reputation: 51837

How can i smoothly playback a FLV at different speeds?

I will need to display the frames of an FLV at different rates.

Here are some examples:

Currently I'm using LoaderMax and it's VideoLoader object to load and play FLV files. I've tried using the playProgress property, but only the keyframes of the FLV are displayed. I got the same result with the basic setup(using the NetStream class)

As a workaround, I playback the FLV once, and cache BitmapData instances in which I draw/cache each frame of the video. After this is done, I use the BitmapData Vector to update a Bitmap on stage. Scrubbing/changing speed works fine with this method, but still the user needs to see(wait for) the sequence once, while it gets cached, which I don't like.

Any better ideas on how to do this ?

Any tips are useful, Thanks!

Upvotes: 5

Views: 1695

Answers (2)

www0z0k
www0z0k

Reputation: 4434

Thx for the question: it made me read flv format spec (from page 74) and start writing a ByteArray based parser. as far as i understood there're two ways:

Body VideoTagBody The VideoTagBody contains the video frame payload.


so it seems possible to access each frame as pixel data

another one is to set framerate in metadata to a value you like, write an flv back to ByteArray and save to local filesystem or use NetStream.appendBytes() for playback

Upvotes: 2

James Hay
James Hay

Reputation: 12710

I've seen this done before but the video was imported into the flash ide and we manipulated the time line for the scrubbing. I believe we had a second version of the video for the slow motion play back version and switched between the two movieclips. Fairly low-tech method and wasn't without it's issues but we got round them. I have a feeling you're going to struggle to do this with a plain old flv using progressive download.

Upvotes: 1

Related Questions