我的网站与youtube的工作方式相同。此刻,我正在尝试创建由WEBCAM捕获的视频图像。 视频图像应首先保存在我的计算机上(通过FLV格式),然后如果用户满意,他或她可以将其上传到服务器上
我正在尝试在Adobe Flash CS5和Flash媒体服务器4中使用Actionscript3
1-我该怎么做? 2-是否需要闪存介质服务器?
请注意我们希望允许用户将视频保存在他/她的计算机上,然后才能上传到服务器。
非常感谢。
答案 0 :(得分:0)
假设计算机可以承担动态编码的开销(或者有足够的内存来缓冲数据,然后可以通过编码过程运行数据),那么SO答案中提到的库应该可以工作: Encode video from any format to .flv format in AS3
我认为Flash媒体服务器在这种情况下才真正需要广播。
伪代码示例
private var cam:Camera;
public function Whatever()
{
//In constructor
addEventListener(Event.ENTER_FRAME, grabFrame);
cam = Camera.getCamera();
if (cam != null)
{
var vid:Video = new Video(cam.width, cam.height);
vid.attachCamera(cam);
addChild(vid);
}
}
private function grabFrame(event:Event):void
{
var bd:BitmapData = new BitmapData(cam.width, cam.height)
bd.draw(vid);
//now the BitmapData has a frame of the video, at this point you also
//would want to capture the audio then use the FLV class in the library
}
答案 1 :(得分:0)