Two quality streams from same webcam
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.
|