NetStreams: Correcting stuttering video in Red5/Flash Media Server 2

Nothing is move disheartening to an interactive developer than videos sputtering and dropping packets. Its just plain embarrassing, especially when you're presenting to management or a client, all you get for your efforts are raised eyebrows, polite coughs, pursed lips and all that.... The problem of stuttering video in RTMP socket servers, viz, Flash Media Server and Red 5 can be solved either on the client or server. This embarrassing problem is usually the result of insufficient data buffering or insufficient bandwidth.

Stream Buffering: In Actionscript 2.0, the NetStream.setBufferingTime(t:Number) should solve the problem, in Actionscript 3.0, the NetStream.bufferTime achieves the same. I found this approach especially useful when dealing with the problem of stuttering streams from a Red5 server set up.
Rupert Bear was stream optimized on Red5.

AS2

_nc:NetConnection = new NetConnection();
_nc.connect("rtmp://aYo1/streamingHeadache");
_ns:NetStream = new NetStream(_nc);
_ns.setBufferTime(5);
_ns.play("video1");

AS3

_nc:NetConnection = new NetConnection();
_nc.connect("rtmp://aYo1/streamingHeadache");
_ns:NetStream = new NetStream(_nc);
_ns.bufferTime = 5;
_ns.play("video1");

2 comments:

gdl blogger said...

here is another solution for frame dropping : http://www.adobe.com/devnet/flashmediaserver/articles/fms_dual_buffering.html

aYo ii said...

Thanks gdl_blogger. Every little extra nugget of information helps

My Instagram