使用Flex / Flash的录音 [英] Recording using Flex/Flash

查看:245
本文介绍了使用Flex / Flash的录音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,我们无法录制/存取什么出格的Flash Player,因为它的安全沙箱。 相反,我们可以录制视频的同时流给服务器。 像

I know that we can not record/Access anything out of flash player, because of it's security sandbox. Instead We can record the video while streaming it to server. like

   netStream.publish("YourFileName.flv","record");

但在recorde文件,我将只得到一个视频文件的发布者网络摄像头服务器,我想记录整个会话。

But in recorde file, I will get only a video file Published by webcam to server and i want to record entire session.

有没有办法在本地记录它,或者我可以记录窗口??

Is there any way to record it locally, or Can i record the window ??

P.S。 :我不是到Flash Player以外的访问任何

p.s. : I am not trying to access anything outside of flash player.

在此先感谢...

推荐答案

好了,你可以记录这样的SWF的全部内容:

ok, so you can record the entire contents of the swf like this:

首先,创建一个容器对象(任何扩展的DisplayObject它实现的IBitmapDrawable),然后将要捕捉一切(视频观看和其他一切在你的会议),然后使用ENTER_FRAME事件或定时器(preferable控制捕捉FPS),用画的BitmapData.draw(容器)容器的BitmapData。传递的BitmapData到 FLV EN code这里找到使用它的ADDFRAME()方法(文档和库实例来与该库......超级简单),这就是它!当你完成,你将有一个包含一帧一帧截屏是什么在SWF正酣的FLV视频!只要确保一切都在容器中!这LIB也接受捕获的音频太多,如果你想要的。

first, create a container object (anything that extends DisplayObject which implements IBitmapDrawable) then place everything that you want to capture (video view and everything else in your "session") then using an ENTER_FRAME event or Timer (preferable to control capture fps), draw the container to a BitmapData using BitmapData.draw(container). Pass that BitmapData to the FLV encode library found here using it's addFrame() method (docs and examples come with that library... super easy) and that's it! When you are done, you will have an flv video containing a frame by frame "screen capture" of what was going on in your swf! Just make sure EVERYTHING is in the container! That lib also accepts captured audio too if you want.

private function startCapturing():void{
    flvEncoder.start(); // see the libs docs and examples

    var timer:Timer = new Timer(1000/15); //capture at 15 fps
    timer.addEventListener(TimerEvent.Timer, onTimer);
    timer.start();
}

private function onTimer(event:TimerEvent):void{
    var screenCap:BitmapData = new BitmapData(container.width, container.height);
    screenCap.draw(container);

    flvEncoder.addFrame(screenCap); // see the libs docs and examples
}

这篇关于使用Flex / Flash的录音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆