Skip to main content
January 7, 2009
Question

Tricky FLV Video File I/O thing

  • January 7, 2009
  • 1 reply
  • 530 views
Hi

Lets say we have an flv file broken into 4 files: flvFile.part1, flvFile.part2, flvFile.part3, flvFile.part4

I don't want to assemble the 4 parts on the disk and then read it, nor do I want to fit the assembled file in memory all at once.

Is there a way to start reading the first and then the second etc. while playing the video smoothly?

Please note that the flv is just broken in four parts so on their own each part is not a complete flv file. Also, I don't mind if this is done in AIR and not Flash Player so using FileStream would be fine. So, I guess first step would be to start reading the first part as a binary file. But then can you start playing that stream or bitarray as a video?

Any ideas/pointers would be greatly appreciated!

Thanks

This topic has been closed for replies.

1 reply

Inspiring
January 7, 2009
It looks like you use on local disk only. Since the access is instant - roll over to the next movie should not be visible. (although I don't understand why would you split the file - it take the same space - I am talking about local storage)

No matter where your files reside, you probably need to prepare the playback somewhere at the end of the previous playback by creating a new NetStream instance, pausing it and starting playing it when previous playback is complete. One of the caveats is what happens in case they scroll through the playback too fast all the way to the end.
January 7, 2009
Well there are two things I am trying to achieve.

a) By spliting and mixing the parts then without knowing the sequence its hard to assemble the file so like a simple way to protect the content.

b) Would involve encrypting the file with a block cipher and start decrypting on the fly bits of it and playing it.

So in both cases I would have bytes that represent a piece of a video and would start playing it. So my main problem is that I am not sure how the video stream works in AS3.
Inspiring
January 7, 2009
You cannot decrypt the video content in Flash - it has to be a pure video file encoded in specified codec. In other words, Flash is able to accept the streams of only specified codec.

I am sure you are aware of the struggle media companies put on to protect their content. As for Flash only the next release of FMS will have some sort of rights management (which is lame anyway). Practically there is very little you can do to protect your assets if you don't have quite a bit of money and a server.