WOWZMediaConfig
IntroductionThe WOWZMediaConfig class provides configuration properties for capturing and encoding audio and video. Methods
AVCaptureSessionPresetFromPreset:+ (nullable NSString *) AVCaptureSessionPresetFromPreset:(WOWZFrameSizePreset)wzPreset; ParametersReturn ValueThe AVFoundation AVCaptureSessionPreset string that corresponds to the specified WOWZFrameSizePreset. DiscussionConverts a WOWZFrameSizePreset to an AVFoundation AVCaptureSessionPreset string. CGSizeFromPreset:+ (CGSize) CGSizeFromPreset:(WOWZFrameSizePreset)preset; ParametersReturn ValueThe CGSize that corresponds to the specified WOWZFrameSizePreset. DiscussionConverts a WOWZFrameSizePreset to a corresponding CGSize. closestAVCaptureSessionPresetByWidth:+ (nullable NSString *) closestAVCaptureSessionPresetByWidth:(NSUInteger)width; ParametersReturn ValueThe AVFoundation AVCaptureSessionPreset string that most closely matches the specified width. DiscussionReturns the AVFoundation AVCaptureSessionPreset string that most closely matches the specified width. copyTo:- (void) copyTo:(nonnull WOWZMediaConfig *)other; ParametersDiscussionCopies the receiver's settings to the specified WOWZMediaConfig. equals:- (BOOL) equals:(nonnull WOWZMediaConfig *)other; ParametersReturn ValueYes if the receiver and specified config are equal; no otherwise. DiscussionTests the receiver for equality to the specified WOWZMediaConfig. initWithPreset:- (nonnull instancetype) initWithPreset:(WOWZFrameSizePreset)preset; ParametersReturn ValueAn instance of WOWZMediaConfig with the specified frame size and recommended bitrate for that frame size. DiscussionInitializes a new WOWZMediaConfig with a specified frame-size and bitrate preset. isLandscape- (BOOL) isLandscape; Return ValueYes if the receiver's frame size is landscape; no otherwise. DiscussionDetermines whether the receiver's frame orientation is landscape. isPortrait- (BOOL) isPortrait; Return ValueYes if the receiver's frame orientation is portrait; no otherwise. DiscussionDetermines whether the receiver's frame orientation is portrait. loadPreset:- (void) loadPreset:(WOWZFrameSizePreset)preset; ParametersDiscussionSets the frame size and recommended bitrate of the receiver to the specified a WOWZFrameSizePreset. presetConfigs+ (nonnull NSArray *) presetConfigs; Return ValueThe array of WOWZMediaConfig objects. DiscussionReturns an array of WOWZMediaConfig objects for each WOWZFrameSizePreset. presets+ (nonnull NSArray *) presets; Return ValueThe array of NSNumber values. DiscussionReturns an array of NSNumber values for each WOWZFrameSizePreset. toAVCaptureSessionPreset- (nullable NSString *) toAVCaptureSessionPreset; Return ValueThe corresponding AVFoundation AVCaptureSessionPreset string for this config. DiscussionGets the receiver's corresponding AVFoundation AVCaptureSessionPreset string. toClosestAVCaptureSessionPreset- (nonnull NSString *) toClosestAVCaptureSessionPreset; Return ValueThe closest corresponding AVFoundation AVCaptureSessionPreset string. DiscussionGets the receiver's closest corresponding AVFoundation AVCaptureSessionPreset string. toClosestPreset- (WOWZFrameSizePreset) toClosestPreset; Return ValueThe closest corresponding WOWZFrameSizePreset. DiscussionGets the receiver's closest corresponding WOWZFrameSizePreset. toPreset- (WOWZFrameSizePreset) toPreset; Return ValueThe corresponding WOWZFrameSizePreset. DiscussionGets the receiver's corresponding WOWZFrameSizePreset. Typedefs
NS_ENUMprivate Constants
DiscussionStandard frame sizes for the broadcasted video. (Note that not all devices and cameras support all frame sizes.) See Also NS_ENUMprivate Constants
DiscussionOrientation options for the broadcasted video. See Also NS_ENUMprivate Constants
DiscussionAdjustments for captured frames that don't match the specified broadcast frame size. See Also NS_ENUMprivate Constants
DiscussionThe number of audio channels to use. (Note that not all devices support all audio-channel counts.) See Also WOWZAudioChannelsprivate Constants
DiscussionThe number of audio channels to use. (Note that not all devices support all audio-channel counts.) See Also WOWZBroadcastOrientationprivate Constants
DiscussionOrientation options for the broadcasted video. See Also WOWZBroadcastScaleModeprivate Constants
DiscussionAdjustments for captured frames that don't match the specified broadcast frame size. See Also WOWZFrameSizePresetprivate Constants
DiscussionStandard frame sizes for the broadcasted video. (Note that not all devices and cameras support all frame sizes.) See Also Properties
allowHLSPlayback@property (nonatomic, assign) BOOL allowHLSPlayback; DiscussionAllow 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; DiscussionThe 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; DiscussionThe number of audio channels. audioEnabled@property (nonatomic, assign) BOOL audioEnabled; DiscussionAllow 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; DiscussionThe 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; DiscussionEnable 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; DiscussionSet 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; DiscussionSet the broadcast orientation for a broadcast session. See WOWZBroadcastOrientation for supported values. The default is WOWZBroadcastOrientationSameAsDevice. capturedVideoRotates@property (nonatomic, assign) BOOL capturedVideoRotates; DiscussionSet the video to rotate to match the orientation of the device. frameSize@property (nonatomic, readonly) CGSize frameSize; DiscussionThe video frame size, in CGSize format. frameSizeLabel@property (nonatomic, readonly, nonnull) NSString *frameSizeLabel; DiscussionA human-readable string that describes the video frame size. hlsURL@property (nonatomic, assign) NSString * hlsURL; DiscussionThe 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; DiscussionSet the front-facing camera to mirror captured video. The default is yes. videoBitrate@property (nonatomic, assign) NSUInteger videoBitrate; DiscussionThe 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; DiscussionThe 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; DiscussionAllow 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; DiscussionThe 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; DiscussionThe 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; DiscussionThe 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; DiscussionThe video frame height for the configuration. videoKeyFrameInterval@property (nonatomic, assign) NSUInteger videoKeyFrameInterval; DiscussionThe keyframe interval. videoPreviewRotates@property (nonatomic, assign) BOOL videoPreviewRotates; DiscussionSet the preview video session to rotate to match the orientation of the device. videoWidth@property (nonatomic, assign) NSUInteger videoWidth; DiscussionThe video frame width for the configuration. |