MeiCam SDK For iOS  3.10.0
Instance Methods | Properties | List of all members
NvsClip Class Reference

Clips are specific description of audio and video files. More...

#import <NvsClip.h>

Inheritance diagram for NvsClip:
NvsObject NvsAudioClip NvsVideoClip

Instance Methods

(NvsTimeline *) - getInternalTimeline
 Get the internal timeline object from the clip. More...
 
(BOOL) - changeFilePath:
 Change the clip file path. More...
 
(int64_t) - changeTrimInPoint:affectSibling:
 Change the trimming in point of the clip. More...
 
(BOOL) - moveTrimPoint:
 Move trim points of clip(in microseconds) More...
 
(int64_t) - changeTrimOutPoint:affectSibling:
 Change the trimming out point of the clip. More...
 
(double) - getSpeed
 Get the playback speed of the clip. More...
 
(void) - changeSpeed:
 Change the playback speed of the clip. More...
 
(void) - changeSpeed:keepAudioPitch:
 Change the playback speed of the clip. More...
 
(BOOL) - isKeepAudioPitch
 Get Audio Pitch State. More...
 
(BOOL) - changeCurvesVariableSpeed:keepAudioPitch:
 Changes the playback speed of the clip by curves(only support for video clip). More...
 
(NSString *) - getClipVariableSpeedCurvesString
 get current variable speed curves of clip. More...
 
(int64_t) - getClipPosByTimelinePosCurvesVariableSpeed:
 Gets the pos in clip by current timeline pos when used curves variable speed. More...
 
(int64_t) - getTimelinePosByClipPosCurvesVariableSpeed:
 Gets the pos in timeline by current clip pos when used curves variable speed. More...
 
(void) - setVolumeGain:rightVolumeGain:
 Set the channels (left and right). More...
 
(void) - getVolumeGain:rightVolumeGain:
 Get the channel values (left and right) More...
 
(void) - getRealVolumeAtTime:rightVolumeGain:time:
 Get the real-time volume at a specified time point. More...
 
(void) - setLoopAudio:
 Sets whether to loop audio if the clip' trim out go beyond its audio stream's duration. More...
 
(BOOL) - getLoopAudio
 Gets whether to loop audio if the clip' trim out go beyond its audio stream's duration. More...
 
(NvsAudioFx *) - getAudioVolumeFx
 Gets the audio volume effect of the clip. More...
 
- Instance Methods inherited from NvsObject
(void) - setAttachment:forKey:
 Adds an attachment to the NvsObject object to identify the object of the NvsObject or for other purposes. More...
 
(void) - setTemplateAttachment:forKey:
 Adds additional template data to the NvsObject object to identify the NvsObject template object. More...
 
(NSObject *) - getAttachment:
 Gets attached attachments. More...
 
(NSString *) - getTemplateAttachment:
 Gets an template attachment to NvsObject. More...
 

Properties

int64_t trimIn
 Clip triming in point (in microseconds). More...
 
int64_t trimOut
 Clip triming out point (in microseconds). More...
 
int64_t inPoint
 The in point of the clip on the timeline (in microseconds). More...
 
int64_t outPoint
 The out point of the clip on the timeline (in microseconds). More...
 
NvsClipType type
 Clip type (video, audio). More...
 
unsigned int index
 The index of the clip on the track. More...
 
NSString * filePath
 File path of clip. More...
 
unsigned int fxCount
 The count of special effects on the clip. More...
 

Detailed Description

Clips are specific description of audio and video files.

A clip is an entity that accommodates audio and video content and a description of video and audio files which divided into an audio clip and a 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 as needed for each triming in and out point, left and right channel, playback speed, etc. 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! ! !

Method Documentation

◆ changeCurvesVariableSpeed:keepAudioPitch:

- (BOOL) changeCurvesVariableSpeed: (NSString *)  curvesString
keepAudioPitch: (BOOL)  keepAudioPitch 

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:

- (BOOL) changeFilePath: (NSString *)  filePath

Change the clip file path.

Parameters
filePathnew file path
Returns
Returns whether suc.

◆ changeSpeed:

- (void) changeSpeed: (double)  newSpeed

Change 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 state of stopping engine. For details, please refer to The Topic of Changing Engine.
See also
- getSpeed

◆ changeSpeed:keepAudioPitch:

- (void) changeSpeed: (double)  newSpeed
keepAudioPitch: (BOOL)  keepAudioPitch 

Change the playback speed of the clip.

Parameters
newSpeedThe new playback speed.Attention newSpeed > 0.
keepAudioPitchWhether to keep the tone unchanged
Warning
This interface will cause the streaming engine state to jump to the state of stopping engine. For details, please refer to The Topic of Changing Engine.
See also
- getSpeed
Since
1.15.1

◆ changeTrimInPoint:affectSibling:

- (int64_t) changeTrimInPoint: (int64_t)  newTrimInPoint
affectSibling: (BOOL)  affectSibling 

Change the trimming in point of the clip.

Parameters
newTrimInPointNew trimming in point (in microseconds)
affectSiblingWhether it affects other clips on the same track
Returns
Returns the actual reachable trimming in point (in microseconds). Note: The range of the actual achievable trimming in point is [0,trimOut - 1].
Warning
This interface will cause the streaming engine state to jump to the state of stopping engine. For details, please refer to The Topic of Changing Engine.
See also
- changeTrimOutPoint:affectSibling:

◆ changeTrimOutPoint:affectSibling:

- (int64_t) changeTrimOutPoint: (int64_t)  newTrimOutPoint
affectSibling: (BOOL)  affectSibling 

Change the trimming out point of the clip.

Parameters
newTrimOutPointNew trimming out point (in microseconds)
affectSiblingWhether it affects other clips on the same track
Returns
Returns the actual reachable trimming out point (in microseconds). Note: The range of the actual achievable trimming out point is [trimIn + 1,clipDuration).
Warning
This interface will cause the streaming engine state to jump to the state of stopping engine. For details, please refer to The Topic of Changing Engine.
See also
- changeTrimInPoint:affectSibling:

◆ getAudioVolumeFx

- (NvsAudioFx *) getAudioVolumeFx

Gets the audio volume effect of the clip.

Returns
Returns the obtained NvsAudioFx object.

◆ getClipPosByTimelinePosCurvesVariableSpeed:

- (int64_t) getClipPosByTimelinePosCurvesVariableSpeed: (int64_t)  timelinePos

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

- (NSString *) getClipVariableSpeedCurvesString

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

◆ getInternalTimeline

- (NvsTimeline *) getInternalTimeline

Get the internal timeline object from the clip.

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

◆ getLoopAudio

- (BOOL) getLoopAudio

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

◆ getRealVolumeAtTime:rightVolumeGain:time:

- (void) getRealVolumeAtTime: (float *)  leftVolume
rightVolumeGain: (float *)  rightVolume
time: (int64_t)  time 

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

Parameters
leftVolumeGainThe left channel volume.
rightVolumeGainThe right channel volume.
Since
3.0.0

◆ getSpeed

- (double) getSpeed

Get the playback speed of the clip.

The default value is 1, which means it plays at normal speed; the value less than 1 means it slowly plays; the value greater than 1 means it fast plays.

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

◆ getTimelinePosByClipPosCurvesVariableSpeed:

- (int64_t) getTimelinePosByClipPosCurvesVariableSpeed: (int64_t)  clipPos

Gets the pos in timeline 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

◆ getVolumeGain:rightVolumeGain:

- (void) getVolumeGain: (float *)  leftVolumeGain
rightVolumeGain: (float *)  rightVolumeGain 

Get the channel values (left and right)

Parameters
leftVolumeGainThe left channel value to be set, the range value is [0, 4).
rightVolumeGainThe right channel value to be set, the range value is [0, 4).
See also
- getVolumeGain:rightVolumeGain:

◆ isKeepAudioPitch

- (BOOL) isKeepAudioPitch

Get Audio Pitch State.

See also
changeSpeed
Since
3.7.0

◆ moveTrimPoint:

- (BOOL) moveTrimPoint: (int64_t)  offset

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
Since
2.18.1

◆ setLoopAudio:

- (void) setLoopAudio: (BOOL)  loop

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:rightVolumeGain:

- (void) setVolumeGain: (float)  leftVolumeGain
rightVolumeGain: (float)  rightVolumeGain 

Set the channels (left and right).

Parameters
leftVolumeGainThe left channel value to be set, the range value is [0, 4).
rightVolumeGainThe right channel value to be set, the range value is [0, 4).
See also
- getVolumeGain:rightVolumeGain:

Property Documentation

◆ filePath

- (NSString*) filePath
readatomicassign

File path of clip.

◆ fxCount

- (unsigned int) fxCount
readatomicassign

The count of special effects on the clip.

◆ index

- (unsigned int) index
readatomicassign

The index of the clip on the track.

◆ inPoint

- (int64_t) inPoint
readatomicassign

The in point of the clip on the timeline (in microseconds).

◆ outPoint

- (int64_t) outPoint
readatomicassign

The out point of the clip on the timeline (in microseconds).

◆ trimIn

- (int64_t) trimIn
readatomicassign

Clip triming in point (in microseconds).

◆ trimOut

- (int64_t) trimOut
readatomicassign

Clip triming out point (in microseconds).

◆ type

- (NvsClipType) type
readatomicassign

Clip type (video, audio).


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