Flash Player with Real-Time streams

Issues related to playing with Flash Player

Flash Player with Real-Time streams

Postby kg6ypi » Sun Mar 28, 2010 2:13 pm

For the most part the flash player is working great, it drops sometimes and i have to click pause & play again. Haven't tested this heavily or on buffered streams.

Is there any way to increase the buffer your Flash Player. And if i were to create my own flash application in AS3 could i use the the NetStream classes? Or did you guys do something special ;)

Example flash AS3 script below...i cant get this to connect.

var nc:NetConnection;
var ns:NetStream;
var serverUrl:String = "rtmp://localhost:5119/live/audio-from-webcam";

function ncOnStatus(infoObject:NetStatusEvent)
{
trace("ncOnStatus: "+infoObject.info.code);
if (infoObject.info.code == "NetConnection.Connect.Success")
{
doPlay();
}
}

function doConnect()
{
nc = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, ncOnStatus);
var ncClientObj:Object = new Object();
nc.client = ncClientObj;


trace("connect: "+serverUrl);
nc.connect(serverUrl);
}

function nsOnStatus(infoObject:NetStatusEvent)
{
trace("nsOnStatus: "+infoObject.info.code);
if (infoObject.info.code == "NetStream.Play.Start")
{
setInterval(doCompute, 500);
}
}

function doPlay()
{
ns = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, nsOnStatus);
var nsClientObj:Object = new Object();
ns.client = nsClientObj;

nsClientObj.onPlayStatus = function(infoObject:Object)
{
trace("onPlayStatus: "+infoObject.info.code);
}

ns.bufferTime = 0.01;

ns.play("audio-from-webcam");
}

doConnect();
kg6ypi
 
Posts: 0
Joined: Mon Aug 24, 2009 10:05 am

Re: Flash Player with Real-Time streams

Postby admin » Sun Mar 28, 2010 4:04 pm

You probably have network issues, otherwise there is no reason it will drop connection.

You can not control live buffer size in Flash player in general, and in our Flash player too.
Our Flash player plays in two modes, for "buffered" and "real-time" live sources:
1. "dynamic" buffer, which is employed when you have a "buffered" live source.
In this case the player will maintain a buffer of 5-10 seconds.
2. near-real-time (zero) buffer, which is employed when you have a "real-time" live source.
In this case the latency is close to zero, and player maintains no buffer.
In this case you must have at least 10-15 video fps in order to acheive good audio-video synrchonization.

Use real-time mode only if you have to, i.e. conferencing.
For radio/TV broadcasts, buffered mode is the way to go.
admin
Site Admin
 
Posts: 1042
Joined: Fri Aug 21, 2009 10:13 am

Re: Flash Player with Real-Time streams

Postby benbiles » Wed Jul 07, 2010 7:44 am

Hi we are audio video sync issues at 25fps 720x576 h264 / mp3 anything more we can do to lock audio and video together?
benbiles
 
Posts: 0
Joined: Mon Jun 21, 2010 1:44 pm

Re: Flash Player with Real-Time streams

Postby admin » Wed Jul 07, 2010 10:53 am

Make sure your real frame rate does not drop below 10-15 fps; then the synch in real-time mode should be OK.
admin
Site Admin
 
Posts: 1042
Joined: Fri Aug 21, 2009 10:13 am


Return to Playing with Flash Player

Who is online

Users browsing this forum: No registered users and 1 guest

cron