Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netstream and step() or seek()?

I'm on an AS3 project, playing a video (H264). I want, for some special reasons, to go to a certain position.

a) I try it with NetStream.seek(). There it only goes to keyframes. In my current setting, this means, i can find a position every 1 second. (for a better resolution, i'd have to encode the movie with as many keyframes as possible, aka every frame a keyframe)

  • this is definetly not my favourite way, because I don't want to reencode all the vids.

b) I try it with NetStream.step(). This should give me the opportunity to step slowly from frame to frame. But in the documentation it says:

This method is available only when data is streaming from Flash Media Server 3.5.3 or higher and when NetStream.inBufferSeek is true.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#step()

Does this mean, it is not possible with Air for Desktop? When I try it, nothing works.

Any suggestions, how to solve this problem?

Greetings & Thank you! Nicolas

like image 991
nbuechi Avatar asked Mar 20 '26 07:03

nbuechi


1 Answers

Flash video can only be advanced by seconds unless you have Flash Media Server hosting your video. Technically, that means that you can have it working as intended in Air, however, the video would have to be streaming (silly adobe...).

You have two options:

1) Import the footage as a movieclip. The Flash IDE has a wizard for this, and if you're developing exclusively in non-FlashIDE environment, you can convert and export as an external asset such as an SWF or SWC. This would then be embedded or runtime loaded into your app giving you access to the per-frame steppable methods of MovieClip. This, however, does come with some audio syncing issues (iirc). Also, scrubbing backwards is not an MC's forté.

2) Write your own video object that loads an image sequence and displays each frame in order. You'd have to setup your own audio syncing abilities, but it might be the most direct solution apart from FLVComponent or NetStream.

like image 197
Atriace Avatar answered Mar 23 '26 09:03

Atriace