MeiCam SDK For Web  3.12.1
Public Member Functions | List of all members
NvsClip Class Reference

Specific description of clips and audio and video files. Clip is an entity containing audio and video content. It is a description of video and audio files. It is divided into audio clip and video clip. It defines the common attributes and behaviors of different types of clips, that is, the derived audio clips and video clips can modify their clipping entry and exit points, left and right channels, playback speed, etc. In the SDK framework, corresponding audio clips and video clips can be added on the track. More...

Inheritance diagram for NvsClip:
NvsProjObj NvsAudioClip NvsVideoClip

Public Member Functions

 constructor ()
 
 getTrimIn ()
 Gets the trim in point of the clip. More...
 
 getTrimOut ()
 Gets the trim out point of the clip. More...
 
 moveTrimPoint (offset)
 Move trim points of clip(in microseconds). More...
 
 getInPoint ()
 Gets the in-point of the clip on the timeline. More...
 
 getOutPoint ()
 Gets the out-point of the clip on the timeline. More...
 
 getType ()
 Gets the clip type (video clip, audio clip). More...
 
 getIndex ()
 Gets the index of the clip on the track. More...
 
 getFilePath ()
 Gets the clip file path. More...
 
 getFxCount ()
 Gets the number of effects on the clip. Note: The effect index on the clip starts from 0. More...
 
 changeTrimInPoint (newTrimInPoint, affectSibling)
 Modifies the trim in point of the clip. This interface will cause the streaming engine state to jump to the engine stop state, please refer to Engine Change Feature for details. More...
 
 changeTrimOutPoint (newTrimOutPoint, affectSibling)
 Modifies the trim out point of the clip. This interface will cause the streaming engine state to jump to the engine stop state, refer to Engine Change Feature for details. More...
 
 getSpeed ()
 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 the playback speed of the current clip. More...
 
 changeSpeed (newSpeed, keepAudioPitch)
 Changes the playback speed of the clip.This interface will cause the streaming engine state to jump to the engine stop state. More...
 
 changeSpeedWithOutPoint (outPoint, newSpeed, keepAudioPitch)
 Changes the playback speed of the clip.This interface will cause the streaming engine state to jump to the engine stop state. More...
 
 isKeepAudioPitch ()
 Whether keep the tone unchanged. More...
 
 getVolumeGain ()
 Gets volume. More...
 
 setVolumeGain (leftVolumeGain, rightVolumeGain)
 Sets the volume. More...
 
 setFadeInDuration (duration)
 Sets the fade-in time. More...
 
 getFadeInDuration ()
 Gets fade-in time. More...
 
 setFadeOutDuration (duration)
 Sets fade-out time.Fade-out duration in microseconds, 0 means no fade-out.Duration must >= 0. More...
 
 getFadeOutDuration ()
 Gets fade-out time. More...
 
 changeCurvesVariableSpeed (curvesString, keepAudioPitch)
 Changes the playback speed of the clip by curves(only support for video clip).This interface will cause the streaming engine state to jump to the engine stop state. More...
 
 changeCurvesVariableSpeedWithOutPoint (outPoint, curvesString, keepAudioPitch)
 Changes the playback speed of the clip by curves(only support for video clip).This interface will cause the streaming engine state to jump to the engine stop state. More...
 
 getClipVariableSpeedCurvesString ()
 Get current variable speed curves of clip.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. More...
 
 getClipPosByTimelinePosCurvesVariableSpeed (timelinePos)
 Gets the pos in clip by current timeline pos when used curves variable speed. More...
 
 getTimelinePosByClipPosCurvesVariableSpeed (clipPos)
 Gets the pos in timelne by current clip pos when used curves variable speed. More...
 
 getAudioVolumeFx ()
 Gets the audio volume effect of the clip. More...
 
 getInternalTimeline ()
 Gets the internal timeline object from the clip. More...
 
 isTimelineClip ()
 Is timeline clip. More...
 
 changeClipFilePath (clipFilePath)
 Change the path of clip. More...
 
- Public Member Functions inherited from NvsProjObj
 constructor ()
 
 setInternalObject (obj)
 set internal object More...
 
 getInternalObject ()
 get internal object More...
 
 setTemplateAttachment (key, value)
 Adds additional template data to the NvsObject object to identify the NvsObject template object. More...
 
 getTemplateAttachment (key)
 Gets an template attachment to NvsObject. More...
 

Detailed Description

Specific description of clips and audio and video files. Clip is an entity containing audio and video content. It is a description of video and audio files. It is divided into audio clip and video clip. It defines the common attributes and behaviors of different types of clips, that is, the derived audio clips and video clips can modify their clipping entry and exit points, left and right channels, playback speed, etc. In the SDK framework, corresponding audio clips and video clips can be added on the track.

See also
NvsProjObj

Member Function Documentation

◆ changeClipFilePath()

NvsClip::changeClipFilePath (   clipFilePath)
inline

Change the path of clip.

Parameters
{String}clipFilePath file path of clip
Returns
{Boolean}

◆ changeCurvesVariableSpeed()

NvsClip::changeCurvesVariableSpeed (   curvesString,
  keepAudioPitch 
)
inline

Changes the playback speed of the clip by curves(only support for video clip).This interface will cause the streaming engine state to jump to the engine stop state.

Parameters
{String}curvesString Description 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 .
{Boolean}keepAudioPitch Keep the tone unchanged.
Returns
{Boolean}

◆ changeCurvesVariableSpeedWithOutPoint()

NvsClip::changeCurvesVariableSpeedWithOutPoint (   outPoint,
  curvesString,
  keepAudioPitch 
)
inline

Changes the playback speed of the clip by curves(only support for video clip).This interface will cause the streaming engine state to jump to the engine stop state.

Parameters
{Number}outPoint out point
{String}curvesString Description 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 .
{Boolean}keepAudioPitch Keep the tone unchanged.
Returns
{Boolean}

◆ changeSpeed()

NvsClip::changeSpeed (   newSpeed,
  keepAudioPitch 
)
inline

Changes the playback speed of the clip.This interface will cause the streaming engine state to jump to the engine stop state.

Parameters
{Number}newSpeed New playback speed..Attention newSpeed > 0.
{Boolean}keepAudioPitch Keep the tone unchanged.

◆ changeSpeedWithOutPoint()

NvsClip::changeSpeedWithOutPoint (   outPoint,
  newSpeed,
  keepAudioPitch 
)
inline

Changes the playback speed of the clip.This interface will cause the streaming engine state to jump to the engine stop state.

Parameters
{Number}outPoint out point
{Number}newSpeed New playback speed..Attention newSpeed > 0.
{Boolean}keepAudioPitch Keep the tone unchanged.

◆ changeTrimInPoint()

NvsClip::changeTrimInPoint (   newTrimInPoint,
  affectSibling 
)
inline

Modifies the trim in point of the clip. This interface will cause the streaming engine state to jump to the engine stop state, please refer to Engine Change Feature for details.

Parameters
{Number}newTrimInPoint New trim in point (in microseconds)
{Boolean}affectSibling Whether it affects other clips on the same track (true/false)
Returns
{Number} Returns the actual reachable trim in point (in microseconds). Note: The actual achievable trim in point is within [0,trimOut - 1].

◆ changeTrimOutPoint()

NvsClip::changeTrimOutPoint (   newTrimOutPoint,
  affectSibling 
)
inline

Modifies the trim out point of the clip. This interface will cause the streaming engine state to jump to the engine stop state, refer to Engine Change Feature for details.

Parameters
{Number}newTrimOutPoint New trim out point (in microseconds).
{Boolean}affectSibling Whether it affects other clips on the same track (true/false)
Returns
{Number} 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.

◆ constructor()

NvsClip::constructor ( )
inline

@constructor

◆ getAudioVolumeFx()

NvsClip::getAudioVolumeFx ( )
inline

Gets the audio volume effect of the clip.

Returns
{NvsAudioFx} Returns the obtained NvsAudioFx object.

◆ getClipPosByTimelinePosCurvesVariableSpeed()

NvsClip::getClipPosByTimelinePosCurvesVariableSpeed (   timelinePos)
inline

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

Parameters
{Number}timelinePos timeline position
Returns
{Number} Returns long value to indicate the clip pos,return -1 indicate failed .

◆ getClipVariableSpeedCurvesString()

NvsClip::getClipVariableSpeedCurvesString ( )
inline

Get current variable speed curves of clip.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.

Returns
{String} get current variable speed curves of clip.

◆ getFadeInDuration()

NvsClip::getFadeInDuration ( )
inline

Gets fade-in time.

Returns
{Number} Returns the fade-in time in microseconds.

◆ getFadeOutDuration()

NvsClip::getFadeOutDuration ( )
inline

Gets fade-out time.

Returns
{Number} Returns the fade-out time in microseconds.

◆ getFilePath()

NvsClip::getFilePath ( )
inline

Gets the clip file path.

Returns
{String} Returns the string of the clip path.

◆ getFxCount()

NvsClip::getFxCount ( )
inline

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

Returns
{Number} Returns the number of special effects on the clip.

◆ getIndex()

NvsClip::getIndex ( )
inline

Gets the index of the clip on the track.

Returns
{Number} Returns the index value of the clip on the track.

◆ getInPoint()

NvsClip::getInPoint ( )
inline

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

Returns
{Number} Returns the in-point value of the clip on the timeline (in microseconds)

◆ getInternalTimeline()

NvsClip::getInternalTimeline ( )
inline

Gets the internal timeline object from the clip.

Returns
{NvsTimeline} Returns the timeline object of the clip.If the clip is not the timeline clip, returns null.

◆ getOutPoint()

NvsClip::getOutPoint ( )
inline

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

Returns
{Number} Returns the out-point value (in microseconds) of the clip on the timeline

◆ getSpeed()

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 the playback speed of the current clip.

Returns
{Number} Returns the playback speed of the current clip.

◆ getTimelinePosByClipPosCurvesVariableSpeed()

NvsClip::getTimelinePosByClipPosCurvesVariableSpeed (   clipPos)
inline

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

Parameters
{Number}clipPos clip position
Returns
{Number} Returns long value to indicate the timeline pos,return -1 indicate failed.

◆ getTrimIn()

NvsClip::getTrimIn ( )
inline

Gets the trim in point of the clip.

Returns
{Number} Returns the trim in point of the clip (in microseconds)

◆ getTrimOut()

NvsClip::getTrimOut ( )
inline

Gets the trim out point of the clip.

Returns
{Number} Returns the trim out point of the clip (in microseconds)

◆ getType()

NvsClip::getType ( )
inline

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

Returns
{NvsClipType} 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()

NvsClip::getVolumeGain ( )
inline

Gets volume.

Returns
{NvsVolume} Returns the volume object obtained.

◆ isKeepAudioPitch()

NvsClip::isKeepAudioPitch ( )
inline

Whether keep the tone unchanged.

Returns
{Boolean} Returns whether keep the tone unchanged.

◆ isTimelineClip()

NvsClip::isTimelineClip ( )
inline

Is timeline clip.

Returns
{Boolean}

◆ moveTrimPoint()

NvsClip::moveTrimPoint (   offset)
inline

Move trim points of clip(in microseconds).

Parameters
{Number}offset value,the existing trimIn + offset shall not exceed the original length of the clip.
Returns
{Boolean} Returns true if succeeded.

◆ setFadeInDuration()

NvsClip::setFadeInDuration (   duration)
inline

Sets the fade-in time.

Parameters
{Number}duration Fade-in duration in microseconds, 0 means no fade-in.Duration must >= 0.

◆ setFadeOutDuration()

NvsClip::setFadeOutDuration (   duration)
inline

Sets fade-out time.Fade-out duration in microseconds, 0 means no fade-out.Duration must >= 0.

Parameters
{Number}duration Fade-out duration in microseconds, 0 means no fade-out.Duration must >= 0.

◆ setVolumeGain()

NvsClip::setVolumeGain (   leftVolumeGain,
  rightVolumeGain 
)
inline

Sets the volume.

Parameters
{Number}leftVolumeGain The left channel value to be set, the range value is [0, 4).
{Number}rightVolumeGain The right channel value to be set, the range value is [0, 4).

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