代码之家  ›  专栏  ›  技术社区  ›  BefittingTheorem

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

  •  2
  • BefittingTheorem  · 技术社区  · 15 年前

    我工作质量很好 usb camera 目前。摄像机的视频质量在观看者提供的驱动程序中是相当好的(我假设它是用C++实现的)。正如预期的那样,flash不能提供相同的质量水平。

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

    2 回复  |  直到 15 年前
        1
  •  2
  •   Todd Moses    15 年前

    使用公共函数setquality(带宽:int,质量: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

    设置每秒的最大带宽量或当前传出视频源所需的图片质量。此方法通常仅适用于使用闪存媒体服务器传输视频的情况。

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

    * 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.
    

    参数 带宽:int_指定当前传出视频馈送可以使用的最大带宽量(字节/秒)。要指定Flash播放器视频可以使用尽可能多的带宽来保持质量值,请通过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.
    
        2
  •  3
  •   Myk    15 年前

    正如todd指出的那样,setQuality()很好,但是使用setMode()您可能会看到更直接的结果,它允许您设置分辨率和帧速率。如果您只是设置了一个标准的相机馈送,然后将视频对象的大小调整为640x480,它将只使用像素倍增,除非您对相机对象本身使用setmode(640480,30)。

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

    希望有帮助!