setQuality (Camera.setQuality method)

public setQuality([bandwidth:Number], [quality:Number]) : Void

Sets the maximum amount of bandwidth per second or the required picture quality of the current outgoing video feed. This method is generally applicable only if you are transmitting video using Flash Media Server.

Use this method to specify which element of the outgoing video feed is more important to your application--bandwidth use or picture quality.

Availability: ActionScript 1.0; Flash Player 6

Parameters

bandwidth:Number [optional] - An integer that specifies the maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second. To specify that Flash video can use as much bandwidth as needed to maintain the value of frameQuality, pass 0 for bandwidth. The default value is 16384.

quality:Number [optional] - 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. The default value is 0.

Example

The following examples illustrate how to use this method to control bandwidth use and picture quality.

// Ensure that no more than 8192 (8K/second) is used to send video
active_cam.setQuality(8192,0);

// Ensure that no more than 8192 (8K/second) is used to send video
// with a minimum quality of 50
active_cam.setQuality(8192,50);

// Ensure a minimum quality of 50, no matter how much bandwidth it takes
active_cam.setQuality(0,50);

See also

get (Camera.get method), quality (Camera.quality property), bandwidth (Camera.bandwidth property)


Flash CS3