Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video playing too fast #6

Open
geek2014 opened this issue Nov 23, 2014 · 1 comment
Open

Video playing too fast #6

geek2014 opened this issue Nov 23, 2014 · 1 comment

Comments

@geek2014
Copy link

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();
}

@7md8003
Copy link

7md8003 commented Apr 23, 2024

Confused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants