WZMediaConfig
IntroductionThe WZMediaConfig class provides configuration properties for the capture and encoding of video and audio Methods
AVCaptureSessionPresetFromPreset:+ (nullable NSString *) AVCaptureSessionPresetFromPreset:(WZFrameSizePreset)wzPreset; ParametersReturn ValueThe AVFoundation AVCaptureSessionPreset string that corresponds to the given WZFrameSizePreset. DiscussionConverts a WZFrameSizePreset to an AVFoundation AVCaptureSessionPreset string. CGSizeFromPreset:+ (CGSize) CGSizeFromPreset:(WZFrameSizePreset)preset; ParametersReturn ValueThe CGSize which corresponds to the given WZFrameSizePreset. DiscussionConverts a WZFrameSizePreset to the corresponding CGSize for that preset. closestAVCaptureSessionPresetByWidth:+ (nullable NSString *) closestAVCaptureSessionPresetByWidth:(NSUInteger)width; ParametersReturn ValueThe closest AVFoundation AVCaptureSessionPreset string matching the given width. DiscussionGiven a width, returns the AVFoundation AVCaptureSessionPreset string that most closely matches that width. copyTo:- (void) copyTo:(nonnull WZMediaConfig *)other; ParametersDiscussionCopy the reciever's settings to the given WZMediaConfig equals:- (BOOL) equals:(nonnull WZMediaConfig *)other; ParametersReturn ValueYES if both the receiver and given config are equal; otherwise NO DiscussionTests the reciever for equality to the given WZMediaConfig initWithPreset:- (nonnull instancetype) initWithPreset:(WZFrameSizePreset)preset; ParametersReturn ValueAn instance of WZMediaConfig with the specified frame size and recommended bitrate for that frame size. DiscussionInitialize a new WZMediaConfig with a given preset isLandscape- (BOOL) isLandscape; Return ValueYes if the receiver's frame size is landscape; otherwise NO DiscussionDetermine whether the frame size for the receiver describes a landscape orientation isPortrait- (BOOL) isPortrait; Return ValueYes if the receiver's frame size is portrait; otherwise NO DiscussionDetermine whether the frame size for the receiver describes a portrait orientation loadPreset:- (void) loadPreset:(WZFrameSizePreset)preset; ParametersDiscussionSets the frame size of the receiver with that described by a WZFrameSizePreset, as well as the recommended bitrate for that frame size. presetConfigs+ (nonnull NSArray *) presetConfigs; Return ValueThe array of WZMediaConfig objects. DiscussionReturns an array of WZMediaConfig objects for each WZFrameSizePreset. presets+ (nonnull NSArray *) presets; Return ValueThe array of NSNumber values DiscussionReturns an array of NSNumber values for each WZFrameSizePreset toAVCaptureSessionPreset- (nullable NSString *) toAVCaptureSessionPreset; Return ValueThe corresponding AVFoundation AVCaptureSessionPreset string for this config. DiscussionGet the receiver's corresponding AVFoundation AVCaptureSessionPreset string toClosestAVCaptureSessionPreset- (nonnull NSString *) toClosestAVCaptureSessionPreset; Return ValueThe closest corresponding AVFoundation AVCaptureSessionPreset string. DiscussionGet the receiver's closest corresponding AVFoundation AVCaptureSessionPreset string toClosestPreset- (WZFrameSizePreset) toClosestPreset; Return ValueThe closest corresponding WZFrameSizePreset DiscussionGet the receiver's closest corresponding WZFrameSizePreset toPreset- (WZFrameSizePreset) toPreset; Return ValueThe corresponding WZFrameSizePreset DiscussionGet the receiver's corresponding WZFrameSizePreset Typedefs
NS_ENUMprivate Constants
DiscussionFrame size presets availabe at compile time. Note that not all of these presets are guarenteed to be supported by a particular device or device camera. See Also NS_ENUMprivate Constants
DiscussionDescribes the orientation of the broadcasted video. See Also NS_ENUMprivate Constants
DiscussionDescribes how captured frames that don't exactly fit the requested broadcast frame size will be adjusted to fit within the requested frame size. See Also NS_ENUMprivate Constants
DiscussionNumber of audio channels. Note that not all of these channel counts are guarenteed to be supported by a particular device. See Also WZAudioChannelsprivate Constants
DiscussionNumber of audio channels. Note that not all of these channel counts are guarenteed to be supported by a particular device. See Also WZBroadcastOrientationprivate Constants
DiscussionDescribes the orientation of the broadcasted video. See Also WZBroadcastScaleModeprivate Constants
DiscussionDescribes how captured frames that don't exactly fit the requested broadcast frame size will be adjusted to fit within the requested frame size. See Also WZFrameSizePresetprivate Constants
DiscussionFrame size presets availabe at compile time. Note that not all of these presets are guarenteed to be supported by a particular device or device camera. See Also Properties
audioBitrate@property (nonatomic, assign) NSUInteger audioBitrate; DiscussionThe desired audio bitrate. Note that the actual bitrate might be different from the desired rate. audioChannels@property (nonatomic, assign) NSUInteger audioChannels; DiscussionThe desired number of audio channels audioEnabled@property (nonatomic, assign) BOOL audioEnabled; DiscussionEnable or disable audio for the configuration. audioSampleRate@property (nonatomic, assign) NSUInteger audioSampleRate; DiscussionThe desired audio sample rate. Note that the actual sample rate might be different from the desired rate. Set this property to 0 to have WowzaGoCoder select the optimal sample rate based on the current hardware capabilities. The default value is 0. backgroundBroadcastEnabled@property (nonatomic, assign) BOOL backgroundBroadcastEnabled; DiscussionSet whether or not broadcasting when the app is in the background is enabled. 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). In this case, the app will continue to record and broadcast the live audio stream. Since the camera cannot capture in the background on iOS, a blank or frozen video frame will be broadcast while the app is in the background. The default value is NO. broadcastScaleMode@property (nonatomic, assign) WZBroadcastScaleMode broadcastScaleMode; DiscussionSet the desired scale mode for captured frames that don't fit the requested broadcast frame size. See WZBroadcastScaleMode for allowed values. Default is WZBroadcastScaleModeAspectFit. broadcastVideoOrientation@property (nonatomic, assign) WZBroadcastOrientation broadcastVideoOrientation; DiscussionSet the desired broadcast orientation for a broadcast session. See WZBroadcastOrientation for allowed values. Default is WZBroadcastOrientationSameAsDevice. capturedVideoRotates@property (nonatomic, assign) BOOL capturedVideoRotates; DiscussionSet whether or not to rotate video frames 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 describing the video frame size mirrorFrontCamera@property (nonatomic, assign) BOOL mirrorFrontCamera; DiscussionSets whether the front (selfie) camera mirrors captured video. Default is YES. videoBitrate@property (nonatomic, assign) NSUInteger videoBitrate; DiscussionThe desired video bitrate. Note that the actual bitrate might be reduced if network bandwidth cannot keep up with the desired bitrate. videoBitrateLowBandwidthScalingFactor@property (nonatomic, assign) Float32 videoBitrateLowBandwidthScalingFactor; DiscussionThe factor by which to scale the desired bitrate in low bandwidth conditions. Valid range is 0.0 to 1.0; any other value will be ignored. Setting a value of
videoEnabled@property (nonatomic, assign) BOOL videoEnabled; DiscussionEnable or disable video for the configuration. videoFrameBufferSizeMultiplier@property (nonatomic, assign) NSUInteger videoFrameBufferSizeMultiplier; DiscussionThe value by which to multiply the video frame rate to derive the number of video 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 * 30) frames before throttling. Setting a value of 0 indicates that the encoder should choose the best value. The default is 4. videoFrameRate@property (nonatomic, assign) NSUInteger videoFrameRate; DiscussionThe desired frame rate for the configuration. Note that the actual frame rate might be reduced if network bandwidth cannot keep up with the desired frame rate. videoFrameRateLowBandwidthSkipCount@property (nonatomic, assign) NSUInteger videoFrameRateLowBandwidthSkipCount; DiscussionThe number of frames to skip when the encoder cannot keep up with the broadcaster. In low bandwidth conditions the encoder will skip frames to conserve bandwidth but still send consistent frames so the encoder can produce smooth playback. The maximum number of frames that can be skipped is equal to the key frame interval minus one - i.e. setting this to 29 with a key frame interval of 30 will produce a key frame only stream, setting to 1 will never skip frames. The default is 2 meaning skip 1 of every 2 frames videoHeight@property (nonatomic, assign) NSUInteger videoHeight; DiscussionThe video frame height for the configuration. videoKeyFrameInterval@property (nonatomic, assign) NSUInteger videoKeyFrameInterval; DiscussionThe video key frame interval. videoPreviewRotates@property (nonatomic, assign) BOOL videoPreviewRotates; DiscussionSet whether or not the video session should rotate to match the orientation of the device. videoWidth@property (nonatomic, assign) NSUInteger videoWidth; DiscussionThe video frame width for the configuration. |