如何在 Adob​​e Air/Flash 中编码视频? [英] How do I encode video in Adobe Air/Flash?

查看:13
本文介绍了如何在 Adob​​e Air/Flash 中编码视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Adob​​e Air Flash、Action script 3.0 应用程序.我需要将网络摄像头(或者一系列位图作为帧)保存到视频文件中.视频文件需要压缩,需要随帧保存.

I have an Adobe Air Flash, Action script 3.0 application. I need to save the webcam (or rather a series of bitmap as frames) to a video file. The video file needs to be compressed and needs to save as the frames go.

推荐答案

AIR/Flash 不允许您访问任何本地视频编码器,因此压缩视频是这个问题的难点.

AIR/Flash don't give you access to any local video encoders, so compressing the video is the hard part of this problem.

其余的,使用 BitmapData.draw() 函数抓取视频帧.然后,您可以将文本绘制到相同的位图数据中.

For the rest, grab video frames using the BitmapData.draw() function. You can then draw the text into the same bitmapdata.

对于未压缩的视频,您可以执行以下操作:http://www.joristimmerman.be/wordpress/2008/12/18/flvrecorder-record-to-flv-using-air/.

For uncompressed video, you can do something like this: http://www.joristimmerman.be/wordpress/2008/12/18/flvrecorder-record-to-flv-using-air/.

理论上,您可以使用 ActionScript 编写视频编码器.没有人这样做的事实告诉我你会遇到问题(技术或法律 - 对于某些编解码器).在 AIR 中,更好的做法是使用 NativeProcess API 或本机扩展将编码卸载到本机代码.这需要将 AIR 应用程序本身作为本机应用程序发布,并为您支持的每个平台创建一个单独的版本.(通过添加对本机代码的依赖,您将失去 AIR 的跨平台优势.)

Theoretically, you can write a video encoder in ActionScript. The fact that nobody has done so tells me that you would run into problems (either technicaql or legal -- for some codecs). In AIR a better course of action would be to use the NativeProcess API or a native extension to offload the encoding to native code. This requires releasing the AIR app itself as a native app and creating a separate version for each platform you support. (By adding dependencies on native code, you lose the cross-platform benefits of AIR.)

在 Flash(在 Web 上)中,执行此操作的典型方法是将相机流发送到服务器并在那里进行处理.

In Flash (on the Web), the typical way to do this is to send the camera stream to a server and do your processing there.

这篇关于如何在 Adob​​e Air/Flash 中编码视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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