Wowza Community

Buffering in AS3

Hello,

I got my application to record video fine (using AS3) but when I play back my recorded stream plays too choppy. If I add buffering to my code would this help it? I check out the recording sample but it’s written in AS2 and the buffering commands don’t work in AS3. Can anyone please give me pointers as to how to add buffering or what can I do so that I get a better flow on my recorded stream?

Thanks for your help,

Louis

Louis,

Here is how to set buffer in AS3:

nsPlay.bufferTime=1;

But also look at the streamType in the wowza_install/conf/yourapp/Application.xml file. Try “record”, or “live-record”, or “live-record-lowlatency”.

Richard

I suggest you use our VideoRecording example as a starting point for your code. When you use a client side buffer you need to properly close the stream when the recording stops. This post describes the process:

http://www.wowza.com/forums/showpost.php?p=2513&postcount=2

Charlie

Thanks Richard,

I have tried these settings for Recording (AS3):

cam.setMode(320, 240, 30, false);
cam.setQuality(0,88);
cam.setKeyFrameInterval(10);
mic.rate = 11;

Play Button:

ns.play(StreamName);
ns.pause();
ns.resume();

Record Button:

vid_screen.attachCamera(cam);
ns.close();
ns = new NetStream(nc);
ns.client = client;
ns.attachCamera(cam);
ns.bufferTime = 2;
ns.attachAudio(mic);

I have played with the bufferTime ranging from .1 to 100 and it doesn’t make a difference. Am I not using bufferTime correctly? It records better without the buffering, but my recording still not smooth it looks like it plays and stops, although the sound plays just perfect even when the video stops and goes. I am using AS3. It seams that buffering is handled different in AS3 than AS2.

What can I do, please help,

Thanks again,

Louis

Thanks Charlie,

I finally got the buffering to work on AS3.

One more question. Is there a chart that will tell me at how many seconds to set the buffer depending on the connection speed etc.

Louis