Packageflash.media
Classpublic class VideoStreamSettings
InheritanceVideoStreamSettings Inheritance Object
SubclassesH264VideoStreamSettings

Language version: ActionScript 3.0
Runtime version: AIR 3

The VideoStreamSettings class enables specifying video compression settings for each NetStream. All parameters (resolution, frame rate, bandwidth, etc.) are gated by Camera capture parameters. You can use methods (setMode(), etc.) to specify desired encoder parameters and you can use the properties (width, etc.) to retrieve the actual compression parameters used. Properties will be validated once Camera is attached to NetStream object and compression has started.

Note Current implementation does not support setting properties per NetStream and Camera parameters will be used instead for each publishing NetStream.



Public Properties
 PropertyDefined by
  bandwidth : int
[read-only] Retrieve the maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second.
VideoStreamSettings
  codec : String
[read-only] Video codec used for compression.
VideoStreamSettings
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  fps : Number
[read-only] The maximum frame rate at which the video frames are encoded, in frames per second.
VideoStreamSettings
  height : int
[read-only] The current encoded height, in pixels.
VideoStreamSettings
  keyFrameInterval : int
[read-only] The number of video frames transmitted in full (called keyframes or IDR frames) instead of being interpolated by the video compression algorithm.
VideoStreamSettings
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  quality : int
[read-only] The required level of picture quality, as determined by the amount of compression being applied to each video frame.
VideoStreamSettings
  width : int
[read-only] The current encoded width, in pixels.
VideoStreamSettings
Public Methods
 MethodDefined by
  
Creates a setting object that specifies to use Sorenson Spark video codec for compresion.
VideoStreamSettings
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
setKeyFrameInterval(keyFrameInterval:int):void
The number of video frames transmitted in full (called keyframes or Instantaneous Decoding Refresh (IDR) frames) instead of being interpolated by the video compression algorithm.
VideoStreamSettings
  
setMode(width:int, height:int, fps:Number):void
Sets the resolution and frame rate used for video encoding.
VideoStreamSettings
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
setQuality(bandwidth:int, quality:int):void
Sets maximum amount of bandwidth per second or the required picture quality that the current outgoing video feed can use.
VideoStreamSettings
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Property detail
bandwidthproperty
bandwidth:int  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 3

Retrieve the maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second. To set this property, use the setQuality() method.

Implementation
    public function get bandwidth():int

See also

codecproperty 
codec:String  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 3

Video codec used for compression.

Implementation
    public function get codec():String
fpsproperty 
fps:Number  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 3

The maximum frame rate at which the video frames are encoded, in frames per second. To set a desired value for this property, use the setMode() method. This value is validated once Camera is attached to NetStream.

Implementation
    public function get fps():Number

See also

heightproperty 
height:int  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 3

The current encoded height, in pixels. To set a desired value for this property, use the setMode() method. This value is validated once Camera is attached to NetStream and compression has started.

Implementation
    public function get height():int

See also

keyFrameIntervalproperty 
keyFrameInterval:int  [read-only]

Language version: ActionScript 3.0 #see setKeyFrameInterval()
Runtime version: AIR 3

The number of video frames transmitted in full (called keyframes or IDR frames) instead of being interpolated by the video compression algorithm. To set a value for this property, use the setKeyFrameInterval() method.

Implementation
    public function get keyFrameInterval():int
qualityproperty 
quality:int  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 3

The required level of picture quality, as determined by the amount of compression being applied to each video frame. This value ranges from 1 (lowest quality, maximum compression) to 100 (highest quality, small compression). To set this property, use the setQuality() method.

Implementation
    public function get quality():int

See also

widthproperty 
width:int  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 3

The current encoded width, in pixels. To set a desired value for this property, use the setMode() method. This value is validated once Camera is attached to NetStream and compression has started.

Implementation
    public function get width():int

See also

Constructor detail
VideoStreamSettings()constructor
public function VideoStreamSettings()

Language version: ActionScript 3.0
Runtime version: AIR 3

Creates a setting object that specifies to use Sorenson Spark video codec for compresion.

Method detail
setKeyFrameInterval()method
public function setKeyFrameInterval(keyFrameInterval:int):void

Language version: ActionScript 3.0 #see keyFrameInterval
Runtime version: AIR 3

The number of video frames transmitted in full (called keyframes or Instantaneous Decoding Refresh (IDR) frames) instead of being interpolated by the video compression algorithm. The default value is 15, which means that every 15th frame is a keyframe. A value of 1 means that every frame is a keyframe. The allowed values are 1 through 300. Set to -1 to use the same value as specified for Camera object. This value is capped by Camera value.

Note This feature will be supported in future releases of Flash Player and AIR, for now, Camera parameters are used.

Parameters
keyFrameInterval:int — A value that specifies which video frames are transmitted in full (as keyframes or IDR frames) instead of being interpolated by the video compression algorithm.
setMode()method 
public function setMode(width:int, height:int, fps:Number):void

Language version: ActionScript 3.0
Runtime version: AIR 3

Sets the resolution and frame rate used for video encoding. Set each parameter to -1 to use same encoding value as capture value. Encoding values must be less than equal than capture values specified on Camera object. If invalid values are specified, capture values will be used. Currently, only integer downsampling is supported for both resolution and frame rate. Captured video is downsampled to desired resolution and frame rate. The specified values are validated once Camera is attached to NetStream. You can use width, height and fps properties to retrieve actual compressed width, height and frame rate, respectively.

Note This feature will be supported in future releases of Flash Player and AIR, for now, Camera parameters are used.

Parameters
width:int — The requested encode width, in pixels. The default value is -1 (same as capture width).
 
height:int — The requested encode height, in pixels. The default value is -1 (same as capture height).
 
fps:Number — The requested frame rate at which frames should be encoded, in frames per second. The default value is -1 (same as capture fps).

See also

setQuality()method 
public function setQuality(bandwidth:int, quality:int):void

Language version: ActionScript 3.0
Runtime version: AIR 3

Sets maximum amount of bandwidth per second or the required picture quality that the current outgoing video feed can use. To specify bandwidth, pass a value for bandwidth and 0 for quality. To specify quality, pass 0 for bandwidth and a value for quality. Both bandwidth and quality values are capped by Camera parameters.

Note This feature will be supported in future releases of Flash Player and AIR, for now, Camera parameters are used.

Parameters
bandwidth:int — Specifies the maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second. The default value is 16384 (128k bits-per-second (bps), which is very low for high quality video).
 
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, small compression). The default value is 0.

See also