public interface AliyunIMixRecorder
Modifier and Type | Method and Description |
---|---|
int |
addImage(EffectImage effctImage)
Deprecated.
in v3.27.0 ,use
getPasterManager() instead. |
int |
addPaster(EffectPaster effectPaster)
Deprecated.
in v3.27.0 ,use
getPasterManager() instead. |
int |
addPaster(EffectPaster effectPaster,
float sx,
float sy,
float sw,
float sh,
float rotation,
boolean flip)
Deprecated.
in v3.27.0 ,use
getPasterManager() instead.
setEffectView(float, float, float, float, EffectBase) and this method can be used to add multiple effects. |
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.
|
AliyunIRecordPasterManager |
getPasterManager()
Get sticker manager interface
|
void |
needFaceTrackInternal(boolean need)
Sets whether to enable facial recognition.
|
void |
release()
Releases resources.
|
void |
removeAnimationFilter(EffectFilter effctFilter)
Removes an animated filter.
|
int |
removeFilter()
Added in v3.27.0
Remove a filter.
|
void |
removeImage(EffectImage effctImage)
Deprecated.
in v3.27.0 ,use
getPasterManager() instead. |
void |
removePaster(EffectPaster effectPaster)
Deprecated.
in v3.27.0 ,use
getPasterManager() instead. |
void |
setBackgroundColor(int color)
Set the background color
Added in v3.19.0
|
void |
setBackgroundImage(Bitmap bitmap,
int displayMode)
Set the background image with bitmap
Added in v3.19.0
|
void |
setBeautyLevel(int level)
Sets the beauty level.
|
void |
setBeautyStatus(boolean on)
Deprecated.
in v3.27.0, use
setBeautyLevel(int) instead. |
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(SurfaceView previewView,
SurfaceView playView)
Sets the
SurfaceView during preview. |
int |
setEffectView(float xRatio,
float yRatio,
float widthRatio,
float heightRatio,
EffectBase effectBase)
Deprecated.
in v3.27.0 ,use
getPasterManager() instead. |
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)
Deprecated.
in v3.27.0, use
setMixMediaInfo(AliyunMixMediaInfoParam, MediaInfo) instead. |
void |
setIsAutoClearClipVideos(boolean isAutoClear) |
boolean |
setLight(FlashType flashType)
Sets the flash mode.
|
void |
setMixAudioAecType(MixAudioAecType type)
config audio source type of the output video
Added in v3.23.0
|
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 |
setOnRecordCallback(OnRecordCallback callback)
Sets the recording callback.
|
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 |
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)
Deprecated.
in v3.27.0, use
setMixMediaInfo(AliyunMixMediaInfoParam, MediaInfo) instead. |
void |
setVideoQuality(VideoQuality quality)
Deprecated.
in v3.27.0, use
setMixMediaInfo(AliyunMixMediaInfoParam, MediaInfo) instead. |
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
- @Deprecated void setVideoQuality(VideoQuality quality)
setMixMediaInfo(AliyunMixMediaInfoParam, MediaInfo)
instead.quality
- The quality of the video.VideoQuality
@Deprecated int setGop(int gop)
setMixMediaInfo(AliyunMixMediaInfoParam, MediaInfo)
instead.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.@Deprecated int setVideoBitrate(int bitrate)
setMixMediaInfo(AliyunMixMediaInfoParam, MediaInfo)
instead.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(SurfaceView previewView, 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
- CameraCaptureDataMode
int startPreview()
Activity.onResume()
.void stopPreview()
Activity.onPause()
.@Deprecated int addPaster(EffectPaster effectPaster)
getPasterManager()
instead.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
@Deprecated int addPaster(EffectPaster effectPaster, float sx, float sy, float sw, float sh, float rotation, boolean flip)
getPasterManager()
instead.
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)
@Deprecated void removePaster(EffectPaster effectPaster)
getPasterManager()
instead.effectPaster
- @Deprecated int addImage(EffectImage effctImage)
getPasterManager()
instead.effctImage
- @Deprecated void removeImage(EffectImage effctImage)
getPasterManager()
instead.effctImage
- AliyunIRecordPasterManager getPasterManager()
Added in v3.27.0
AliyunIRecordPasterManager
int applyFilter(EffectFilter effectFilter)
effectFilter
- null indicates remove all filters.int removeFilter()
Added in v3.27.0 Remove a filter.
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.@Deprecated void setBeautyStatus(boolean on)
setBeautyLevel(int)
instead.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 setMixAudioAecType(MixAudioAecType type)
type
- aec type, default none
see MixAudioAecType
void setMixAudioWeight(int originAudioWeight, int recorderAudioWeight)
MixAudioSourceType.MIX
originAudioWeight
- [0~100]recorderAudioWeight
- [0~100]@Deprecated int setEffectView(float xRatio, float yRatio, float widthRatio, float heightRatio, EffectBase effectBase)
getPasterManager()
instead.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 setOnRecordCallback(OnRecordCallback callback)
callback
- OnRecordCallback
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.setFaceDetectRotation(int)
,
setRecordRotation(int)
void setFaceDetectRotation(int rotation)
setRecordRotation(int)
,
setRotation(int)
void setRecordRotation(int rotation)
if (rotation == 90 || rotation == 270) { rotation = (rotation + 90) % 360; if (mAliyunCamera.getCameraInfo().facing == CameraInfo.CAMERA_FACING_BACK) { rotation += 180; rotation %= 360; } } else if (rotation == 0 || rotation == 180) { rotation = (rotation + 270) % 360; }
setRotation(int)
,
setFaceDetectRotation(int)
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 setMixMediaInfo(AliyunMixMediaInfoParam inputMediaInfo, MediaInfo outputInfo)
int deleteLastPart()
int cancelFinishing()
void release()
void setBackgroundColor(int color)
color
- void setBackgroundImage(Bitmap bitmap, int displayMode)
bitmap
- 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
void setIsAutoClearClipVideos(boolean isAutoClear)