You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I’ve tried your code but the video gets saved as a flv file in my documents folder but the problem i’m facing is that the video plays too fast, can you please help me out?
cam = Camera.getCamera();
cam.setMode(640, 480, 15);
vid = new Video(cam.width, cam.height);
vid.attachCamera(cam);
private function startRecording(e : MouseEvent) : void
{
this.addEventListener(flash.events.Event.ENTER_FRAME, enterFrame);
_baFlvEncoder = new ByteArrayFlvEncoder(stage.frameRate);
_baFlvEncoder.setVideoProperties(OUTPUT_WIDTH, OUTPUT_HEIGHT);
_baFlvEncoder.start();
}
public function enterFrame(evt:flash.events.Event):void
{
var bmpData:BitmapData = new BitmapData(OUTPUT_WIDTH, OUTPUT_HEIGHT, false, 0xFFFFFFFF);
bmpData.draw(vid);
_baFlvEncoder.addFrame(bmpData,null);
bmpData.dispose();
}
private function stopRecording(e : Event) : void
{
Hi there, I’ve tried your code but the video gets saved as a flv file in my documents folder but the problem i’m facing is that the video plays too fast, can you please help me out?
cam = Camera.getCamera();
cam.setMode(640, 480, 15);
vid = new Video(cam.width, cam.height);
vid.attachCamera(cam);
private function startRecording(e : MouseEvent) : void
{
this.addEventListener(flash.events.Event.ENTER_FRAME, enterFrame);
_baFlvEncoder = new ByteArrayFlvEncoder(stage.frameRate);
_baFlvEncoder.setVideoProperties(OUTPUT_WIDTH, OUTPUT_HEIGHT);
_baFlvEncoder.start();
bt.removeEventListener(MouseEvent.CLICK, startRecording);
}
public function enterFrame(evt:flash.events.Event):void
{
var bmpData:BitmapData = new BitmapData(OUTPUT_WIDTH, OUTPUT_HEIGHT, false, 0xFFFFFFFF);
bmpData.draw(vid);
_baFlvEncoder.addFrame(bmpData,null);
bmpData.dispose();
}
private function stopRecording(e : Event) : void
{
this.removeEventListener(flash.events.Event.ENTER_FRAME, enterFrame);
var fileRef:FileReference = new FileReference();
fileRef.save(_baFlvEncoder.byteArray, “test.flv”);
_baFlvEncoder.kill();
}
The text was updated successfully, but these errors were encountered: