MeiCam SDK For Android  3.10.0
Public Member Functions | List of all members
com.meicam.sdk.NvsClip Class Reference

Clip, specific description of audio and video files. More...

Inheritance diagram for com.meicam.sdk.NvsClip:
com.meicam.sdk.NvsObject com.meicam.sdk.NvsAudioClip com.meicam.sdk.NvsVideoClip

Public Member Functions

NvsTimeline getInternalTimeline ()
 Gets the internal timeline object from the clip. More...
 
long getTrimIn ()
 Gets the trim in point of the clip. More...
 
long getTrimOut ()
 Gets the trim out point of the clip. More...
 
boolean moveTrimPoint (long offset)
 Move trim points of clip(in microseconds) More...
 
long getInPoint ()
 Gets the in-point of the clip on the timeline. More...
 
long getOutPoint ()
 Gets the out-point of the clip on the timeline. More...
 
int getType ()
 Gets the clip type (video clip, audio clip). More...
 
int getIndex ()
 Gets the index of the clip on the track. More...
 
boolean changeFilePath (String filePath)
 Change the clip file path. More...
 
String getFilePath ()
 Gets the clip file path. More...
 
int getFxCount ()
 Gets the number of effects on the clip. Note: The effect index on the clip starts from 0. More...
 
long changeTrimInPoint (long newTrimInPoint, boolean affectSibling)
 Modifies the trim in point of the clip. More...
 
long changeTrimOutPoint (long newTrimOutPoint, boolean affectSibling)
 Modifies the trim out point of the clip. More...
 
double getSpeed ()
 Get the playback speed of the clip. More...
 
boolean isKeepAudioPitch ()
 Is keep the tone unchanged. More...
 
void changeSpeed (double newSpeed)
 Changes the playback speed of the clip. More...
 
boolean changeCurvesVariableSpeed (String curvesString, boolean keepAudioPitch)
 Changes the playback speed of the clip by curves(only support for video clip). More...
 
String getClipVariableSpeedCurvesString ()
 get current variable speed curves of clip. More...
 
NvsAudioFx getAudioVolumeFx ()
 Gets the audio volume effect of the clip. More...
 
void changeSpeed (double newSpeed, boolean keepAudioPitch)
 Changes the playback speed of the clip. More...
 
void setVolumeGain (float leftVolumeGain, float rightVolumeGain)
 Sets the volume. More...
 
NvsVolume getVolumeGain ()
 Gets volume. More...
 
NvsVolume getRealVolumeAtTime (long time)
 Get the real-time volume at a specified time point. More...
 
void setLoopAudio (boolean loop)
 Sets whether to loop audio if the clip' trim out go beyond its audio stream's duration. More...
 
boolean getLoopAudio ()
 Gets whether to loop audio if the clip' trim out go beyond its audio stream's duration. More...
 
long GetClipPosByTimelinePosCurvesVariableSpeed (long timelinePos)
 Gets the pos in clip by current timeline pos when used curves variable speed. More...
 
long GetTimelinePosByClipPosCurvesVariableSpeed (long clipPos)
 Gets the pos in timelne by current clip pos when used curves variable speed. More...
 
- Public Member Functions inherited from com.meicam.sdk.NvsObject
void setAttachment (String key, Object value)
 Adds additional data to the NvsObject object to identify the NvsObject object or for other purpose. More...
 
void setTemplateAttachment (String key, String value)
 Adds additional template data to the NvsObject object to identify the NvsObject template object. More...
 
Object getAttachment (String key)
 Gets an attachment to NvsObject. More...
 
String getTemplateAttachment (String key)
 Gets an template attachment to NvsObject. More...
 

Static Public Attributes

clip type

static final int CLIP_TYPE_VIDEO = 0
 video clip type More...
 
static final int CLIP_TYPE_AUDIO = 1
 audio clip type More...
 
- Static Public Attributes inherited from com.meicam.sdk.NvsObject
static final String TEMPLATE_KEY_REPLACE_ID = "MSTemplate-ReplaceId"
 
static final String TEMPLATE_KEY_FOOTAGE_CAN_REPLACE = "MSTemplate-FootageCanReplace"
 
static final String TEMPLATE_KEY_FOOTAGE_ID = "MSTemplate-FootageId"
 
static final String TEMPLATE_KEY_FOOTAGE_NAME = "MSTemplate-FootageName"
 
static final String TEMPLATE_KEY_FOOTAGE_M3U8_NAME = "MSTemplate-FootageM3U8Name"
 
static final String TEMPLATE_KEY_FOOTAGE_TAGS = "MSTemplate-FootageTags"
 
static final String TEMPLATE_KEY_FOOTAGE_TYPE = "MSTemplate-FootageType"
 
static final String TEMPLATE_KEY_FOOTAGE_NEED_REVERSE = "MSTemplate-FootageNeedReverse"
 
static final String TEMPLATE_KEY_CLIP_RAW_WIDTH = "MSTemplate-ClipRawWidth"
 
static final String TEMPLATE_KEY_CLIP_RAW_HEIGHT = "MSTemplate-ClipRawHeight"
 
static final String TEMPLATE_KEY_VOLUME_TYPE = "MSTemplate-VolumeType"
 
static final String TEMPLATE_KEY_FX_GROUP = "MSTemplate-FxGroup"
 
static final String TEMPLATE_KEY_BEST_SEEK_TIME = "MSTemplate-BestSeekTime"
 
static final String TEMPLATE_KEY_MASK_TYPE = "MSTemplate-MaskType"
 
static final String TEMPLATE_VALUE_MASK_TYPE_LINE = "MSTemplate-MaskType-Line"
 
static final String TEMPLATE_VALUE_MASK_TYPE_MIRROR = "MSTemplate-MaskType-Mirror"
 
static final String TEMPLATE_VALUE_MASK_TYPE_CIRCLE = "MSTemplate-MaskType-Circle"
 
static final String TEMPLATE_VALUE_MASK_TYPE_RECT = "MSTemplate-MaskType-Rect"
 
static final String TEMPLATE_VALUE_MASK_TYPE_HEART = "MSTemplate-MaskType-Heart"
 
static final String TEMPLATE_VALUE_MASK_TYPE_STAR = "MSTemplate-MaskType-Star"
 
static final String TEMPLATE_KEY_TRANS_TYPE_CUT = "MSTemplate-TransType-Cut"
 
static final String TEMPLATE_KEY_CURVE_SPEED_TYPE = "MSTemplate-CurveSpeedType"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_CUSTOM = "MSTemplate-CurveSpeedType-Custom"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_MONTAGE = "MSTemplate-CurveSpeedType-Montage"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_HERO = "MSTemplate-CurveSpeedType-Hero"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_BULLET = "MSTemplate-CurveSpeedType-bullet"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_PLUS = "MSTemplate-CurveSpeedType-Plus"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_IN = "MSTemplate-CurveSpeedType-In"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_OUT = "MSTemplate-CurveSpeedType-Out"
 

Additional Inherited Members

- Protected Member Functions inherited from com.meicam.sdk.NvsObject
void setInternalObject (long internalObject)
 
long getInternalObject ()
 
- Protected Attributes inherited from com.meicam.sdk.NvsObject
long m_internalObject = 0
 

Detailed Description

Clip, specific description of audio and video files.

A clip is an entity that accommodates audio and video content. It is a description of video and audio files, and is divided into an audio clip (Audio Clip) and a video clip (Video Clip). It defines the common attributes and behaviors of different types of clips. That is, the derived audio clips and video clips can be modified for your demand. These modifications include trim in and out points, left or right volume channels, playback speed and so on. In the SDK framework, corresponding audio clips and video clips can be added to the track.

Warning
In the NvsClip class, all public APIs are used in the UI thread! ! !

Member Function Documentation

◆ changeCurvesVariableSpeed()

boolean com.meicam.sdk.NvsClip.changeCurvesVariableSpeed ( String  curvesString,
boolean  keepAudioPitch 
)
inline

Changes the playback speed of the clip by curves(only support for video clip).

Parameters
curvesStringdescription of the variable speed curves. \string foramt : (endpoint1)(endpoint1.backward)(endpoint1.frontward)(endpoint2)(endpoint2.backward)(endpoint2.frontward)…… \coords foramt : (x,y) \note1 : the y coords means the multiple speed. the range of y is 0.1 to 10 \note2 : all x coord values cannot be repeated. endpoint1.backward.x < endpoint1.x < endpoint1.frontward.x < endpoint2.backward.x <endpoint2.x…… \note3 : if you set an empty curvesString,it means you want to disable curves variable speed,the clip will back to const speed. \eg : curvesString = "(0,1)(-3,1)(3,1)(7,5)(6,5)(8,5)(10,0.4)(9,0.4)(11,0.4)(17,0.4)(16,0.4)(18,0.4)(20,5)(19,5)(21,5)(27,1)(24,1)(30,1)" curvesString included 6 group end point info .
keepAudioPitchKeep the tone unchanged.
Warning
This interface will cause the streaming engine state to jump to the engine stop state, see Engine Change Feature for details.
Since
2.17.0

◆ changeFilePath()

boolean com.meicam.sdk.NvsClip.changeFilePath ( String  filePath)
inline

Change the clip file path.

Parameters
filePathnew file path
Returns
Returns whether suc.

◆ changeSpeed() [1/2]

void com.meicam.sdk.NvsClip.changeSpeed ( double  newSpeed)
inline

Changes the playback speed of the clip.

Parameters
newSpeedNew playback speed.Attention newSpeed > 0.
Warning
This interface will cause the streaming engine state to jump to the engine stop state, refer to Engine Change Feature for details.
See also
getSpeed

◆ changeSpeed() [2/2]

void com.meicam.sdk.NvsClip.changeSpeed ( double  newSpeed,
boolean  keepAudioPitch 
)
inline

Changes the playback speed of the clip.

Parameters
newSpeedNew playback speed..Attention newSpeed > 0.
keepAudioPitchKeep the tone unchanged.
Warning
This interface will cause the streaming engine state to jump to the engine stop state, see Engine Change Feature for details.
See also
getSpeed
Since
1.15.1

◆ changeTrimInPoint()

long com.meicam.sdk.NvsClip.changeTrimInPoint ( long  newTrimInPoint,
boolean  affectSibling 
)
inline

Modifies the trim in point of the clip.

Parameters
newTrimInPointNew trim in point (in microseconds).
affectSiblingWhether it affects other clips on the same track (true/false).
Returns
Returns the actual reachable trim in point (in microseconds). Note: The actual achievable trim in point is within [0,trimOut - 1].
Warning
This interface will cause the streaming engine state to jump to the engine stop state, please refer to Engine Change Feature for details.
See also
changeTrimOutPoint
getTrimIn

◆ changeTrimOutPoint()

long com.meicam.sdk.NvsClip.changeTrimOutPoint ( long  newTrimOutPoint,
boolean  affectSibling 
)
inline

Modifies the trim out point of the clip.

Parameters
newTrimOutPointNew trim out point (in microseconds).
affectSiblingWhether it affects other clips on the same track (true/false).
Returns
Returns the actual reachable trim out point (in microseconds). Note: The actual achievable trim out point is within [trimIn + 1, clipDuration] and clipDuration is the clip duration.
Warning
This interface will cause the streaming engine state to jump to the engine stop state, refer to Engine Change Feature for details.
See also
changeTrimInPoint
getTrimOut

◆ getAudioVolumeFx()

NvsAudioFx com.meicam.sdk.NvsClip.getAudioVolumeFx ( )
inline

Gets the audio volume effect of the clip.

Returns
Returns the obtained NvsAudioFx object.

◆ GetClipPosByTimelinePosCurvesVariableSpeed()

long com.meicam.sdk.NvsClip.GetClipPosByTimelinePosCurvesVariableSpeed ( long  timelinePos)
inline

Gets the pos in clip by current timeline pos when used curves variable speed.

Returns
Returns long value to indicate the clip pos,return -1 indicate failed .
Since
2.17.0

◆ getClipVariableSpeedCurvesString()

String com.meicam.sdk.NvsClip.getClipVariableSpeedCurvesString ( )
inline

get current variable speed curves of clip.

Warning
the x coords at the each output curves' endpoint is relative,user can scale x to any size. eg: scale curves range to equal with clip length.
See also
changeCurvesVariableSpeed
Since
2.17.0

◆ getFilePath()

String com.meicam.sdk.NvsClip.getFilePath ( )
inline

Gets the clip file path.

Returns
Returns the string of the clip path.

◆ getFxCount()

int com.meicam.sdk.NvsClip.getFxCount ( )
inline

Gets the number of effects on the clip. Note: The effect index on the clip starts from 0.

Returns
Returns the number of special effects on the clip.

◆ getIndex()

int com.meicam.sdk.NvsClip.getIndex ( )
inline

Gets the index of the clip on the track.

Returns
Returns the index value of the clip on the track.

◆ getInPoint()

long com.meicam.sdk.NvsClip.getInPoint ( )
inline

Gets the in-point of the clip on the timeline.

Returns
Returns the in-point value of the clip on the timeline (in microseconds).
See also
getOutPoint
getTrimIn

◆ getInternalTimeline()

NvsTimeline com.meicam.sdk.NvsClip.getInternalTimeline ( )
inline

Gets the internal timeline object from the clip.

Returns
Returns the timeline object of the clip.If the clip is not the timeline clip, returns null.
Since
2.24.0

◆ getLoopAudio()

boolean com.meicam.sdk.NvsClip.getLoopAudio ( )
inline

Gets whether to loop audio if the clip' trim out go beyond its audio stream's duration.

Returns
Returns boolean value to indicate whether to loop audio
See also
setLoopAudio
Since
2.9.0

◆ getOutPoint()

long com.meicam.sdk.NvsClip.getOutPoint ( )
inline

Gets the out-point of the clip on the timeline.

Returns
Returns the out-point value (in microseconds) of the clip on the timeline.
See also
getInPoint
getTrimOut

◆ getRealVolumeAtTime()

NvsVolume com.meicam.sdk.NvsClip.getRealVolumeAtTime ( long  time)
inline

Get the real-time volume at a specified time point.

Returns
Return the volume object.
Since
3.0.0

◆ getSpeed()

double com.meicam.sdk.NvsClip.getSpeed ( )
inline

Get the playback speed of the clip.

The default value is 1, which means that it plays at normal speed; the value less than 1 means slower playback; the value greater than 1 means faster playback.

Returns
Returns the playback speed of the current clip.
See also
changeSpeed

◆ GetTimelinePosByClipPosCurvesVariableSpeed()

long com.meicam.sdk.NvsClip.GetTimelinePosByClipPosCurvesVariableSpeed ( long  clipPos)
inline

Gets the pos in timelne by current clip pos when used curves variable speed.

Returns
Returns long value to indicate the timeline pos,return -1 indicate failed .
Since
2.17.0

◆ getTrimIn()

long com.meicam.sdk.NvsClip.getTrimIn ( )
inline

Gets the trim in point of the clip.

Returns
Returns the trim in point of the clip (in microseconds).
See also
getTrimOut
changeTrimInPoint
getInPoint

◆ getTrimOut()

long com.meicam.sdk.NvsClip.getTrimOut ( )
inline

Gets the trim out point of the clip.

Returns
Returns the trim out point of the clip (in microseconds).
See also
getTrimIn
changeTrimOutPoint
getOutPoint

◆ getType()

int com.meicam.sdk.NvsClip.getType ( )
inline

Gets the clip type (video clip, audio clip).

Returns
Returns the clip type value. The return value is a static int value prefixed by CLIP_TYPE. Two types of clips are included, namely the audio clip type and the video clip type. Please refer to fragment type.

◆ getVolumeGain()

NvsVolume com.meicam.sdk.NvsClip.getVolumeGain ( )
inline

Gets volume.

Returns
Returns the volume object obtained.
See also
getVolumeGain

◆ isKeepAudioPitch()

boolean com.meicam.sdk.NvsClip.isKeepAudioPitch ( )
inline

Is keep the tone unchanged.

The default value is false

Returns
Returns is keep the tone unchanged.
See also
changeSpeed

◆ moveTrimPoint()

boolean com.meicam.sdk.NvsClip.moveTrimPoint ( long  offset)
inline

Move trim points of clip(in microseconds)

Parameters
offsetvalue,the existing trimIn + offset shall not exceed the original length of the clip
Returns
Returns true if succeeded

◆ setLoopAudio()

void com.meicam.sdk.NvsClip.setLoopAudio ( boolean  loop)
inline

Sets whether to loop audio if the clip' trim out go beyond its audio stream's duration.

Parameters
loopwhether to loop audio
See also
getLoopAudio
Since
2.9.0

◆ setVolumeGain()

void com.meicam.sdk.NvsClip.setVolumeGain ( float  leftVolumeGain,
float  rightVolumeGain 
)
inline

Sets the volume.

Parameters
leftVolumeGainLeft channel value, value range [0, 8).
rightVolumeGainRight channel value, value range [0, 8).
See also
getVolumeGain

Member Data Documentation

◆ CLIP_TYPE_AUDIO

final int com.meicam.sdk.NvsClip.CLIP_TYPE_AUDIO = 1
static

audio clip type

◆ CLIP_TYPE_VIDEO

final int com.meicam.sdk.NvsClip.CLIP_TYPE_VIDEO = 0
static

video clip type


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