首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >闪光灯:提高相机的数据速率/质量

闪光灯:提高相机的数据速率/质量
EN

Stack Overflow用户
提问于 2010-02-22 17:16:35
回答 2查看 5.3K关注 0票数 2

我目前正在使用一个质量很好的usb camera。在驱动程序提供的查看器中查看摄像头的视频质量非常好(我假设它是用C++实现的)。正如预期的那样,Flash无法提供相同级别的质量。

但是,考虑到我对运行Flash的本地机器有完全的设置控制,我有什么选择来提高flash中传入的本地视频流的质量呢?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-02-23 02:39:38

使用公共函数setQuality(带宽:int,质量:int):void

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

语言版本:Flash3.0运行时版本: AIR 1.0、ActionScript Player 9

设置当前传出视频源的每秒最大带宽量或所需的图像质量。此方法通常仅适用于使用Flash Media Server传输视频的情况。

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

代码语言:javascript
复制
* 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。

代码语言:javascript
复制
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.
票数 2
EN

Stack Overflow用户

发布于 2010-02-23 04:24:34

正如托德指出的那样,setQuality()很好,但是您可能会看到使用setMode()更直接的结果,它允许您设置分辨率和帧率。如果你只是设置一个标准的摄像头源,然后将视频对象的大小调整为类似于640x480的大小,那么它只会使用像素加倍,除非你对摄像头对象本身使用setMode(640,480,30)。

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

希望这能有所帮助!

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2309868

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档