views:

464

answers:

3

How to stream video over Socket Class (or XMLSocket) with ActionScript?


or\and


How to do it using Socket Class (or XMLSocket) in AIR?

A: 

I think You can only use sockets in Air. If You need streaming in Flex/Flash look for RED5 RTMP server, there are client and server examples.

Maciek Sawicki
Ok so how to do it using Socket Class (or XMLSocket) in AIR?
Blender
A: 

Why are you looking to stream video using Socket? The performance would be far, far less than what's offered by Adobe's built-in classes for this.

To stream audio and video in Flash, you'll need an FMS-alike server. Red5 is an open-source server that allows this (like Maciek said). However, serving your own live video over flash.net.Socket and then decoding it yourself would yield horrible performance. Essentially, the only way to stream video in performance-acceptable way would be to use flash.net.NetConnection. This uses the RTMP protocol for media streaming.

Also, if it's not live streaming of video you are looking for, take look at serving those video files over a normal HTTP server and the FLV format.

cgbystrom
The point is not in performance. I just need to stream live video using Sockets. Let's suppose I have super-fast computer and a web camera. But only thing I can use to send video from that camera is SOCKET connection!( I know that I can just take Byte Arrays From current video object bitmap data but that will give me frame by frame representation of video stream... I want something else, better, faster.
Blender
A: 

Can't use Socket class for this -- you don't have a framebuffer to the webcam.

You could use Adobe Stratus for this -- it's a peer to peer negotiation layer that supports hooking Camera and Microphone up to a (peer to peer) NetStream.

Cory Petosky