Skip to main content
February 27, 2007
Question

Problem with recording a live-stream

  • February 27, 2007
  • 1 reply
  • 379 views
Hello Adobe communtiy,

we are developing an online application where our users can send the output of their videocard live into the internet.
The app is based on flash communication server mx 1.5.3 and a user-interface developed with flash.

Some of our our users had asked for a posibilty to record their video streams from our software to watch it later.
To realize this feature we use the internal recording functions of flashcom. While the user is streaming his content he can push a record button in the ui. Then flash-com writes the stream into a flv-file on the server. Is the recording stopped by pressing another button or timeout the user will be asked if he wants to save the record. If he agrees the flash-ui starts a script in the background which catches the flv from our flashcom, encodes it into mpeg, saves it at our webserver and adds a dataset into our database.

So far so good, we could realize all that in a short time.
We still have some problems with the recording feature from flashcom. During the first seconds there are some failures in the video, which becomes apparent in green surfaces at the edges. This failures does not come from the encoding into mpeg, because i can see them directly in the original flv if i play it with the vlc-player.

Further I could observe that the corrupted part of the video depends on the framerate of the stream. As lower the framerate is, as longer is the incorrect section at the beginning of the video. Also a low framerate causes big failures. If i rise the framerate for example to 25fps the failures are nearly disappeared, but we don't want such high framerates for our stream, because in our project mainly the quality of the pictures are important.

On action-script side the recording is done only with the folowing 3 lines of code.
The stream it self is done by minimal modified AVPresence component (FcSono in the following code)

-------8<------------------------------------------------------------------

// Video Output an stream anhängen
client_cam = Camera.get();
_root.FcSono.ns.attachVideo(client_cam);

// Stream speichern
_root.FcSono.ns.publish("UserRecord", "record");

------------------------------------------------------------------>8-------


Has anybody an idea how we can get a perfect recording without these failures at the beginning?

Greetings,
Christopher Reitz, Alcedis GmbH
    This topic has been closed for replies.

    1 reply

    Inspiring
    February 27, 2007
    publish(); is only availiable from the broadcaster ...........read the NetStream class docs and pay attention to the part that says publisher and subscriber.
    February 28, 2007
    quote:

    Originally posted by: calmchess333
    publish(); is only availiable from the broadcaster ...........

    Right, this is something i've also found out. Because of this only the sender of the stream is able to record in our app at the moment.
    But i think this has nothing to do with the problem i've described in my topic. Before i'am going to improve thinks like that, the record itself has to be 100% perfect, because this is what our users want to see.


    February 28, 2007
    I've just played around with the current developer edition of the flash media 2 server, and had a strange experience.
    We are using on our productive server still flash communication server mx 1.5.3, like i've noticed before, because we have only a licencse for this version.

    If i record a video with our app on flash media 2 server the problems i've descriped are away...
    ...BUT...
    flash media 2 seems to cut the corrupted part automaticly out of the record.
    I recorded a video which is exactly 30seconds long (made with a timeout script). On old flashcom the first 7 seconds have these descriped failures.
    If i record the same stream on flash media 2 there are no failures in the record, but the record is only 23 seconds long....

    This is very very bad adobe :(
    Or is the problem in my code? If there is anybody who can help, i would be very happy!