WOWZMediaConfig

Conforms to:
NSMutableCopying, NSCopying, NSCoding
Superclass:
NSObject
Declared In:

Introduction

The WOWZMediaConfig class provides configuration properties for capturing and encoding audio and video.



Methods

+AVCaptureSessionPresetFromPreset:
+CGSizeFromPreset:
+closestAVCaptureSessionPresetByWidth:
-copyTo:
-equals:
-initWithPreset:
-isLandscape
-isPortrait
-loadPreset:
+presetConfigs
+presets
-toAVCaptureSessionPreset
-toClosestAVCaptureSessionPreset
-toClosestPreset
-toPreset

AVCaptureSessionPresetFromPreset:


+ (nullable NSString *) AVCaptureSessionPresetFromPreset:(WOWZFrameSizePreset)wzPreset; 
Parameters
wzPreset

The WOWZFrameSizePreset to convert.

Return Value

The AVFoundation AVCaptureSessionPreset string that corresponds to the specified WOWZFrameSizePreset.

Discussion

Converts a WOWZFrameSizePreset to an AVFoundation AVCaptureSessionPreset string.


CGSizeFromPreset:


Parameters
preset

The WOWZFrameSizePreset to convert.

Return Value

The CGSize that corresponds to the specified WOWZFrameSizePreset.

Discussion

Converts a WOWZFrameSizePreset to a corresponding CGSize.


closestAVCaptureSessionPresetByWidth:


+ (nullable NSString *) closestAVCaptureSessionPresetByWidth:(NSUInteger)width; 
Parameters
width

The width of the video capture.

Return Value

The AVFoundation AVCaptureSessionPreset string that most closely matches the specified width.

Discussion

Returns the AVFoundation AVCaptureSessionPreset string that most closely matches the specified width.


copyTo:


- (void) copyTo:(nonnull WOWZMediaConfig *)other; 
Parameters
other

The WOWZMediaConfig being copied to.

Discussion

Copies the receiver's settings to the specified WOWZMediaConfig.


equals:


- (BOOL) equals:(nonnull WOWZMediaConfig *)other; 
Parameters
other

The WOWZMediaConfig to test.

Return Value

Yes if the receiver and specified config are equal; no otherwise.

Discussion

Tests the receiver for equality to the specified WOWZMediaConfig.


initWithPreset:


- (nonnull instancetype) initWithPreset:(WOWZFrameSizePreset)preset; 
Parameters
preset

The frame-size preset.

Return Value

An instance of WOWZMediaConfig with the specified frame size and recommended bitrate for that frame size.

Discussion

Initializes a new WOWZMediaConfig with a specified frame-size and bitrate preset.


isLandscape


- (BOOL) isLandscape; 
Return Value

Yes if the receiver's frame size is landscape; no otherwise.

Discussion

Determines whether the receiver's frame orientation is landscape.


isPortrait


- (BOOL) isPortrait; 
Return Value

Yes if the receiver's frame orientation is portrait; no otherwise.

Discussion

Determines whether the receiver's frame orientation is portrait.


loadPreset:


- (void) loadPreset:(WOWZFrameSizePreset)preset; 
Parameters
preset

The preset to use.

Discussion

Sets the frame size and recommended bitrate of the receiver to the specified a WOWZFrameSizePreset.


presetConfigs


+ (nonnull NSArray *) presetConfigs; 
Return Value

The array of WOWZMediaConfig objects.

Discussion

Returns an array of WOWZMediaConfig objects for each WOWZFrameSizePreset.


presets


+ (nonnull NSArray *) presets; 
Return Value

The array of NSNumber values.

Discussion

Returns an array of NSNumber values for each WOWZFrameSizePreset.


toAVCaptureSessionPreset


- (nullable NSString *) toAVCaptureSessionPreset; 
Return Value

The corresponding AVFoundation AVCaptureSessionPreset string for this config.

Discussion

Gets the receiver's corresponding AVFoundation AVCaptureSessionPreset string.


toClosestAVCaptureSessionPreset


- (nonnull NSString *) toClosestAVCaptureSessionPreset; 
Return Value

The closest corresponding AVFoundation AVCaptureSessionPreset string.

Discussion

Gets the receiver's closest corresponding AVFoundation AVCaptureSessionPreset string.


toClosestPreset


- (WOWZFrameSizePreset) toClosestPreset; 
Return Value

The closest corresponding WOWZFrameSizePreset.

Discussion

Gets the receiver's closest corresponding WOWZFrameSizePreset.


toPreset


- (WOWZFrameSizePreset) toPreset; 
Return Value

The corresponding WOWZFrameSizePreset.

Discussion

Gets the receiver's corresponding WOWZFrameSizePreset.


Typedefs

NS_ENUM
NS_ENUM
NS_ENUM
NS_ENUM
NS_ENUM
WOWZAudioChannels
WOWZBroadcastOrientation
WOWZBroadcastScaleMode
WOWZFrameSizePreset
WOWZVideoRenderMethod

NS_ENUM


private

typedef NS_ENUM(NSUInteger, WOWZFrameSizePreset) { WOWZFrameSizePreset352x288, WOWZFrameSizePreset640x480, WOWZFrameSizePreset1280x720, WOWZFrameSizePreset1920x1080, WOWZFrameSizePreset3840x2160, WOWZFrameSizePresetCount };
Constants
WOWZFrameSizePreset352x288

352x288 pixels.

WOWZFrameSizePreset640x480

640x480 pixels.

WOWZFrameSizePreset1280x720

1280x720 pixels, or 720p.

WOWZFrameSizePreset1920x1080

1920x1080 pixels, or 1080p.

WOWZFrameSizePreset3840x2160

3840x2160 pixels, or UHD 4K.

WOWZFrameSizePresetCount

Count of known frame sizes.

Discussion

Standard frame sizes for the broadcasted video. (Note that not all devices and cameras support all frame sizes.)

See Also


NS_ENUM


private

typedef NS_ENUM(NSUInteger, WOWZBroadcastOrientation) { WOWZBroadcastOrientationSameAsDevice, WOWZBroadcastOrientationAlwaysLandscapeLeft, WOWZBroadcastOrientationAlwaysPortrait, WOWZBroadcastOrientationAlwaysLandscapeRight, WOWZBroadcastOrientationAlwaysPortraitUpsideDown };
Constants
WOWZBroadcastOrientationSameAsDevice

Use the orientation of the device when the broadcast starts.

WOWZBroadcastOrientationAlwaysLandscapeLeft

Always broadcast in landscape left orientation (this maintains a left orientation for the person viewing the video on the device as the device is rotated).

WOWZBroadcastOrientationAlwaysPortrait

Always broadcast in portrait orientation.

WOWZBroadcastOrientationAlwaysLandscapeRight

Always broadcast in landscape right orientation.

WOWZBroadcastOrientationPortraitUpsideDown

Always broadcast in portrait orientation and rotated 180 degrees.

Discussion

Orientation options for the broadcasted video.

See Also


NS_ENUM


private

typedef NS_ENUM(NSUInteger, WOWZBroadcastScaleMode) { WOWZBroadcastScaleModeAspectFit, WOWZBroadcastScaleModeAspectFill };
Constants
WOWZBroadcastScaleModeAspectFit

Scale captured frames down to fit within the broadcast frame.

WOWZBroadcastScaleModeAspectFill

Scale captured frames up to fill the broadcast frame.

Discussion

Adjustments for captured frames that don't match the specified broadcast frame size.

See Also


NS_ENUM


private

typedef NS_ENUM(NSUInteger, WOWZAudioChannels) { WOWZAudioChannelsMono = 1, WOWZAudioChannelsStereo = 2 };
Constants
WOWZAudioChannelsMono

Mono, or one channel.

WOWZAudioChannels

Stereo, or two channels.

Discussion

The number of audio channels to use. (Note that not all devices support all audio-channel counts.)

See Also


NS_ENUM


private

typedef NS_ENUM(NSUInteger, WOWZVideoRenderMethod) { WOWZVideoRenderMethodAuto = 1, WOWZVideoRenderMethodMetal = 2, WOWZVideoRenderMethodMetal_sRGB = 3, WOWZVideoRenderMethodOpenGL = 4 };
Constants
WOWZVideoRenderMethodAuto

If the playback device supports Apple's Metal framework, render the playback video using the WOWZVideoRenderMethodMetal_sRGB method. Otherwise, render the playback video using the WOWZVideoRenderMethodOpenGL method. WOWZVideoRenderMethodAuto is the default.

WOWZVideoRenderMethodMetal

If the playback device supports Apple's Metal framework, render the playback video using Apple's Metal framework. Otherwise, render the playback video using the WOWZVideoRenderMethodOpenGL method. Because using the Metal framework consumes less energy and GPU cycles, it's the preferred method for playing Ultra Low Latency streams. The WOWZVideoRenderMethodMetal method also uses the default Metal color space, which results in more saturated colors than either the WOWZVideoRenderMethodMetal_sRGB method or the WOWZVideoRenderMethodOpenGL method.

WOWZVideoRenderMethodMetal_sRGB

If the playback device supports Apple's Metal framework, render the playback video using the Metal framework and assuming the video frames are in the sRGB color space. Otherwise, render the playback video using the WOWZVideoRenderMethodOpenGL method. Because using the Metal framework consumes less energy and GPU cycles, it's the preferred method for playing Ultra Low Latency streams. The WOWZVideoRenderMethodMetal_sRGB method is also more visually consistent with the colors rendered by the WOWZVideoRenderMethodOpenGL method, which results in less saturated colors than the WOWZVideoRenderMethodMetal method.

WOWZVideoRenderMethodOpenGL

Use OpenGL APIs to render the playback video.

Discussion

Video rendering methods available for drawing video frames for GoCoder SDK-based playback.

See Also


WOWZAudioChannels


private

typedef NS_ENUM(NSUInteger, WOWZAudioChannels) { WOWZAudioChannelsMono = 1, WOWZAudioChannelsStereo = 2 };
Constants
WOWZAudioChannelsMono

Mono, or one channel.

WOWZAudioChannels

Stereo, or two channels.

Discussion

The number of audio channels to use. (Note that not all devices support all audio-channel counts.)

See Also


WOWZBroadcastOrientation


private

typedef NS_ENUM(NSUInteger, WOWZBroadcastOrientation) { WOWZBroadcastOrientationSameAsDevice, WOWZBroadcastOrientationAlwaysLandscapeLeft, WOWZBroadcastOrientationAlwaysPortrait, WOWZBroadcastOrientationAlwaysLandscapeRight, WOWZBroadcastOrientationAlwaysPortraitUpsideDown };
Constants
WOWZBroadcastOrientationSameAsDevice

Use the orientation of the device when the broadcast starts.

WOWZBroadcastOrientationAlwaysLandscapeLeft

Always broadcast in landscape left orientation (this maintains a left orientation for the person viewing the video on the device as the device is rotated).

WOWZBroadcastOrientationAlwaysPortrait

Always broadcast in portrait orientation.

WOWZBroadcastOrientationAlwaysLandscapeRight

Always broadcast in landscape right orientation.

WOWZBroadcastOrientationPortraitUpsideDown

Always broadcast in portrait orientation and rotated 180 degrees.

Discussion

Orientation options for the broadcasted video.

See Also


WOWZBroadcastScaleMode


private

typedef NS_ENUM(NSUInteger, WOWZBroadcastScaleMode) { WOWZBroadcastScaleModeAspectFit, WOWZBroadcastScaleModeAspectFill };
Constants
WOWZBroadcastScaleModeAspectFit

Scale captured frames down to fit within the broadcast frame.

WOWZBroadcastScaleModeAspectFill

Scale captured frames up to fill the broadcast frame.

Discussion

Adjustments for captured frames that don't match the specified broadcast frame size.

See Also


WOWZFrameSizePreset


private

typedef NS_ENUM(NSUInteger, WOWZFrameSizePreset) { WOWZFrameSizePreset352x288, WOWZFrameSizePreset640x480, WOWZFrameSizePreset1280x720, WOWZFrameSizePreset1920x1080, WOWZFrameSizePreset3840x2160, WOWZFrameSizePresetCount };
Constants
WOWZFrameSizePreset352x288

352x288 pixels.

WOWZFrameSizePreset640x480

640x480 pixels.

WOWZFrameSizePreset1280x720

1280x720 pixels, or 720p.

WOWZFrameSizePreset1920x1080

1920x1080 pixels, or 1080p.

WOWZFrameSizePreset3840x2160

3840x2160 pixels, or UHD 4K.

WOWZFrameSizePresetCount

Count of known frame sizes.

Discussion

Standard frame sizes for the broadcasted video. (Note that not all devices and cameras support all frame sizes.)

See Also


WOWZVideoRenderMethod


private

typedef NS_ENUM(NSUInteger, WOWZVideoRenderMethod) { WOWZVideoRenderMethodAuto = 1, WOWZVideoRenderMethodMetal = 2, WOWZVideoRenderMethodMetal_sRGB = 3, WOWZVideoRenderMethodOpenGL = 4 };
Constants
WOWZVideoRenderMethodAuto

If the playback device supports Apple's Metal framework, render the playback video using the WOWZVideoRenderMethodMetal_sRGB method. Otherwise, render the playback video using the WOWZVideoRenderMethodOpenGL method. WOWZVideoRenderMethodAuto is the default.

WOWZVideoRenderMethodMetal

If the playback device supports Apple's Metal framework, render the playback video using Apple's Metal framework. Otherwise, render the playback video using the WOWZVideoRenderMethodOpenGL method. Because using the Metal framework consumes less energy and GPU cycles, it's the preferred method for playing Ultra Low Latency streams. The WOWZVideoRenderMethodMetal method also uses the default Metal color space, which results in more saturated colors than either the WOWZVideoRenderMethodMetal_sRGB method or the WOWZVideoRenderMethodOpenGL method.

WOWZVideoRenderMethodMetal_sRGB

If the playback device supports Apple's Metal framework, render the playback video using the Metal framework and assuming the video frames are in the sRGB color space. Otherwise, render the playback video using the WOWZVideoRenderMethodOpenGL method. Because using the Metal framework consumes less energy and GPU cycles, it's the preferred method for playing Ultra Low Latency streams. The WOWZVideoRenderMethodMetal_sRGB method is also more visually consistent with the colors rendered by the WOWZVideoRenderMethodOpenGL method, which results in less saturated colors than the WOWZVideoRenderMethodMetal method.

WOWZVideoRenderMethodOpenGL

Use OpenGL APIs to render the playback video.

Discussion

Video rendering methods available for drawing video frames for GoCoder SDK-based playback.

See Also


Properties

allowHLSPlayback
audioBitrate
audioChannels
audioEnabled
audioSampleRate
backgroundBroadcastEnabled
broadcastScaleMode
broadcastVideoOrientation
capturedVideoRotates
frameSize
frameSizeLabel
hlsURL
mirrorFrontCamera
videoBitrate
videoBitrateLowBandwidthScalingFactor
videoEnabled
videoFrameBufferSizeMultiplier
videoFrameRate
videoFrameRateLowBandwidthSkipCount
videoHeight
videoKeyFrameInterval
videoPreviewRotates
videoRenderingMethod
videoWidth

allowHLSPlayback


@property (nonatomic,
    assign) BOOL allowHLSPlayback; 
Discussion

Allow fallback to Apple HLS if the primary WOWZ connection is unsuccessful. The default is no. Can be used with ultra low latency streams from Wowza Streaming Cloud; note, however, that Apple HLS streams experience greater latency than WebSocket streams.


audioBitrate


@property (nonatomic,
    assign) NSUInteger audioBitrate; 
Discussion

The audio bitrate. (Note that the actual bitrate may differ from the specified rate.) Specify 0 to have WowzaGoCoder select the optimal bitrate based on the current hardware capabilities. The default is 0.


audioChannels


@property (nonatomic,
    assign) NSUInteger audioChannels; 
Discussion

The number of audio channels.


audioEnabled


@property (nonatomic,
    assign) BOOL audioEnabled; 
Discussion

Allow audio for the configuration. If true, enables audio for the broadcast or playback configuration; if false, disables audio and audio channels in the stream aren't decoded.


audioSampleRate


@property (nonatomic,
    assign) NSUInteger audioSampleRate; 
Discussion

The audio sample rate. (Note that the actual sample rate may differ from the specified rate.) Specify 0 to have WowzaGoCoder select the optimal sample rate based on the current hardware capabilities. The default is 0.


backgroundBroadcastEnabled


@property (nonatomic,
    assign) BOOL backgroundBroadcastEnabled; 
Discussion

Enable broadcasting when the app is in the background. If enabled, the host application must support the audio background mode (this is set in your app target's Capabilities tab, in the Background Modes section). When enabled, the app will continue to record and broadcast the live audio stream. Since the camera can't capture in the background on iOS, however, a blank or frozen video frame will appear while the app is in the background. The default is no.


broadcastScaleMode


@property (nonatomic,
    assign) WOWZBroadcastScaleMode broadcastScaleMode; 
Discussion

Set the scale mode for captured frames that don't fit the specified broadcast frame size. See WOWZBroadcastScaleMode for supported values. The default is WOWZBroadcastScaleModeAspectFit.


broadcastVideoOrientation


@property (nonatomic,
    assign) WOWZBroadcastOrientation broadcastVideoOrientation; 
Discussion

Set the broadcast orientation for a broadcast session. See WOWZBroadcastOrientation for supported values. The default is WOWZBroadcastOrientationSameAsDevice.


capturedVideoRotates


@property (nonatomic,
    assign) BOOL capturedVideoRotates; 
Discussion

Set the video to rotate to match the orientation of the device.


frameSize


@property (nonatomic,
    readonly) CGSize frameSize; 
Discussion

The video frame size, in CGSize format.


frameSizeLabel


@property (nonatomic,
    readonly,
    nonnull) NSString *frameSizeLabel; 
Discussion

A human-readable string that describes the video frame size.


hlsURL


@property (nonatomic,
    assign) NSString * _Nullable hlsURL; 
Discussion

The Apple HLS playback URL to use to play the stream as a fallback if the primary WOWZ connection is unsuccessful. Can be used with ultra low latency streams from Wowza Streaming Cloud; note, however, that Apple HLS streams experience greater latency than WebSocket streams.


mirrorFrontCamera


@property (nonatomic,
    assign) BOOL mirrorFrontCamera; 
Discussion

Set the front-facing camera to mirror captured video. The default is yes.


videoBitrate


@property (nonatomic,
    assign) NSUInteger videoBitrate; 
Discussion

The video bitrate to use. Note that the actual bitrate might be reduced if network bandwidth is insufficient for the specified bitrate.


videoBitrateLowBandwidthScalingFactor


@property (nonatomic,
    assign) Float32 videoBitrateLowBandwidthScalingFactor; 
Discussion

The factor by which to scale the bitrate in low-bandwidth conditions. Valid values are 0.0 to 1.0; all other values are ignored. Specifying 0.0 instructs the encoder to choose the best value; specifying 1.0 tells it to never throttle the bitrate. The default is 0.75.


videoEnabled


@property (nonatomic,
    assign) BOOL videoEnabled; 
Discussion

Allow video for the configuration. If true, enables video for the broadcast or playback configuration; if false, disables video and video channels in the stream aren't decoded.


videoFrameBufferSizeMultiplier


@property (nonatomic,
    assign) NSUInteger videoFrameBufferSizeMultiplier; 
Discussion

The value by which to multiply the frame rate to determine the number of frames to buffer before the encoder starts to throttle bitrate and/or frame rate. For example, if the frame rate is 30 and the videoFrameBufferSizeMultiplier is 5, the encoder will buffer 150 (5 x 30) frames before throttling. Specifying 0 instructs the encoder to choose the best value. The default is 4.


videoFrameRate


@property (nonatomic,
    assign) NSUInteger videoFrameRate; 
Discussion

The frame rate for the configuration. Note that the actual frame rate might be reduced if network bandwidth is insufficient for the specified frame rate.


videoFrameRateLowBandwidthSkipCount


@property (nonatomic,
    assign) NSUInteger videoFrameRateLowBandwidthSkipCount; 
Discussion

The number of frames to skip when the encoder can't keep up with the broadcaster. In poor networks conditions the encoder will continue to send frames to the broadcaster but will skip frames to conserve bandwidth. The maximum number of frames that can be skipped equals the keyframe interval minus one. For example, setting the skip count to 29 with a keyframe interval of 30 will produce a keyframe-only stream; setting to 1 will never skip frames. The default is 2, which skips every other frame.


videoHeight


@property (nonatomic,
    assign) NSUInteger videoHeight; 
Discussion

The video frame height for the configuration.


videoKeyFrameInterval


@property (nonatomic,
    assign) NSUInteger videoKeyFrameInterval; 
Discussion

The keyframe interval.


videoPreviewRotates


@property (nonatomic,
    assign) BOOL videoPreviewRotates; 
Discussion

Set the preview video session to rotate to match the orientation of the device.


videoRenderingMethod


@property (nonatomic,
    assign) WOWZVideoRenderMethod videoRenderingMethod; 
Discussion

The video rendering method to use when drawing video frames. See WOWZVideoRenderMethod for supported values. The default is WOWZVideoRenderMethodAuto.


videoWidth


@property (nonatomic,
    assign) NSUInteger videoWidth; 
Discussion

The video frame width for the configuration.