public interface AliyunIMixRecorder
限定符和类型 | 方法和说明 |
---|---|
int |
addImage(EffectImage effctImage)
Adds a watermark image.
|
int |
addPaster(EffectPaster effectPaster)
Adds a face sticker.
|
int |
addPaster(EffectPaster effectPaster,
float sx,
float sy,
float sw,
float sh,
float rotation,
boolean flip)
Adds a normal sticker.
|
int |
applyAnimationFilter(EffectFilter effectFilter)
Applies an animated filter.
|
int |
applyFilter(EffectFilter effectFilter)
Applies a filter.
|
int |
cancelFinishing()
Cancels the composition process.
|
int |
deleteLastPart()
Deletes the last clip.
|
int |
finishRecording()
Stops recording and starts the composition process.
|
int |
getBeautyLevel()
Gets the beauty level.
|
int |
getCameraCount()
Gets the number of cameras.
|
AliyunIClipManager |
getClipManager()
Gets the clip manager.
|
float |
getCurrentExposureCompensationRatio()
Gets the current exposure level.
|
void |
needFaceTrackInternal(boolean need)
Sets whether to enable facial recognition.
|
int |
pauseMixVideo()
Pauses the playback of the sample video of the duet.
|
int |
playMixVideo()
Starts the playback of the sample video of the duet.
|
int |
postToGl(java.lang.Runnable r)
Posts an operation to the rendering thread.
|
void |
release()
Releases resources.
|
void |
removeAnimationFilter(EffectFilter effctFilter)
Removes an animated filter.
|
int |
removeFromGl(java.lang.Runnable r)
Removes an operation that is posted to the rendering thread.
|
void |
removeImage(EffectImage effctImage)
Removes a watermark image.
|
void |
removePaster(EffectPaster effectPaster)
Removes a sticker.
|
void |
setBackgroundColor(int color)
Set the background color
Added in v3.19.0
|
void |
setBackgroundImage(android.graphics.Bitmap bitmap,
int displayMode)
Set the background image with bitmap
Added in v3.19.0
|
void |
setBackgroundImage(java.lang.String path,
int displayMode)
Set the background image with file path
Added in v3.19.0
|
void |
setBeautyLevel(int level)
Sets the beauty level.
|
void |
setBeautyStatus(boolean on)
Enables or disables beauty mode.
|
void |
setCamera(CameraType camera)
Sets the camera type during preview.
|
void |
setCameraCaptureDataMode(int captureDataMode)
Sets the data capture method during preview.
|
void |
setCameraParam(CameraParam cameraParam)
Sets camera parameters during preview.
|
int |
setDisplayView(android.view.SurfaceView previewView,
android.view.SurfaceView playView)
Sets the
SurfaceView during preview. |
int |
setEffectView(float xRatio,
float yRatio,
float widthRatio,
float heightRatio,
EffectBase effectBase)
Sets sticker parameters, such as the position and size of the sticker.
|
int |
setExposureCompensationRatio(float value)
Sets the exposure level.
|
void |
setFaceDetectRotation(int rotation)
Sets the rotation angle of the gyro sensor when performing facial recognition.
|
int |
setFaces(float[][] faces)
Sets the coordinate points to define faces.
|
void |
setFaceTrackInternalMaxFaceCount(int maxFaceCount)
Sets the maximum number of faces that can be recognized at the same time.
|
int |
setFaceTrackInternalModelPath(java.lang.String path)
Sets the path of facial recognition models.
|
void |
setFocus(float xRatio,
float yRatio)
Sets the focus point.
|
void |
setFocusMode(int mode)
Sets the focus mode.
|
int |
setGop(int gop)
Sets the GOP size in frames, that is, the number of frames between two I-frames.
|
boolean |
setLight(FlashType flashType)
Sets the flash mode.
|
void |
setMixAudioSource(MixAudioSourceType type)
config audio source type of the output video
Added in v3.18.0
see
MixAudioSourceType |
void |
setMixAudioWeight(int originAudioWeight,
int recorderAudioWeight)
Added in v3.19.0
set the audio volume when mix,Only take effect when
MixAudioSourceType.MIX |
void |
setMixedBorderParam(AliyunMixBorderParam param)
Set mixed video border parameter
Added in v3.21.0
|
int |
setMixMediaInfo(AliyunMixMediaInfoParam inputMediaInfo,
MediaInfo outputInfo)
Sets input and output information about the duet.
|
void |
setOnAudioCallback(OnAudioCallBack callback)
Sets the callback that outputs audio data in 44.1 kHz 16-bit mono PCM format.
|
void |
setOnChoosePictureSizeCallBack(OnChoosePictureSizeCallBack callback)
Sets the callback that outputs the image resolution.
|
void |
setOnFaceDetectInfoListener(OnFaceDetectInfoListener listener)
Sets the callback that outputs facial recognition data.
|
void |
setOnFrameCallback(OnFrameCallBack callback)
Sets the callback that outputs frame data during recording.
|
void |
setOnTextureIdCallback(OnTextureIdCallBack callback)
Sets the callback that outputs the texture on every frame.
|
int |
setOutputPath(java.lang.String path)
Sets the output path.
|
int |
setRate(float rate)
Sets the recording speed.
|
void |
setRecordBorderParam(AliyunMixBorderParam param)
Set recorded video border parameter
Added in v3.21.0
|
void |
setRecordCallback(RecordCallback callback)
Sets the recording callback.
|
void |
setRecordRotation(int rotation)
Sets the rotation angle of the gyro sensor during recording.
|
void |
setRotation(int rotation)
Sets the rotation angle of the gyro sensor.
|
int |
setVideoBitrate(int bitrate)
Sets the video bitrate.
|
void |
setVideoQuality(VideoQuality quality)
Sets the video quality.
|
int |
setZoom(float rate)
Sets the zoom level.
|
int |
startPreview()
Starts preview.
|
int |
startRecording()
Starts recording.
|
void |
stopPreview()
Stops preview.
|
int |
stopRecording()
Stops recording.
|
int |
switchCamera()
Switches the camera.
|
FlashType |
switchLight()
Switches the flash mode.
|
int |
updateAnimationFilter(EffectFilter effectFilter)
update an animated filter.
|
AliyunIClipManager getClipManager()
AliyunIClipManager
int setOutputPath(java.lang.String path)
path
- void setVideoQuality(VideoQuality quality)
quality
- The quality of the video.VideoQuality
int setGop(int gop)
gop
- Valid values: [0, 9,000] When this parameter is set to 0, full I-frames may be possible depending on the device type.AliyunErrorCode.OK
if the invocation is successful.
AliyunErrorCode.ERROR_INVALID_ARGUMENTS
if the GOP parameter is invalid.int setVideoBitrate(int bitrate)
bitrate
- AliyunErrorCode.ERROR_INVALID_ARGUMENTS
if the specified bitrate is invalid.void setCamera(CameraType camera)
switchCamera()
to switch cameras.camera
- CameraType.BACK
,
CameraType.FRONT
int setDisplayView(android.view.SurfaceView previewView, android.view.SurfaceView playView)
SurfaceView
during preview.previewView
- The preview of the camera.playView
- The view of the duet.AliyunErrorCode.OK
if the invocation is successful or an error code if the invocation fails.void setCameraCaptureDataMode(int captureDataMode)
captureDataMode
- com.aliyun.svideosdk.common.struct.recorder
int startPreview()
Activity.onResume()
.void stopPreview()
Activity.onPause()
.int addPaster(EffectPaster effectPaster)
setRotation(int)
must be invoked to add face stickers. For details about calculating the rotation parameter, see the demo.
Use this method to add face stickers only. To add other stickers, call addPaster(EffectPaster, float, float, float, float, float, boolean)
.effectPaster
- EffectPaster
int addPaster(EffectPaster effectPaster, float sx, float sy, float sw, float sh, float rotation, boolean flip)
AliyunIRecorder.setEffectView(float, float, float, float, EffectBase)
and this method can be used to add multiple effects.effectPaster
- sx
- The x coordinate of the sticker relative to the video resolution.sy
- The x coordinate of the sticker relative to the video resolution.sw
- The width of the sticker relative to the video resolution.sh
- The height of the sticker relative to the video resolution.rotation
- The rotation angle of the sticker.flip
- Whether to flip the sticker.setEffectView(float, float, float, float, EffectBase)
void removePaster(EffectPaster effectPaster)
effectPaster
- int addImage(EffectImage effctImage)
effctImage
- void removeImage(EffectImage effctImage)
effctImage
- int applyFilter(EffectFilter effectFilter)
effectFilter
- null indicates remove all filters.int applyAnimationFilter(EffectFilter effectFilter)
EffectBase.setPath(String)
and use the path of the filter as the input parameter.
Alternatively, call EffectFilter.Builder
to create the filter object.effectFilter
- int updateAnimationFilter(EffectFilter effectFilter)
EffectBase.setPath(String)
and use the path of the filter as the input parameter.
Alternatively, call EffectFilter.Builder
to create the filter object.effectFilter
- void removeAnimationFilter(EffectFilter effctFilter)
effctFilter
- int getCameraCount()
void setCameraParam(CameraParam cameraParam)
cameraParam
- CameraParam
int switchCamera()
FlashType switchLight()
FlashType.AUTO
,
FlashType.OFF
,
FlashType.ON
boolean setLight(FlashType flashType)
flashType
- int setZoom(float rate)
rate
- int setExposureCompensationRatio(float value)
value
- void setFocusMode(int mode)
mode
- CameraParam.FOCUS_MODE_CONTINUE
,
CameraParam.FOCUS_MODE_AUTO
int setRate(float rate)
rate
- Valid values: [0.5, 2.0]void setFocus(float xRatio, float yRatio)
setFocusMode(int)
is set to CameraParam.FOCUS_MODE_AUTO
.xRatio
- The x coordinate of the focus point relative to the surface view.yRatio
- The y coordinate of the focus point relative to the surface view.int getBeautyLevel()
void setBeautyLevel(int level)
level
- Valid values: [0, 100]. A value of 0 indicates disable beauty mode.void setBeautyStatus(boolean on)
on
- A value of true indicates enable beauty mode. A value of false indicates disable beauty mode.int startRecording()
int stopRecording()
int finishRecording()
void setMixAudioSource(MixAudioSourceType type)
MixAudioSourceType
type
- audio source typevoid setMixAudioWeight(int originAudioWeight, int recorderAudioWeight)
MixAudioSourceType.MIX
originAudioWeight
- [0~100]recorderAudioWeight
- [0~100]int setEffectView(float xRatio, float yRatio, float widthRatio, float heightRatio, EffectBase effectBase)
xRatio
- The x coordinate of the sticker relative to the video resolution.widthRatio
- The width of the sticker relative to the video resolution.heightRatio
- The height of the sticker relative to the video resolution.effectBase
- The sticker.void setRecordCallback(RecordCallback callback)
callback
- RecordCallback
void setOnFrameCallback(OnFrameCallBack callback)
callback
- OnFrameCallBack
void setOnChoosePictureSizeCallBack(OnChoosePictureSizeCallBack callback)
callback
- void setOnAudioCallback(OnAudioCallBack callback)
callback
- int setFaces(float[][] faces)
faces
- Represented by a 2D array of size N*6.
point[i][0] => LEFT_EYE_X
point[i][1] => LEFT_EYE_Y
point[i][2] => RIGHT_EYE_X
point[i][3] => RIGHT_EYE_Y
point[i][4] => MOUTH_X
point[i][5] => MOUTH_Y
The above example defines the six features of face i.void setRotation(int rotation)
private int getSensorRotation() { int orientation = orientationDetector.getOrientation(); int rotation = 90; if (orientation >= 45 && orientation < 135) { rotation = 180; } if (orientation >= 135 && orientation < 225) { rotation = 270; } if (orientation >= 225 && orientation < 315) { rotation = 0; } if (mCameraType == CameraType.FRONT) { if (rotation != 0) { rotation = 360 - rotation; } } return rotation; }
rotation
- Do not use this method to control the angle when performing facial recognition or recording.AliyunIRecorder.setFaceDetectRotation(int)
,
AliyunIRecorder.setRecordRotation(int)
void setFaceDetectRotation(int rotation)
void setRecordRotation(int rotation)
void setOnTextureIdCallback(OnTextureIdCallBack callback)
callback
- OnTextureIdCallBack
void setOnFaceDetectInfoListener(OnFaceDetectInfoListener listener)
OnFaceDetectInfoListener.onFaceInfoChange(FaceDetectInfo)
is invoked when changes in facial recognition data are detected.listener
- float getCurrentExposureCompensationRatio()
void needFaceTrackInternal(boolean need)
need
- int setFaceTrackInternalModelPath(java.lang.String path)
path
- AliyunErrorCode.OK
if the invocation is successful.
AliyunErrorCode.ERROR_INVALID_ARGUMENTS
if the invocation fails, the path is invalid, or the model files are damaged.void setFaceTrackInternalMaxFaceCount(int maxFaceCount)
maxFaceCount
- int postToGl(java.lang.Runnable r)
r
- AliyunErrorCode.OK
if the invocation is successful.
AliyunErrorCode.ERROR_INVALID_STATE
if the invocation fails.int removeFromGl(java.lang.Runnable r)
r
- AliyunErrorCode.OK
if the invocation is successful.
AliyunErrorCode.ERROR_INVALID_STATE
if the invocation fails.int setMixMediaInfo(AliyunMixMediaInfoParam inputMediaInfo, MediaInfo outputInfo)
int deleteLastPart()
int playMixVideo()
int pauseMixVideo()
int cancelFinishing()
void release()
void setBackgroundColor(int color)
color
- void setBackgroundImage(android.graphics.Bitmap bitmap, int displayMode)
bitmap
- displayMode
- 0:crop 1:fill 2:exact fitvoid setBackgroundImage(java.lang.String path, int displayMode)
path
- displayMode
- 0:crop 1:fill 2:exact fitvoid setRecordBorderParam(AliyunMixBorderParam param)
param
- record video border parameter AliyunMixBorderParam
void setMixedBorderParam(AliyunMixBorderParam param)
param
- record video border parameter AliyunMixBorderParam