PDA

View Full Version : Two quality streams from same webcam


Egglar
03-15-2005, 01:51 PM
Hi,

Ive built a very simple flash app to publish a live webcam stream onto FCS. I then have a viewer program to show the feed on a website. Im trying to give the viewer the option of chosing the quality of the stream (for high and low speed connections).

I am trying to do this by publishing two streams on the server - the viewer then choese the stream based on the choice of the user.

My code:

//High quality stream
office_cam = camera.get();

office_cam.setMode(320, 240, 15);
office_cam.setQuality(144000, 90);
office_cam.setKeyFrameInterval(60);

live_video.attachVideo(office_cam);
office_cam.setLoopback(true);

//low quality stream
office_camlow = camera.get();

office_camlow.setMode(320, 240, 7);
office_camlow.setQuality(67200, 50);
office_camlow.setKeyFrameInterval(32);

live_videolow.attachVideo(office_camlow);
office_camlow.setLoopback(true);


function doConnect() {
nc = new NetConnection();
nc.connect("rtmp://server/office_cam/cam1");
}
function publishMe() {
out_ns = new NetStream(nc);
out_ns.publish("officestream");
out_ns.attachVideo(office_cam);

outlow_ns = new NetStream(nc);
outlow_ns.publish("officestreamlow");
outlow_ns.attachVideo(office_camlow);

}
doConnect();
publishMe();


Problem i have is both streams revert to the low quality settings - im i correct in thinking that i cant publish two different quality streams from the same camera?

Any advice or help on this would be greatly appriceated.

Many thanks,

Elliot.

dsdsdsdsd
03-26-2005, 07:48 PM
Egglar, I believe that you cannot have multiple streams of different qualities from the same camera; WHY - because the settings are camera settings, not stream settings;

2 POSSIBILITIES:
1 - if you are streaming live video (as in video conference) the other user (the viewer) could have a set of 'camera publish controls' - essentially a set of variables and a button that when pressed send the variables to the publishing camera and thus the viewer controls the settings for the publishing camera;

2- if you are recording a video then just make multiple records with the different settings; though this is clearly not a good way of going about it it seems to be the only way unless you have an audio mixing board;

Shannon Burnett
Asheville NC USA