AlivcLivePusher_Interactive v6.17.0
Aliyun Live Pusher Interactive SDK API Reference Manual for iOS Platforms
Loading...
Searching...
No Matches
AlivcLivePushConfig Class Reference

Class for live pusher engine configuration parameter settings. More...

#include "AlivcLivePushConfig.h"

Inheritance diagram for AlivcLivePushConfig:

Instance Methods

(void) - addWatermarkWithPath:watermarkCoordX:watermarkCoordY:watermarkWidth:
 Add watermarks.
 
(NSArray< NSDictionary * > *) - getAllWatermarks
 Query all watermarks key:watermarkPath value:The path of the watermark key:watermarkCoordX value:x key:watermarkCoordY value:y key:watermarkWidth value:width.
 
(CGSize) - getPushResolution
 Query the width and height of the push stream.
 
(instancetype) - initWithResolution:
 init Specify the resolution.
 
(void) - removeWatermarkWithPath:
 Remove watermarks.
 

Properties

int audioBitrate
 The audio bitrate.
 
AlivcLivePushAudioChannel audioChannel
 The number of sound channels.
 
AlivcLivePushAudioEncoderCodec audioEncoderCodec
 The audio encoder codec default : AlivcLivePushAudioEncoderCodecOpus.
 
AlivcLivePushAudioEncoderMode audioEncoderMode
 The audio encoding mode default : AlivcLivePushAudioEncoderModeSoft.
 
AlivcLivePushAudioEncoderProfile audioEncoderProfile
 The audio encoding format default : AlivcLivePushAudioEncoderProfile_AAC_LC.
 
BOOL audioFromExternal
 Whether the external custom data contains audio default: YES.
 
bool audioOnly
 Whether to enable audio-only stream push.
 
AlivcLivePushAudioSampleRate audioSampleRate
 The audio sample rate.
 
AlivcLivePusherAudioScenario audioScene
 The audio scenario default:AlivcLivePusherAudioScenarioMusicMode.
 
AlivcLivePusherAudioSessionOperationRestriction audioSessionOperationRestriction
 The control permission of the SDK on AVAudioSession default : AlivcLivePusherAudioSessionOperationRestrictionNone.
 
bool autoFocus
 Whether to enable autofocus default : true.
 
NSDictionary * businessInfo
 The business information.
 
AlivcLivePushCameraType cameraType
 The camera type.
 
int connectRetryCount
 The number of reconnections.
 
float connectRetryInterval
 The duration for reconnection.
 
bool enableAutoBitrate
 Whether to enable adaptive bitrate streaming default : true.
 
bool enableAutoResolution
 Whether to enable adaptive resolution (dynamic resolution) default : false.
 
BOOL enableDataChannelMessage
 Open the data channel and receive a custom message default : false.
 
BOOL enableExternSampleBufferSize
 When you set external custom data, if the aspect ratio of the video is not one of the values of AlivcLivePushResolution, you can configure enableExternSampleBufferSize so that the SDK uses the resolution specified by sampleBufferSize as the output resolution.
 
BOOL enableHDPreview
 Whether to enable HD preview (In HD preview mode, adjusting the streaming resolution does not restart the collection) default : true.
 
BOOL enableLocalVideoRawBuffer
 After enableLocalVideoTexture specifies the texture callback in interactive mode, enableLocalVideoRawBuffer can be set to enable the callback of video raw data, the format is I420.
 
BOOL enableLocalVideoTexture
 when livePushMode is set to AlivcLivePushLiveMode, pixbuffer is called back by default, and texture callback can be specified by enableLocalVideoTexture
 
bool enableNarrowbandAndHDForScreenPusher
 Whether to enable Narrowband HD™ that provides higher resolution with less bandwidth in scenarios where you stream screen recordings.
 
BOOL enableRemoteVideoFrameObserver
 Remote video frame callback switch in interactive mode default : false.
 
BOOL enableRTSForInteractiveMode
 
bool enableVideoCodecDowngrade
 Allow video encoding to automatically downgrade.
 
AlivcLivePushAudioFormat externAudioFormat
 The external custom audio data default : unknown.
 
bool externMainStream
 Whether to allow live pusher engine for external custom data.
 
AlivcLivePushVideoFormat externVideoFormat
 The external custom video data default : unknown.
 
NSDictionary * extras
 
bool flash
 Whether to turn on the flash default : false.
 
AlivcLivePushFPS fps
 The frame rate for video capture defalut : AlivcLivePushFPS20.
 
BOOL h5CompatibleMode
 Set H5 compatibility mode.
 
int initialVideoBitrate
 The initial video bitrate default : 800.
 
AlivcLivePushMode livePushMode
 The mode of the live pusher engine.
 
bool macroFocus
 Macro focus, suitable for high-end models with multiple cameras, close-range shooting focus default : false.
 
AlivcLivePushFPS minFps
 The minimum frame rate for video capture default : AlivcLivePushFPS8.
 
int minVideoBitrate
 The minimum video bitrate default : 200.
 
AlivcLivePushMonitorLevel monitorLevel
 The SDK quality monitoring level.
 
UIImage * networkPoorImg
 The image used when the network is low.
 
bool openBFrame
 Whether to support B-frames for video hardware encoding default:NO.
 
AlivcLivePushOrientation orientation
 The direction for stream push: portrait, 90° landscape, and 270° landscape.
 
UIImage * pauseImg
 The image used when live pusher engine is paused.
 
AlivcPusherPreviewDisplayMode previewDisplayMode
 The preview mode default : ALIVC_LIVE_PUSHER_PREVIEW_ASPECT_FILL.
 
bool previewMirror
 Whether to enable mirroring for preview.
 
bool pushMirror
 Whether to enable mirroring for stream push.
 
AlivcLivePushQualityMode qualityMode
 Set the live pusher engine quality mode.
 
BOOL requireGLSharedContext
 Whether to enable the openGL Shared Context mode default : false.
 
AlivcLivePushResolution resolution
 The resolution for the ingested stream.
 
CGSize sampleBufferSize
 When you set external custom data, if the aspect ratio of the video is not one of the values of AlivcLivePushResolution, you can specify the aspect ratio of the input video as that of the output video to avoid cropping.
 
int sendDataTimeout
 The timeout for data transmission.
 
int targetVideoBitrate
 The video target bitrate default : 800.
 
bool useAliyunPlayerForBGM
 Use ApsaraVideo Player to play background music.
 
NSString * userName
 userName
 
AlivcLivePushVideoEncodeGOP videoEncodeGop
 The keyframe interval default : AlivcLivePushVideoEncodeGOP_2.
 
AlivcLivePushVideoEncoderMode videoEncoderMode
 The video encoding mode default : AlivcLivePushVideoEncoderModeHard.
 
AlivcLivePushVideoEncoderModeHardCodec videoHardEncoderCodec
 The video hardware encoding format.
 
bool videoOnly
 Video-only stream push is supported for RTMP, but not for RTC.
 

Detailed Description

Class for live pusher engine configuration parameter settings.

Method Documentation

◆ addWatermarkWithPath:watermarkCoordX:watermarkCoordY:watermarkWidth:

- (void) addWatermarkWithPath: (NSString *)  path
watermarkCoordX: (CGFloat)  coordX
watermarkCoordY: (CGFloat)  coordY
watermarkWidth: (CGFloat)  ALIVCLIVEPUSH_DEPRECAETD_WATERMARK_API 

Add watermarks.

You can add up to three watermarks

Parameters
pathThe path of the watermark
coordXThe coordinate of the watermark along the x-axis relative to the vertex in the upper-left corner
coordYThe coordinate of the watermark along the y-axis relative to the vertex in the upper-left corner
widthThe relative width of the watermark. (The watermark is proportionally scaled based on the actual width of the watermark image.) (0,1]
Returns
0:success != 0:failure
Note
Note: The SDK allows you to add watermarks when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ getAllWatermarks

- (NSArray< NSDictionary * > *) getAllWatermarks

Query all watermarks key:watermarkPath value:The path of the watermark key:watermarkCoordX value:x key:watermarkCoordY value:y key:watermarkWidth value:width.

◆ getPushResolution

- (CGSize) getPushResolution

Query the width and height of the push stream.

◆ initWithResolution:

- (instancetype) initWithResolution: (AlivcLivePushResolution)  resolution

init Specify the resolution.

Default values are used for other parameters of the instance type.

Parameters
resolutionThe resolution of the live pusher stream
Returns
self

◆ removeWatermarkWithPath:

- (void) removeWatermarkWithPath: (NSString *)  ALIVCLIVEPUSH_DEPRECAETD_WATERMARK_API

Remove watermarks.

Parameters
pathThe path of the watermark

Property Documentation

◆ audioBitrate

- (int) audioBitrate
readwritenonatomicassign

The audio bitrate.

default : 64

Note
Range : [10,1000], Unit : Kbps
When livePushMode is set to AlivcLivePushInteractiveMode, If AlivcLivePushAudioChannel_2 dual channel is set, it is recommended that the audioBitrate is set to 128

◆ audioChannel

- (AlivcLivePushAudioChannel) audioChannel
readwritenonatomicassign

The number of sound channels.

default : AlivcLivePushAudioChannel_1 Mono

Note
When livePushMode is set to AlivcLivePushInteractiveMode, If AlivcLivePushAudioChannel_2 dual channel is set, it is recommended that the audioBitrate is set to 128

◆ audioEncoderCodec

- (AlivcLivePushAudioEncoderCodec) audioEncoderCodec
readwritenonatomicassign

The audio encoder codec default : AlivcLivePushAudioEncoderCodecOpus.

Note
This configuration parameter only takes effect in the interactive mode (live broadcast or PK). The basic mode only supports AAC audio encoding; the interactive mode defaults to Opus encoding, and can be switched to AAC encoding by setting audioEncoderCodec.

◆ audioEncoderMode

- (AlivcLivePushAudioEncoderMode) audioEncoderMode
readwritenonatomicassign

The audio encoding mode default : AlivcLivePushAudioEncoderModeSoft.

◆ audioEncoderProfile

- (AlivcLivePushAudioEncoderProfile) audioEncoderProfile
readwritenonatomicassign

The audio encoding format default : AlivcLivePushAudioEncoderProfile_AAC_LC.

◆ audioFromExternal

- (BOOL) audioFromExternal
readwritenonatomicassign

Whether the external custom data contains audio default: YES.

Note
In screen recording streaming scenarios on iOS, you can set audioFromExtern to NO, so that the audio is processed by the SDK and the video is processed by components. The SDK allows you to set audioFromExternal when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ audioOnly

- (bool) audioOnly
readwritenonatomicassign

Whether to enable audio-only stream push.

default : false

◆ audioSampleRate

- (AlivcLivePushAudioSampleRate) audioSampleRate
readwritenonatomicassign

The audio sample rate.

default : AlivcLivePushAudioSampleRate48000

◆ audioScene

- (AlivcLivePusherAudioScenario) audioScene
readwritenonatomicassign

The audio scenario default:AlivcLivePusherAudioScenarioMusicMode.

◆ audioSessionOperationRestriction

- (AlivcLivePusherAudioSessionOperationRestriction) audioSessionOperationRestriction
readwritenonatomicassign

The control permission of the SDK on AVAudioSession default : AlivcLivePusherAudioSessionOperationRestrictionNone.

◆ autoFocus

- (bool) autoFocus
readwritenonatomicassign

Whether to enable autofocus default : true.

◆ businessInfo

- (NSDictionary*) businessInfo
readwritenonatomiccopy

The business information.

◆ cameraType

- (AlivcLivePushCameraType) cameraType
readwritenonatomicassign

The camera type.

default : AlivcLivePushCameraTypeFront

◆ connectRetryCount

- (int) connectRetryCount
readwritenonatomicassign

The number of reconnections.

default : 5

Note
Range : [0,100]

◆ connectRetryInterval

- (float) connectRetryInterval
readwritenonatomicassign

The duration for reconnection.

default : 1000

Note
Range : (0,10000], Unit : ms

◆ enableAutoBitrate

- (bool) enableAutoBitrate
readwritenonatomicassign

Whether to enable adaptive bitrate streaming default : true.

◆ enableAutoResolution

- (bool) enableAutoResolution
readwritenonatomicassign

Whether to enable adaptive resolution (dynamic resolution) default : false.

Note
This feature does not take effect if qualityMode is set to Custom.

◆ enableDataChannelMessage

- (BOOL) enableDataChannelMessage
readwritenonatomicassign

Open the data channel and receive a custom message default : false.

◆ enableExternSampleBufferSize

- (BOOL) enableExternSampleBufferSize
readwritenonatomicassign

When you set external custom data, if the aspect ratio of the video is not one of the values of AlivcLivePushResolution, you can configure enableExternSampleBufferSize so that the SDK uses the resolution specified by sampleBufferSize as the output resolution.

Note
This parameter is applicable to only stream ingest for external custom data. We recommend that you use it when the aspect ratio of input video is not an ordinary aspect ratio, for example, in screen recording streaming scenarios on iOS. default:NO
The SDK allows you to set sampleBufferSize when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ enableHDPreview

- (BOOL) enableHDPreview
readwritenonatomicassign

Whether to enable HD preview (In HD preview mode, adjusting the streaming resolution does not restart the collection) default : true.

◆ enableLocalVideoRawBuffer

- (BOOL) enableLocalVideoRawBuffer
readwritenonatomicassign

After enableLocalVideoTexture specifies the texture callback in interactive mode, enableLocalVideoRawBuffer can be set to enable the callback of video raw data, the format is I420.

◆ enableLocalVideoTexture

- (BOOL) enableLocalVideoTexture
readwritenonatomicassign

when livePushMode is set to AlivcLivePushLiveMode, pixbuffer is called back by default, and texture callback can be specified by enableLocalVideoTexture

◆ enableNarrowbandAndHDForScreenPusher

- (bool) enableNarrowbandAndHDForScreenPusher
readwritenonatomicassign

Whether to enable Narrowband HD™ that provides higher resolution with less bandwidth in scenarios where you stream screen recordings.

default : true

◆ enableRemoteVideoFrameObserver

- (BOOL) enableRemoteVideoFrameObserver
readwritenonatomicassign

Remote video frame callback switch in interactive mode default : false.

Note
If this switch is turned on, the remote video raw data can be called back in AliLivePlayerDelegate->onRemoteVideoSample.

◆ enableRTSForInteractiveMode

- (BOOL) enableRTSForInteractiveMode
readwritenonatomicassign

◆ enableVideoCodecDowngrade

- (bool) enableVideoCodecDowngrade
readwritenonatomicassign

Allow video encoding to automatically downgrade.

When HEVC hardware encoding is set but the current device does not support it, the SDK will automatically downgrade to H264. This switch can control the SDK not to automatically downgrade to H264. default:true, Allow video codec automatic downgrade

◆ externAudioFormat

- (AlivcLivePushAudioFormat) externAudioFormat
readwritenonatomicassign

The external custom audio data default : unknown.

◆ externMainStream

- (bool) externMainStream
readwritenonatomicassign

Whether to allow live pusher engine for external custom data.

default : false

◆ externVideoFormat

- (AlivcLivePushVideoFormat) externVideoFormat
readwritenonatomicassign

The external custom video data default : unknown.

◆ extras

- (NSDictionary*) extras
readwritenonatomiccopy

◆ flash

- (bool) flash
readwritenonatomicassign

Whether to turn on the flash default : false.

◆ fps

- (AlivcLivePushFPS) fps
readwritenonatomicassign

The frame rate for video capture defalut : AlivcLivePushFPS20.

Note
: Frames per Second

◆ h5CompatibleMode

- (BOOL) h5CompatibleMode
readwritenonatomicassign

Set H5 compatibility mode.

Note
In the interactive mode, if you need to communicate with the Web, you must use the H5 compatibility mode, otherwise, the Web user will see a black screen when viewing the Native user.
Parameters
enableYES: open; NO:close default : false
Returns
  • YES: success
  • NO: failure

◆ initialVideoBitrate

- (int) initialVideoBitrate
readwritenonatomicassign

The initial video bitrate default : 800.

Note
Range : [100,5000], Unit : Kbps

◆ livePushMode

- (AlivcLivePushMode) livePushMode
readwritenonatomicassign

The mode of the live pusher engine.

The mode in which the SDK works. Basic mode and interactive mode are supported. The basic mode does not support real-time interaction features such as co-streaming and battle. Use this mode for ordinary RTMP- and RTS-based stream ingest. The interactive mode supports real-time interaction features such as co-streaming and battle. If interaction is required during live streaming, we recommend that you use this mode. default:AlivcLivePushBasicMode

◆ macroFocus

- (bool) macroFocus
readwritenonatomicassign

Macro focus, suitable for high-end models with multiple cameras, close-range shooting focus default : false.

◆ minFps

- (AlivcLivePushFPS) minFps
readwritenonatomicassign

The minimum frame rate for video capture default : AlivcLivePushFPS8.

Note
The value cannot be greater than the frame rate for video collection

◆ minVideoBitrate

- (int) minVideoBitrate
readwritenonatomicassign

The minimum video bitrate default : 200.

Note
Range : [100,5000], Unit : Kbps

◆ monitorLevel

- (AlivcLivePushMonitorLevel) monitorLevel
readwritenonatomicassign

The SDK quality monitoring level.

For embedment scenarios, you can specify specific monitoring metrics.

◆ networkPoorImg

- (UIImage*) networkPoorImg
readwritenonatomicretain

The image used when the network is low.

◆ openBFrame

- (bool) openBFrame
readwritenonatomicassign

Whether to support B-frames for video hardware encoding default:NO.

◆ orientation

- (AlivcLivePushOrientation) orientation
readwritenonatomicassign

The direction for stream push: portrait, 90° landscape, and 270° landscape.

default : AlivcLivePushOrientationPortrait

◆ pauseImg

- (UIImage*) pauseImg
readwritenonatomicretain

The image used when live pusher engine is paused.

◆ previewDisplayMode

- (AlivcPusherPreviewDisplayMode) previewDisplayMode
readwritenonatomicassign

The preview mode default : ALIVC_LIVE_PUSHER_PREVIEW_ASPECT_FILL.

◆ previewMirror

- (bool) previewMirror
readwritenonatomicassign

Whether to enable mirroring for preview.

default : true Mirroring enabled.

◆ pushMirror

- (bool) pushMirror
readwritenonatomicassign

Whether to enable mirroring for stream push.

default : false Mirroring disabled.

◆ qualityMode

- (AlivcLivePushQualityMode) qualityMode
readwritenonatomicassign

Set the live pusher engine quality mode.

If you select the ResolutionFirst mode, the SDK prioritizes the quality of streams. If you select the FluencyFirst mode, the SDK prioritizes the smoothness of streams. In the two modes, the SDK specifies the bitrate and frame rate by default. If you select the Custom mode, the SDK ingests streams at the bitrate and frame rate that you specify. default:AlivcLivePushQualityModeResolutionFirst

◆ requireGLSharedContext

- (BOOL) requireGLSharedContext
readwritenonatomicassign

Whether to enable the openGL Shared Context mode default : false.

◆ resolution

- (AlivcLivePushResolution) resolution
readwritenonatomicassign

The resolution for the ingested stream.

default : AlivcLivePushDefinition540P

◆ sampleBufferSize

- (CGSize) sampleBufferSize
readwritenonatomicassign

When you set external custom data, if the aspect ratio of the video is not one of the values of AlivcLivePushResolution, you can specify the aspect ratio of the input video as that of the output video to avoid cropping.

Note
This field is applicable in screen recording streaming scenarios on iOS. sampleBufferSize is used as the target resolution only when enableExternBufferSize is set to YES. The SDK allows you to set sampleBufferSize when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ sendDataTimeout

- (int) sendDataTimeout
readwritenonatomicassign

The timeout for data transmission.

default : 3000

Note
Unit : ms

◆ targetVideoBitrate

- (int) targetVideoBitrate
readwritenonatomicassign

The video target bitrate default : 800.

Note
Range: [100,5000], Unit : Kbps

◆ useAliyunPlayerForBGM

- (bool) useAliyunPlayerForBGM
readwritenonatomicassign

Use ApsaraVideo Player to play background music.

By default, the built-in player is used to play background music The built-in player supports most scenarios. If special formats are required, you can switch to ApsaraVideo Player. You need to add the dependency of ApsaraVideo Player 5.4.1 or later to the app. default:false

◆ userName

- (NSString*) userName
readwritenonatomiccopy

userName

◆ videoEncodeGop

- (AlivcLivePushVideoEncodeGOP) videoEncodeGop
readwritenonatomicassign

The keyframe interval default : AlivcLivePushVideoEncodeGOP_2.

Note
Unit : s

◆ videoEncoderMode

- (AlivcLivePushVideoEncoderMode) videoEncoderMode
readwritenonatomicassign

The video encoding mode default : AlivcLivePushVideoEncoderModeHard.

◆ videoHardEncoderCodec

- (AlivcLivePushVideoEncoderModeHardCodec) videoHardEncoderCodec
readwritenonatomicassign

The video hardware encoding format.

When videoEncoderMode is set to AlivcLivePushVideoEncoderModeHard, there are two optional video hardware encoding formats: H.264 and HEVC (H.265). default:AlivcLivePushVideoEncoderModeHardCodecH264

◆ videoOnly

- (bool) videoOnly
readwritenonatomicassign

Video-only stream push is supported for RTMP, but not for RTC.

default : false

Note
: This parameter is mutually exclusive with audioOnly. The SDK allows you to enable video-only stream ingest when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

The documentation for this class was generated from the following file: