How do I encode video in Adobe Air/Flash?

别说谁变了你拦得住时间么 提交于 2019-12-01 12:11:56

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

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

For uncompressed video, you can do something like this: http://www.joristimmerman.be/wordpress/2008/12/18/flvrecorder-record-to-flv-using-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.)

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!