I am attempting to capture a 1920x1080 webcam capture and create a new bitmap with the capture. I feel like I have all the dimension settings correct but the final 1920x1080 bitmap only contains a small 320x240 version of the video capture. Help!
import flash.display.Bitmap;
import flash.display.BitmapData;
var bandwidth:int = 1000; // Maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second.
var quality:int = 100; // This value is 0-100 with 1 being the lowest quality.
var cam:Camera = Camera.getCamera();
cam.setQuality(bandwidth, quality);
cam.setMode(1920,1080,60,true); // setMode(videoWidth, videoHeight, video fps, favor area)
var video:Video = new Video();
video.attachCamera(cam);
video.x = 0;
video.y = -100;
video.width = 1920;
video.height = 1080;
addChild(video);
var bitmapData:BitmapData = new BitmapData(video.width, video.height);
var bitmap:Bitmap = new Bitmap(bitmapData);
bitmap.x = 0;
bitmap.y = 0;
bitmap.width = 1920;
bitmap.height = 1080;
addChild(bitmap);
bitmap.visible = false;
capture_mc.buttonMode = true;
capture_mc.addEventListener(MouseEvent.CLICK,captureImage);
function captureImage(e:MouseEvent):void {
bitmapData.draw(video);
bitmap.visible = true;
}
Try lowering your Frames per second, instead of
try
You don't need 60 fps if all you are doing is taking a snapshot
There is also the possibility that your webcam might not support 1920x1080. Maybe try smaller sizes as well if changing FPS doesn't help.