all groups > macromedia flash flashcom > february 2006 >
You're in the

macromedia flash flashcom

group:

Recording video from a web chat application


Recording video from a web chat application johnmce
2/18/2006 4:45:15 PM
macromedia flash flashcom:
Does anyone know of a way to simultaneously record the streams of 2 users who
are having a web chat on my FMS video chat room?

The streams have to go from each user to the server before being broadcast
back out to all users so I want to capture that video stream at the same time
as broadcasting so the chat app still runs smoothly.

If anyone has any ideas would be most grateful to hear from you,
cheers
all the best
john
Re: Recording video from a web chat application JayCharles
2/18/2006 10:16:31 PM
It's right there in the docs.

To start the recording from the server side:

// To start recording
s = Stream.get("foo");
if (s){
s.play("sample");
s.record();
}
// To stop recording
s = Stream.get("foo");
if (s){
s.record(false);
}

And to start recording from the client side:

connection = new NetConnection();
connection.connect("rtmp://myServer.myDomain.com/appName/appInstance");
srcStream = new NetStream(connection);
srcStream.publish("stephen", "record");
srcStream.attachVideo(Camera.get());

// To stop publishing and recording
srcStream.publish(false);

// To play the recorded stream
srcStream.play("stephen");

.. notice the "record" flag in the publish command. That's all you need to do
to get the server to record the stream.

Keep in mind that there isn't a foolproof means of synchronizing streams on
playback, so playback of the recorded streams won't be very smooth unless you
take the .flv's into an editing program to manually sync the clips.
Re: Recording video from a web chat application johnmce
4/2/2006 12:00:00 AM
I've got the stream to record fine but each new stream records over it as it
records with the same name ie "stephen".
Can I add a unique id to each stream, prehaps a date time stamp some how?
any ideas?
any help much appreciated,
cheers,
john
Re: Recording video from a web chat application JayCharles
4/2/2006 6:33:38 PM
Sure... just change the name of the stream:

connection = new NetConnection();
connection.connect("rtmp://myServer.myDomain.com/appName/appInstance");
srcStream = new NetStream(connection);
myDate = new Date();
// Get seconds sice epoch
myTimeStamp = myDate.UTC();
myNewStream = "stephen"+myTimeStamp;
srcStream.publish(myNewStream, "record");
srcStream.attachVideo(Camera.get());
AddThis Social Bookmark Button