Recording High Quality Flash Video Over Slow Internet Connections Part 2

This is part 2 of our 3 part series on recording high quality Flash video over slow connections.

As explained in the first part, a big buffer should be used in the recorder flash app so that the video and audio data has where to wait before its turn comes to travel to the media server.

When the user stops the recording (by pressing a STOP button for example) most probably there still is some audio & video data in the buffer, data that has not been sent yet to the media server.

Part 2: wait for the audio and video data to reach the media server before we display any SUCCESS message to the user

Otherwise you will most probably end up with videos with missing endings and frustrated users.

Heres how stopping a recording unfolds in our flash video recorder:

  1. STOP button is pressed (or recording time limit is reached)
  2. we stop capturing data from the cam and mic
  3. we display a SAVING VIDEO message until the buffer is empty (all the data in the buffer is sent to the server)
  4. when the buffer reaches 0 we finally display the recording saved properly success message.

In code (as2) Step 2 translates in ns.attachAudio(null) followed by ns.attachVideo(null).

Step 3 and 4 (detecting when all the data has reached the media server ) can be done in several ways but we listen for a NetStream.Buffer.Empty or NetStream.Record.Stop net status event fired while ns.bufferLength == 0 .

In as3 the procedure should be similar.

In part 1 we’ve talked about using a big buffer on the client side.

In part 3 we will talk about getting the media server to properly save the video and audio data to the HDD.

Tags: , , , , , ,

3 Responses to “Recording High Quality Flash Video Over Slow Internet Connections Part 2”

  1. Recording High Quality Flash Video Over Slow Internet Connections Part 1 — AVChat Software Says:

    [...] Update : Part 2 can be acessed here: http://www.avchat.net/blog/?p=33 [...]

  2. Recording High Quality Flash Video Over Slow Internet Connections Part 3 — AVChat Software Says:

    [...] concludes our 3 parts (part 1, part 2) series on recording high quality audio and video files over slow [...]

  3. Vivek Says:

    Hi Octavian,

    I see my buffer keeps growing even after i set it to
    null as stated “In code (as2) Step 2 translates in ns.attachAudio(null) followed by ns.attachVideo(null).” in Buffer Full event.
    What can be the problem?

    Thanks,
    Vivek

Leave a Reply