2

I'm trying to attach a single NetStream Object to two separate Video objects instead of pulling redundant streams from the server. The expected behavior would be for both Video's to display the same content. However, it seems that the last video I attach the NetStream to is the only Video that will display the content.

Has anyone else run into this? I'd rather not go to the inelegant steps of using BitmapData to clone pixels if I don't have to.

Thanks

Stuart
  • 45
  • 5

2 Answers2

0

As of Flash 10.1 Adobe finally added some new functionality for connecting directly to the bytes for the NetStream object. The new method is called appendBytes, which as it suggests allows adding bytes programatically to the NetStream object. This is primarily used for Adobe's support of HTTP streaming (finally). There is some more info and demos for this here at bytearray.org.

What this means is that what you may be able to do is stream your video using HTTP streaming. You can get your video streamed using HTTP streaming, then feed your two different NetStreams with the bytes from the single HTTP stream. So you get your bytes from HTTP streaming, then you call ns.appendBytes(inputbytes) on each NetStream object. You'll have 2 NetStream objects, but it will save you the bandwidth of trying to pull redundant streams for each.

What you may then run into is that you have skipping between your video segments if you try to roll your own video splitter. Adobe supports the HTTP stream splitting in its video server, but I haven't been able to find a good reference that shows how do roll this myself.

Community
  • 1
  • 1
Scott
  • 16,711
  • 14
  • 75
  • 120
  • Huh hadn't seen that Adobe implemented this, nice to have streaming alternatives. In the end I got the requirements changed to allow a single video 32x9 window. But this might have bee an option for people going forward. – Stuart Feb 22 '11 at 07:13
0

Ummm, isn't it kinda dumb to decode the video stream twice? Using BitmapData.draw() in an enterFrame handler to copy the video is simple and efficient.

Dan
  • 1
  • 1
    It isn't as simple as you would think because framerates the of the swf don't necessarily match the video. Also, drm controls in flash prevent drawing video to bitmap without the proper fms policy files. When you are using a cdn and don't control the fms this isn't always an possible. Ideally there would be a decoder object that you would pipe the netstream into and pipe the output to multiple videos. – Stuart Mar 19 '11 at 05:10