Flash:提高相机的数据速率/质量

时间:2010-02-22 09:16:35

标签: flash actionscript-3 video camera

我目前正在以高质量usb camera工作。在随驱动程序提供的查看器中查看时,相机的视频质量非常好(我认为它是使用C ++实现的)。而且预计Flash无法提供相同水平的质量。

但考虑到我对运行闪存的本地计算机进行了完整的设置控制,我可以选择在Flash中提高传入本地视频流的质量吗?

2 个答案:

答案 0 :(得分:3)

Todd指出,

setQuality()很好,但你可以通过setMode()看到更直接的结果,它可以让你设置分辨率和帧率。如果你只是设置一个标准的摄像机输入,然后将视频对象的大小调整为640x480,它只会使用像素加倍,除非你在Camera对象本身使用setMode(640,480,30)。

作为参考,除非您使用setMode()手动设置,否则您的实际视频输入将以160x120呈现。

希望有所帮助!

答案 1 :(得分:2)

使用public function setQuality(bandwidth:int,quality:int):void

请参阅:http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/Camera.html#setQuality%28%29了解更多信息

语言版本:ActionScript 3.0 运行时版本:AIR 1.0,Flash Player 9

设置每秒最大带宽量或当前传出视频源所需的图片质量。只有在使用Flash Media Server传输视频时,此方法才适用。

使用此方法指定传出视频Feed的哪个元素对您的应用程序带宽使用或图片质量更重要。

* To indicate that bandwidth use takes precedence, pass a value for bandwidth and 0 for quality. Flash Player transmits video at the highest quality possible within the specified bandwidth. If necessary, Flash Player reduces picture quality to avoid exceeding the specified bandwidth. In general, as motion increases, quality decreases.
* To indicate that quality takes precedence, pass 0 for bandwidth and a numeric value for quality. Flash Player uses as much bandwidth as required to maintain the specified quality. If necessary, Flash Player reduces the frame rate to maintain picture quality. In general, as motion increases, bandwidth use also increases.
* To specify that both bandwidth and quality are equally important, pass numeric values for both parameters. Flash Player transmits video that achieves the specified quality and that doesn't exceed the specified bandwidth. If necessary, Flash Player reduces the frame rate to maintain picture quality without exceeding the specified bandwidth.

参数     bandwidth:int - 指定当前传出视频源可以使用的最大带宽量,以每秒字节数为单位。要指定Flash Player视频可以使用所需的带宽来维持质量值,请为带宽传递0。默认值为16384。

quality:int — An integer that specifies the required level of picture quality, as determined by the amount of compression being applied to each video frame. Acceptable values range from 1 (lowest quality, maximum compression) to 100 (highest quality, no compression). To specify that picture quality can vary as needed to avoid exceeding bandwidth, pass 0 for quality.
相关问题