MeiCam SDK For iOS  3.1.2
Instance Methods | List of all members
NvsVideoTrack Class Reference

Video track is the collection of video clips. More...

#import <NvsVideoTrack.h>

Inheritance diagram for NvsVideoTrack:
NvsTrack NvsObject

Instance Methods

(NvsVideoClip *) - appendClip:
 Appends clip at the end of the video track. More...
 
(NvsVideoClip *) - appendClip:trimIn:trimOut:
 Appends a video clip of the specified duration to the end of the video track. More...
 
(NvsVideoClip *) - insertClip:clipIndex:
 Inserts a video clip at the specified clip index on the video track. More...
 
(NvsVideoClip *) - insertClip:trimIn:trimOut:clipIndex:
 Inserts a video clip of the specified duration at the specified clip index on the video track. More...
 
(NvsVideoClip *) - addClip:inPoint:
 Adds the clip. More...
 
(NvsVideoClip *) - addClip:inPoint:trimIn:trimOut:
 Adds a clip of the specified duration. More...
 
(NvsVideoClip *) - appendTimelineClip:
 Appends a timeline clip at the end of the video track. More...
 
(NvsVideoClip *) - appendTimelineClip:trimIn:trimOut:
 Appends a timeline clip of the specified duration to the end of the video track. More...
 
(NvsVideoClip *) - insertTimelineClip:clipIndex:
 Inserts a timeline clip at the specified clip index on the video track. More...
 
(NvsVideoClip *) - insertTimelineClip:trimIn:trimOut:clipIndex:
 Inserts a timeline clip of the specified duration at the specified clip index on the video track. More...
 
(NvsVideoClip *) - addTimelineClip:inPoint:
 Adds a timeline clip. More...
 
(NvsVideoClip *) - addTimelineClip:inPoint:trimIn:trimOut:
 Adds a timeline clip of the specified duration. More...
 
(NvsVideoClip *) - getClipWithIndex:
 Gets the video clip by index. More...
 
(NvsVideoClip *) - getClipWithTimelinePosition:
 Gets the video clip by time. More...
 
(NvsVideoTransition *) - setBuiltinTransition:withName:
 Sets built-in transitions. More...
 
(NvsVideoTransition *) - setPackagedTransition:withPackageId:
 Sets the package transition. More...
 
(NvsVideoTransition *) - setCustomVideoTransition:withCustomRender:
 Sets custom video transition. More...
 
(NvsVideoTransition *) - getTransitionWithSourceClipIndex:
 Gets the transition by the source clip index. More...
 
(NvsTrackVideoFx *) - getFirstTrackVideoFx
 Get the first track video effect on the track. More...
 
(NvsTrackVideoFx *) - getLastTrackVideoFx
 Get the last track video effect on the track. More...
 
(NvsTrackVideoFx *) - getPrevTrackVideoFx:
 Get the previous track video effect of a track video effect on the track. More...
 
(NvsTrackVideoFx *) - getNextTrackVideoFx:
 Get the next track video effect of a track video effect on the track. More...
 
(NSArray *) - getTrackVideoFxByPosition:
 Get a list of track video effects based on position on the track. More...
 
(void) - setEnableOriginalRender:
 Turn on special effect rendering based on the original scale of the video track. More...
 
(BOOL) - isOriginalRender
 Gets whether the original scale rendering mode is turned on. More...
 
(void) - setProxyScale:
 Disable the current track from rendering at the proxy scale. More...
 
(NvsRational- getProxyScale
 Gets whether the current track is disabled from rendering at the proxy scale. More...
 
(NvsTrackCaption *) - getFirstCaption
 Get the first caption on the track. More...
 
(NvsTrackCaption *) - getLastCaption
 Get the last caption on the track. More...
 
(NvsTrackCaption *) - getPrevCaption:
 Get the previous caption of the current caption on the track. More...
 
(NvsTrackCaption *) - getNextCaption:
 Get the next caption of the current caption on the track. More...
 
(NSArray *) - getCaptionsByTimelinePosition:
 Get a list of captions based on the position on the track. More...
 
(NvsTrackCaption *) - addCaption:inPoint:duration:captionStylePackageId:
 Add a caption on the track. More...
 
(NvsTrackCaption *) - addPanoramicCaption:inPoint:duration:captionStylePackageId:
 Add a panorama caption on the track. More...
 
(NvsTrackCaption *) - addModularCaption:inPoint:duration:
 Add a modular caption on the track. More...
 
(NvsTrackCaption *) - removeCaption:
 Remove the caption on the track. More...
 
(NvsTrackCompoundCaption *) - getFirstCompoundCaption
 Get the first compound caption on the track. More...
 
(NvsTrackCompoundCaption *) - getLastCompoundCaption
 Get the last compound caption on the track. More...
 
(NvsTrackCompoundCaption *) - getPrevCompoundCaption:
 Get the previous compound caption of the current compound caption on the track. More...
 
(NvsTrackCompoundCaption *) - getNextCompoundCaption:
 Get the next compound caption of the current compound caption on the track. More...
 
(NSArray< NvsTrackCompoundCaption * > *) - getCompoundCaptionsByTimelinePosition:
 Get a list of compound captions based on the position on the track. More...
 
(NvsTrackCompoundCaption *) - addCompoundCaption:duration:compoundCaptionPackageId:
 Add a caption on the track. More...
 
(NvsTrackCompoundCaption *) - removeCompoundCaption:
 Remove compound caption from the track. More...
 
(NvsTrackAnimatedSticker *) - getFirstAnimatedSticker
 Get the first animated sticker on the track. More...
 
(NvsTrackAnimatedSticker *) - getLastAnimatedSticker
 Get the last animated sticker on the track. More...
 
(NvsTrackAnimatedSticker *) - getPrevAnimatedSticker:
 Get the previous animated sticker of the current animated sticker of the track. More...
 
(NvsTrackAnimatedSticker *) - getNextAnimatedSticker:
 Get the next animated sticker of the current animated sticker of the track. More...
 
(NSArray *) - getAnimatedStickersByTimelinePosition:
 Get an animated sticker list based on the position on the track. More...
 
(NvsTrackAnimatedSticker *) - addAnimatedSticker:duration:animatedStickerPackageId:
 Add a animated sticker on the track. More...
 
(NvsTrackAnimatedSticker *) - addPanoramicAnimatedSticker:duration:animatedStickerPackageId:
 Add a panorama animation sticker on the track. More...
 
(NvsTrackAnimatedSticker *) - addCustomAnimatedSticker:duration:animatedStickerPackageId:customImagePath:
 Add a custom animated sticker on the track. More...
 
(NvsTrackAnimatedSticker *) - addCustomPanoramicAnimatedSticker:duration:animatedStickerPackageId:customImagePath:
 Add a a custom panorama animated sticker on the track. More...
 
(NvsTrackAnimatedSticker *) - removeAnimatedSticker:
 Remove an animated sticker on the track. More...
 
(NvsTrackVideoFx *) - addBuiltinTrackVideoFx:duration:videoFxName:
 Add a built-in track video effect on the track. More...
 
(NvsTrackVideoFx *) - addPackagedTrackVideoFx:duration:videoFxPackageId:
 Add a track video effect in the form of a resource package on the track. More...
 
(NvsTrackVideoFx *) - addCustomTrackVideoFx:duration:customVideoFxRender:
 Add a custom track video effect on the track. More...
 
(NvsTrackVideoFx *) - removeTrackVideoFx:
 Remove a track video effect from the track. More...
 
- Instance Methods inherited from NvsTrack
(int64_t) - changeInPoint:newInPoint:
 Change the in point of the clip on the timeline.If clip does not have this function authorization to return the current InPoint. If newInPoint is less than the outPoint of the previous clip, return the outPoint of the previous clip directly. If the current clip is the 0th clip, newInPoint is at least 0. This function internally calculates a new trimIn based on newInPoint and modifies the trimIn of the clip. If the new trimIn is less than 0, the corresponding Inpoint value when the trimIn is 0 will be returned; if the newInPoint is greater than trimOut, the corresponding Inpoint value of trimOut-1 will be returned. More...
 
(int64_t) - changeOutPoint:newOutPoint:
 Change the out point of the clip on the timeline.If clip does not have this function authorization to return the current outPoint.If newOutpoint is less than the outPoint of the clip, then newOutpoint will not be less than inpoint+1; if the clip is followed by nextclip, then newOutpoint will not be greater than the inpoint of nextclip. If the current clip is the last clip, the final outPoint is the duration of the timeline. If newOutpoint is greater than the outPoint of the clip, then the end of the video will be FreezeFrame. This function internally calculates a new trimOut based on newOutPoint, and removes the intermediate transition if the inPoint of the clip is not equal to the outPoint of the next clip. More...
 
(BOOL) - splitClip:splitPoint:
 Split the specified clip. More...
 
(BOOL) - removeClip:keepSpace:
 Remove the specified clip,You are not allowed to remove the opening and ending of a theme. More...
 
(BOOL) - removeRange:endTimelinePos:keepSpace:
 Remove all clips within the specified interval, and adjust the timeline in or out point if the clip only partially overlaps the interval.Failed to remove the fragment if it contains the opening and ending sections of the theme.StartTimeLinepos < 0 or endTimeLinepos <= startTimeLinepos will also remove failure. More...
 
(BOOL) - moveClip:destClipIndex:
 Move the specified clip,clipIndex and destClipIndex cannot be equal to clipCount. More...
 
(BOOL) - moveClip:targetTimelinePos:isInsertTarget:keepSpace:
 Moves the specified clip to the input position. clipIndex greater than or equal to clipCount will fail to remove, targetTimeLinePos equal to 0 will be moved to the 0 position, the theme title title will not be moved. More...
 
(BOOL) - removeAllClips
 Remove all clips. More...
 
(void) - setVolumeGain:rightVolumeGain:
 Set the volume吗,The final volume value is the track volume Multiplied by the clip volume. More...
 
(void) - getVolumeGain:rightVolumeGain:
 Get the volume, The final volume value is the track volume Multiplied by the clip volume. 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...
 

Additional Inherited Members

- Properties inherited from NvsTrack
NvsTrackType type
 Track type. More...
 
unsigned int index
 Index of track. More...
 
int64_t duration
 Duration of track (in microseconds). More...
 
unsigned int clipCount
 Count of clips on the track. More...
 

Detailed Description

Video track is the collection of video clips.

A video track is an entity that holds video clips. Users can add, insert, and delete multiple video clips on the track. As the clip increases,the video track continues to expand. Video transitions can be used between clips. The video clip source added to the video track can be video or image. If the clip source is an image, it is recommended to give priority to the path (localIdentifier) in the album. The loaded image resolution cannot be higher than 1920 * 1080, otherwise it will not be rendered on the Live Window. If the loaded image causes a black screen,etc., users need to consider reducing the resolution and reloading. When adding a package transition, users must install it firstly. After the installation, users can get the package Id and then use. For the built-in effects, obtains the names and then uses it.

Note: The index of the video clip starts from 0.

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

Method Documentation

◆ addAnimatedSticker:duration:animatedStickerPackageId:

- (NvsTrackAnimatedSticker *) addAnimatedSticker: (int64_t)  inPoint
duration: (int64_t)  duration
animatedStickerPackageId: (NSString *)  animatedStickerPackageId 

Add a animated sticker on the track.

Parameters
inPointThe in point of the animated sticker on the track (in microseconds)
durationThe duration of the animation sticker which displayed (in microseconds)
animatedStickerPackageIdAnimated sticker package Id
Returns
Return the NvsTrackAnimatedSticker object.
It will return null in the following situations:
1. No animated sticker function authorization;
2. The animatedStickerPackageId is empty or null;
3. The animatedSticker has not install successed;
4. If inPoint is less than 0 or greater than or equal to the current track duration, or duration is not greater than 0.
See also
removeAnimatedSticker

◆ addBuiltinTrackVideoFx:duration:videoFxName:

- (NvsTrackVideoFx *) addBuiltinTrackVideoFx: (int64_t)  inPoint
duration: (int64_t)  duration
videoFxName: (NSString *)  videoFxName 

Add a built-in track video effect on the track.

Parameters
inPointThe in point of the track video effect on the track (in microseconds)
durationDuration of the track video effect which displayed (in microseconds)
videoFxNameThe video effect name
Returns
Return the NvsTrackVideoFx object
Since
2.15.0

◆ addCaption:inPoint:duration:captionStylePackageId:

- (NvsTrackCaption *) addCaption: (NSString *)  captionText
inPoint: (int64_t)  inPoint
duration: (int64_t)  duration
captionStylePackageId: (NSString *)  captionStylePackageId 

Add a caption on the track.

Parameters
captionTextText of caption
inPointThe in point of the caption on the track (in microseconds)
durationCaption display duration (in microseconds)
captionStylePackageIdCaption style package Id.If it does not exist, you can pass an empty string or null.
Returns
Returns the NvsTrackCaption object.
It will return null in the following situations:
1. No caption function authorization;
2. If inPoint is less than 0 or greater than or equal to the current track duration, or duration is not greater than 0.
See also
removeCaption

◆ addClip:inPoint:

- (NvsVideoClip *) addClip: (NSString *)  filePath
inPoint: (int64_t)  inPoint 

Adds the clip.

Parameters
filePathThe path of clip

For the clip's path in IOS, there are four ways:

a. When imported through the ALAssetsLibrary instance, the clip's path format is as follows: "assets-library://asset/asset.mov?id=E0723C86-AA47-409C-B4E2-526D7C2AA9B5&ext=mov";

b. When imported through the MPMediaQuery instance of the IPod Library, the clip's path format is as follows: "ipod-library://item/item.mp3?id=1217463725835578132";

c. When imported through the sand box path, the clip's path format is as follows: "/var/mobile/Containers/Data/Documents/tmp/video20170406101714.mp4";

d. After IOS 8.0, the Photos framework replaces the ALAssetsLibrary library, and when imported via the PHAset instance. The clip's path is as follows: "file:///var/mobile/Media/DCIM/100APPLE/IMG_0646.MP4".

Parameters
inPointThe in point Which the clip is on the timeline (in microseconds)
Returns
Returns the added NvsVideoClip object.

For more information of the in and out points of a clip on the timeline, please refer to The Topic of Triming In and Out Points.

Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
See also
- appendClip:
- insertClip:clipIndex:
- addClip:inPoint:trimIn:trimOut:

◆ addClip:inPoint:trimIn:trimOut:

- (NvsVideoClip *) addClip: (NSString *)  filePath
inPoint: (int64_t)  inPoint
trimIn: (int64_t)  trimIn
trimOut: (int64_t)  trimOut 

Adds a clip of the specified duration.

Parameters
filePathThe path of clip. For the method of the clip path, please refer to the "filePath" which is the parameter of addClip:inPoint:.
inPointThe in point which the clip is on the timeline (in microseconds)
trimInThe in point of triming on the video clip (in microseconds)
trimOutThe out point of triming on the video clip (in microseconds)
Returns
Returns the added NvsVideoClip object.

When users use addClip:inPoint: to add a clip, the clip which will be added split firstly the current clip at the specified in point on the timeline. Then, from the current specified in point, the clips which contain in the position corresponding to the duaration on the track are deleted according to the duration of the clip which will be added. Then Add a clip of the specified duration. If there is a gap in the corresponding position, it will be covered directly.

Example is as follows:

As shown above, there are three video clips C1, C2, C3 on the track, and a clip C4 will be added. The Arrow pointing on the C4 clip are the triming in and out point of the clip. The arrow on the track is the in-point of the clip on the timeline. After triming, the clip of the specified duration is added on the track. The code is implemented as follows:

   NvsVideoTrack *videoTrack;   //The object of videoTrack's creation is omitted here
   //filepath: the path of the clip C4, and "inPoint" is the value of the position indicated by the arrow on the track in the figure, "trimIn" and "trimOut" are the values at the position indicated by the arrow on the C4 clip of the above figure.
   [videoTrack addClip:filepath inPoint:inPoint trimIn:trimIn trimOut:trimOut];

When added, the results are as follows:

Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the file original duration, it will be played in the last frame
See also
- appendClip:trimIn:trimOut:
- insertClip:trimIn:trimOut:clipIndex:
- addClip:inPoint:

◆ addCompoundCaption:duration:compoundCaptionPackageId:

- (NvsTrackCompoundCaption *) addCompoundCaption: (int64_t)  inPoint
duration: (int64_t)  duration
compoundCaptionPackageId: (NSString *)  compoundCaptionPackageId 

Add a caption on the track.

Parameters
captionTextText of caption
inPointThe in point of the caption on the track (in microseconds)
durationCaption display duration (in microseconds)
captionStylePackageIdCaption style package Id.If it does not exist, you can pass an empty string or null.
Returns
Returns the NvsTrackCaption object.
It will return null in the following situations:
1. No compound caption function authorization;
2. If inPoint is less than 0 or greater than or equal to the current track duration, or duration is not greater than 0.
Since
2.9.0
See also
removeCompoundCaption

◆ addCustomAnimatedSticker:duration:animatedStickerPackageId:customImagePath:

- (NvsTrackAnimatedSticker *) addCustomAnimatedSticker: (int64_t)  inPoint
duration: (int64_t)  duration
animatedStickerPackageId: (NSString *)  animatedStickerPackageId
customImagePath: (NSString *)  customImagePath 

Add a custom animated sticker on the track.

Parameters
inPointThe in point of custom animated sticker on the track (in microseconds)
durationThe duration of custom animation sticker which displayed (in microseconds)
animatedStickerPackageIdAnimated sticker package Id
customImagePathPath of custom animated sticker image(It can be a jpg, png image, or a dynamic caf format image supported by Meishe sdk)
Returns
Return the NvsTrackAnimatedSticker object.
It will return null in the following situations:
1. No animated sticker function authorization;
2. The animatedStickerPackageId is empty or null;
3. The animatedSticker has not install successed;
4. If inPoint is less than 0 or greater than or equal to the current track duration, or duration is not greater than 0.
Note: If the return value is not null, you still cannot see the sticker effect, you need to check whether the customImagePath actually exists.
See also
removeAnimatedSticker

◆ addCustomPanoramicAnimatedSticker:duration:animatedStickerPackageId:customImagePath:

- (NvsTrackAnimatedSticker *) addCustomPanoramicAnimatedSticker: (int64_t)  inPoint
duration: (int64_t)  duration
animatedStickerPackageId: (NSString *)  animatedStickerPackageId
customImagePath: (NSString *)  customImagePath 

Add a a custom panorama animated sticker on the track.

Parameters
inPointThe in point of custom animated sticker on the track (in microseconds)
durationThe duration of custom animation sticker which displayed (in microseconds)
animatedStickerPackageIdAnimated sticker package Id
customImagePathPath of custom animated sticker image
Returns
Return the NvsTrackAnimatedSticker object.
It will return null in the following situations:
1. No animated sticker function authorization or no panoramic function authorization;
2. The animatedStickerPackageId is empty or null;
3. The animatedSticker has not install successed;
4. If inPoint is less than 0 or greater than or equal to the current track duration, or duration is not greater than 0.
Note: If the return value is not null, you still cannot see the sticker effect, you need to check whether the customImagePath actually exists.
Since
1.6.0
See also
removeAnimatedSticker

◆ addCustomTrackVideoFx:duration:customVideoFxRender:

- (NvsTrackVideoFx *) addCustomTrackVideoFx: (int64_t)  inPoint
duration: (int64_t)  duration
customVideoFxRender: (id< NvsCustomVideoFxRenderer >)  customVideoFxRender 

Add a custom track video effect on the track.

Parameters
inPointThe in point of the track video effect on the track (in microseconds)
durationDuration of the track video effect which displayed (in microseconds)
customVideoFxRenderUser-implemented custom video effects renderer interface
Returns
Return the NvsTrackVideoFx object
Since
2.15.0
2.15.0

◆ addModularCaption:inPoint:duration:

- (NvsTrackCaption *) addModularCaption: (NSString *)  captionText
inPoint: (int64_t)  inPoint
duration: (int64_t)  duration 

Add a modular caption on the track.

Parameters
captionTextText of caption
inPointThe in point of the caption on the track (in microseconds)
durationCaption display duration (in microseconds)
Returns
Returns the NvsTrackCaption object.
It will return null in the following situations:
1. No caption function authorization;
2. If inPoint is less than 0 or greater than or equal to the current track duration, or duration is not greater than 0.
See also
removeCaption

◆ addPackagedTrackVideoFx:duration:videoFxPackageId:

- (NvsTrackVideoFx *) addPackagedTrackVideoFx: (int64_t)  inPoint
duration: (int64_t)  duration
videoFxPackageId: (NSString *)  videoFxPackageId 

Add a track video effect in the form of a resource package on the track.

Parameters
inPointThe in point of the track video effect on the track (in microseconds)
durationDuration of the timeline video effect which displayed (in microseconds)
videoFxPackageIdThe Id of resource package
Returns
Return the NvsTrackVideoFx object
Since
2.15.0

◆ addPanoramicAnimatedSticker:duration:animatedStickerPackageId:

- (NvsTrackAnimatedSticker *) addPanoramicAnimatedSticker: (int64_t)  inPoint
duration: (int64_t)  duration
animatedStickerPackageId: (NSString *)  animatedStickerPackageId 

Add a panorama animation sticker on the track.

Parameters
inPointThe in point of the animated sticker on the track (in microseconds)
durationThe duration of the animation sticker which displayed (in microseconds)
animatedStickerPackageIdAnimated sticker package Id
Returns
Return the NvsTrackAnimatedSticker object.
It will return null in the following situations:
1. No animated sticker function authorization or no panoramic function authorization;
2. The animatedStickerPackageId is empty or null;
3. The animatedSticker has not install successed;
4. If inPoint is less than 0 or greater than or equal to the current track duration, or duration is not greater than 0.
Since
1.6.0
See also
removeAnimatedSticker

◆ addPanoramicCaption:inPoint:duration:captionStylePackageId:

- (NvsTrackCaption *) addPanoramicCaption: (NSString *)  captionText
inPoint: (int64_t)  inPoint
duration: (int64_t)  duration
captionStylePackageId: (NSString *)  captionStylePackageId 

Add a panorama caption on the track.

Parameters
captionTextText of caption
inPointThe in point of the caption on the track (in microseconds)
durationCaption display duration (in microseconds)
captionStylePackageIdCaption style package Id.If it does not exist, you can pass an empty string or null.
Returns
Returns the NvsTrackCaption object.
It will return null in the following situations:
1. No caption function authorization;
2. If inPoint is less than 0 or greater than or equal to the current track duration, or duration is not greater than 0.
Since
1.6.0
See also
removeCaption

◆ addTimelineClip:inPoint:

- (NvsVideoClip *) addTimelineClip: (NvsTimeline *)  timeline
inPoint: (int64_t)  inPoint 

Adds a timeline clip.

Parameters
timelineThe timeline object to be added
inPointThe in point Which the clip is on the timeline (in microseconds)
Returns
Returns the added NvsVideoClip object.

For more information of the in and out points of a clip on the timeline, please refer to The Topic of Triming In and Out Points.

Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
See also
- appendTimelineClip:
- insertTimelineClip:clipIndex:
- addTimelineClip:inPoint:trimIn:trimOut:
Since
2.24.0

◆ addTimelineClip:inPoint:trimIn:trimOut:

- (NvsVideoClip *) addTimelineClip: (NvsTimeline *)  timeline
inPoint: (int64_t)  inPoint
trimIn: (int64_t)  trimIn
trimOut: (int64_t)  trimOut 

Adds a timeline clip of the specified duration.

Parameters
timelineThe timeline object to be added
inPointThe in point which the clip is on the timeline (in microseconds)
trimInThe in point of triming on the video clip (in microseconds)
trimOutThe out point of triming on the video clip (in microseconds)
Returns
Returns the added NvsVideoClip object.
Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the added timeline duration, it will be played in the last frame
See also
- appendTimelineClip:trimIn:trimOut:
- insertTimelineClip:trimIn:trimOut:clipIndex:
- addTimelineClip:inPoint:
Since
2.24.0

◆ appendClip:

- (NvsVideoClip *) appendClip: (NSString *)  filePath

Appends clip at the end of the video track.

Parameters
filePathThe path of clip. For the method of the clip path, please refer to the "filePath" which is the parameter of addClip:inPoint:.
Returns
Returns the appended NvsVideoClip object.

The example is as follows:

There are three clips C1, C2, and C3 on the video track in the above figure. If a new clip C4 is added to the end of the video track, the code is:

    NvsVideoTrack *videoTrack;          //The object of videoTrack's creation is omitted here
    [videoTrack appendClip:filepath];   //filepath:the path of the clip C4.

After addition, the result is as follows:

Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
See also
- insertClip:clipIndex:
- getClipWithIndex:
- appendClip:trimIn:trimOut:

◆ appendClip:trimIn:trimOut:

- (NvsVideoClip *) appendClip: (NSString *)  filePath
trimIn: (int64_t)  trimIn
trimOut: (int64_t)  trimOut 

Appends a video clip of the specified duration to the end of the video track.

Parameters
filePathThe path of clip. For the method of the clip path, please refer to the "filePath" which is the parameter of addClip:inPoint:.
trimInThe in point of triming on the video clip (in microseconds)
trimOutThe out point of triming on the video clip (in microseconds)
Returns
Returns the appended NvsVideoClip object.

For more information of triming in and out points, please refer to The Topic of Triming In and Out Points.

Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the file original duration, it will be played in the last frame
See also
- appendClip:
- insertClip:clipIndex:
- getClipWithIndex:

◆ appendTimelineClip:

- (NvsVideoClip *) appendTimelineClip: (NvsTimeline *)  timeline

Appends a timeline clip at the end of the video track.

Parameters
timelineThe timeline object to be appended.
Returns
Returns the appended NvsVideoClip object.
Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
See also
- insertTimelineClip:clipIndex:
- getClipWithIndex:
- appendTimelineClip:trimIn:trimOut:
Since
2.24.0

◆ appendTimelineClip:trimIn:trimOut:

- (NvsVideoClip *) appendTimelineClip: (NvsTimeline *)  timeline
trimIn: (int64_t)  trimIn
trimOut: (int64_t)  trimOut 

Appends a timeline clip of the specified duration to the end of the video track.

Parameters
timelineThe timeline object to be appended.
trimInThe in point of triming on the video clip (in microseconds)
trimOutThe out point of triming on the video clip (in microseconds)
Returns
Returns the appended NvsVideoClip object. For more information of triming in and out points, please refer to The Topic of Triming In and Out Points.
Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the file original duration, it will be played in the last frame
See also
- appendTimelineClip:
- insertTimelineClip:clipIndex:
- getClipWithIndex:
Since
2.24.0

◆ getAnimatedStickersByTimelinePosition:

- (NSArray *) getAnimatedStickersByTimelinePosition: (int64_t)  timelinePos

Get an animated sticker list based on the position on the track.

Parameters
trackPosPosition on the track (in microseconds)
Returns
Returns a list which holding the current position animated sticker object
The sorting rules for the obtained animated sticker list are as follows:
1.When adding, the in points are different,animated stickers are arranged in the order of the in points;
2.When adding, the in points are the same, they are arranged in the order in which the animation stickers are added.
See also
addAnimatedSticker

◆ getCaptionsByTimelinePosition:

- (NSArray *) getCaptionsByTimelinePosition: (int64_t)  timelinePos

Get a list of captions based on the position on the track.

Parameters
trackPosThe position on the track(in micro-second)
Returns
Returns a list of arrays of captions at the current position。
The sorting rules for the obtained captions list are as follows:
1.When adding, the in points are different, and captions are arranged in the order of the in points;
2.When adding, the in points are the same, and captions are arranged in the order of adding captions.
See also
addCaption

◆ getClipWithIndex:

- (NvsVideoClip *) getClipWithIndex: (unsigned int)  clipIndex

Gets the video clip by index.

Parameters
clipIndexThe index of clip. Range of "clipIndex" is [0,clipCount-1].
Returns
Returns the obtained NvsVideoClip object.
See also
- getClipWithTimelinePosition:
- appendClip:
- insertClip:clipIndex:

◆ getClipWithTimelinePosition:

- (NvsVideoClip *) getClipWithTimelinePosition: (int64_t)  timelinePos

Gets the video clip by time.

Parameters
timelinePosThe position on the timeline (in microseconds)
Returns
Returns he obtained NvsVideoClip object.
See also
- getClipWithIndex:

◆ getCompoundCaptionsByTimelinePosition:

- (NSArray<NvsTrackCompoundCaption*> *) getCompoundCaptionsByTimelinePosition: (int64_t)  timelinePos

Get a list of compound captions based on the position on the track.

Parameters
trackPosThe position on the track(in micro-second)
Returns
Returns a list of compound captions at the current position。
The sorting rules for the obtained captions list are as follows:
1. If the in points are different, captions are sorted in the order of the in points;
2. If the in points are the same, and captions are sorted in the order of compound caption added.
Since
2.9.0
See also
addCompoundCaption

◆ getFirstAnimatedSticker

- (NvsTrackAnimatedSticker *) getFirstAnimatedSticker

Get the first animated sticker on the track.

Returns
Return the acquired NvsTrackAnimatedSticker object.
See also
- getLastAnimatedSticker
addAnimatedSticker

◆ getFirstCaption

- (NvsTrackCaption *) getFirstCaption

Get the first caption on the track.

Returns
Returns the NvsTrackCaption object.
See also
- getLastCaption
addCaption

◆ getFirstCompoundCaption

- (NvsTrackCompoundCaption *) getFirstCompoundCaption

Get the first compound caption on the track.

Returns
Returns the compound caption object.
Since
2.9.0
See also
- getLastCompoundCaption
addCompoundCaption

◆ getFirstTrackVideoFx

- (NvsTrackVideoFx *) getFirstTrackVideoFx

Get the first track video effect on the track.

Returns
Returns the acquired NvsTrackVideoFx object.
Since
2.15.0

◆ getLastAnimatedSticker

- (NvsTrackAnimatedSticker *) getLastAnimatedSticker

Get the last animated sticker on the track.

Returns
Return the acquired NvsTrackAnimatedSticker object.
See also
- getFirstAnimatedSticker

◆ getLastCaption

- (NvsTrackCaption *) getLastCaption

Get the last caption on the track.

Returns
Returns the NvsTrackCaption object.
See also
- getFirstCaption
addCaption

◆ getLastCompoundCaption

- (NvsTrackCompoundCaption *) getLastCompoundCaption

Get the last compound caption on the track.

Returns
Returns the compound caption object.
Since
2.9.0
See also
- getFirstCompoundCaption
addCompoundCaption

◆ getLastTrackVideoFx

- (NvsTrackVideoFx *) getLastTrackVideoFx

Get the last track video effect on the track.

Returns
Returns the acquired NvsTrackVideoFx object.
Since
2.15.0

◆ getNextAnimatedSticker:

- (NvsTrackAnimatedSticker *) getNextAnimatedSticker: (NvsTrackAnimatedSticker *)  animatedSticker

Get the next animated sticker of the current animated sticker of the track.

Parameters
animatedStickerthe current NvsTrackAnimatedSticker obejct
Returns
Return the acquired NvsTrackAnimatedSticker object.
See also
getPrevAnimatedSticker

◆ getNextCaption:

- (NvsTrackCaption *) getNextCaption: (NvsTrackCaption *)  caption

Get the next caption of the current caption on the track.

Parameters
captionThe current caption on the track
Returns
Returns the NvsTrackCaption object.
See also
getPrevCaption

◆ getNextCompoundCaption:

- (NvsTrackCompoundCaption *) getNextCompoundCaption: (NvsTrackCompoundCaption *)  caption

Get the next compound caption of the current compound caption on the track.

Parameters
captionThe current compound caption on the track
Returns
Returns the compound caption object.
Since
2.9.0
See also
getPrevCompoundCaption

◆ getNextTrackVideoFx:

- (NvsTrackVideoFx *) getNextTrackVideoFx: (NvsTrackVideoFx *)  videoFx

Get the next track video effect of a track video effect on the track.

Parameters
videoFxThe NvsTrackVideoFx object
Returns
Returns the acquired NvsTrackVideoFx object.
Since
2.15.0

◆ getPrevAnimatedSticker:

- (NvsTrackAnimatedSticker *) getPrevAnimatedSticker: (NvsTrackAnimatedSticker *)  animatedSticker

Get the previous animated sticker of the current animated sticker of the track.

Parameters
animatedStickerthe current NvsTrackAnimatedSticker obejct
Returns
Return the acquired NvsTrackAnimatedSticker object.
See also
getNextAnimatedSticker

◆ getPrevCaption:

- (NvsTrackCaption *) getPrevCaption: (NvsTrackCaption *)  caption

Get the previous caption of the current caption on the track.

Parameters
captionThe current caption on the track
Returns
Returns the NvsTrackCaption object.
See also
getNextCaption

◆ getPrevCompoundCaption:

- (NvsTrackCompoundCaption *) getPrevCompoundCaption: (NvsTrackCompoundCaption *)  caption

Get the previous compound caption of the current compound caption on the track.

Parameters
captionThe current compound caption on the track
Returns
Returns the compound caption object.
Since
2.9.0
See also
getNextCompoundCaption

◆ getPrevTrackVideoFx:

- (NvsTrackVideoFx *) getPrevTrackVideoFx: (NvsTrackVideoFx *)  videoFx

Get the previous track video effect of a track video effect on the track.

Parameters
videoFxThe NvsTrackVideoFx object
Returns
Returns the acquired NvsTrackVideoFx object.
Since
2.15.0

◆ getProxyScale

- (NvsRational) getProxyScale

Gets whether the current track is disabled from rendering at the proxy scale.

Returns
Disable or not.
See also
disableProxyScale
Since
2.19.1

◆ getTrackVideoFxByPosition:

- (NSArray *) getTrackVideoFxByPosition: (int64_t)  pos

Get a list of track video effects based on position on the track.

Parameters
posThe position on the track (in microseconds)
Returns
Returns an array of track video effects in current position.
The ordering rules for the acquired track video effects are as follows:
1.When adding, the in points are different, arranged in the order of the in points;
2.When adding, the entry points are the same, arranged in the order of adding timeline video effects.
Since
2.15.0

◆ getTransitionWithSourceClipIndex:

- (NvsVideoTransition *) getTransitionWithSourceClipIndex: (unsigned int)  srcClipIndex

Gets the transition by the source clip index.

Parameters
srcClipIndexThe index of the source clip.Note:If the value of srcClipIndex is more than clipCount-2 of this track ,the return object is null.
Returns
Returns the obtained NvsVideoTransition object.
See also
- setBuiltinTransition:withName:

◆ insertClip:clipIndex:

- (NvsVideoClip *) insertClip: (NSString *)  filePath
clipIndex: (unsigned int)  clipIndex 

Inserts a video clip at the specified clip index on the video track.

Parameters
filePathThe path of clip. For the method of the clip path, please refer to the "filePath" which is the parameter of addClip:inPoint:.
clipIndexIndex of the specified clip
Returns
Returns the inserted NvsVideoClip object.

Calling the function of insertClip:clipIndex: inserts a clip before the clip of the specified "clipIndex". An example is as follows:

There are three video clips C1, C2, and C3 on the track in the above figure, and the clip to be inserted is recorded as C4. If the clip is inserted before C1, the value of "clipIndex" is 0 and same rule can be used in other cases. The corresponding code is implemented as follows:

   NvsVideoTrack *videoTrack;                       //The object of videoTrack's creation is omitted here
   [videoTrack insertClip:filepath clipIndex:0];    //filepath: the path of clip C4, and the value of "clipIndex" is [0, clipCount-1]

After insertion, the result is as follows:

Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
If index is greater than the number of existing clips, it is added at the end.If the value of clipIndex is equal to 0, meanwhile the timeline contain themeLeader,the return object is null.If the value of clipIndex is more or equal to the clipCount of this track, meanwhile the timeline contain themeTrailer,the return object is null.
See also
- appendClip:
- getClipWithIndex:
- insertClip:trimIn:trimOut:clipIndex:

◆ insertClip:trimIn:trimOut:clipIndex:

- (NvsVideoClip *) insertClip: (NSString *)  filePath
trimIn: (int64_t)  trimIn
trimOut: (int64_t)  trimOut
clipIndex: (unsigned int)  clipIndex 

Inserts a video clip of the specified duration at the specified clip index on the video track.

Parameters
filePathThe path of clip. For the method of the clip path, please refer to the "filePath" which is the parameter of addClip:inPoint:.
trimInThe in point of triming on the video clip (in microseconds)
trimOutThe out point of triming on the video clip (in microseconds)
clipIndexIndex of the specified clip
Returns
Returns the inserted NvsVideoClip object.

The example is as followes:

There are three video clips C1, C2, C3 on the track in the above figure, and the clip C4 is to be inserted. The point indicated by the arrow on the C4 clip is the triming in and out point of the clip, and the C4 is inserted into the track after triming. Note: The trim in and out values must be within the duration of this clip, and the in point of triming value must be less than the out point of triming value. The implementation code is as follows:

   NvsVideoTrack *videoTrack;   //The object of videoTrack's creation is omitted here
   //filepath: the path of clip C4. "trimIn" and "trimOut" are the values at the position indicated by the arrow on the C4 clip of the above figure, and the value of "clipIndex" is [0, clipCount-1].
   [videoTrack insertClip:filepath trimIn:trimIn trimOut:trimOut clipIndex:0];

After insertion, the result is as follows:

Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
If index is greater than the number of existing clips, it is added at the end.If the value of clipIndex is equal to 0, meanwhile the timeline contain themeLeader,the return object is null.If the value of clipIndex is more or equal to the clipCount of this track, meanwhile the timeline contain themeTrailer,the return object is null.
Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the file original duration, it will be played in the last frame
See also
- appendClip:trimIn:trimOut:
- insertClip:clipIndex:
- getClipWithIndex:

◆ insertTimelineClip:clipIndex:

- (NvsVideoClip *) insertTimelineClip: (NvsTimeline *)  timeline
clipIndex: (unsigned int)  clipIndex 

Inserts a timeline clip at the specified clip index on the video track.

Parameters
timelineThe timeline object to be inserted.
Returns
Returns the inserted NvsVideoClip object.
Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
If index is greater than the number of existing clips, it is added at the end.If the value of clipIndex is equal to 0, meanwhile the timeline contain themeLeader,the return object is null.If the value of clipIndex is more or equal to the clipCount of this track, meanwhile the timeline contain themeTrailer,the return object is null.
See also
- appendTimelineClip:
- getClipWithIndex:
- insertTimelineClip:trimIn:trimOut:clipIndex:
Since
2.24.0

◆ insertTimelineClip:trimIn:trimOut:clipIndex:

- (NvsVideoClip *) insertTimelineClip: (NvsTimeline *)  timeline
trimIn: (int64_t)  trimIn
trimOut: (int64_t)  trimOut
clipIndex: (unsigned int)  clipIndex 

Inserts a timeline clip of the specified duration at the specified clip index on the video track.

Parameters
timelineThe timeline object to be inserted.
trimInThe in point of triming on the video clip (in microseconds)
trimOutThe out point of triming on the video clip (in microseconds)
clipIndexIndex of the specified clip
Returns
Returns the inserted NvsVideoClip object.
Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
If index is greater than the number of existing clips, it is added at the end.If the value of clipIndex is equal to 0, meanwhile the timeline contain themeLeader,the return object is null.If the value of clipIndex is more or equal to the clipCount of this track, meanwhile the timeline contain themeTrailer,the return object is null.
Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the inserted timeline duration, it will be played in the last frame
See also
- appendTimelineClip:trimIn:trimOut:
- insertTimelineClip:clipIndex:
- getClipWithIndex:
Since
2.24.0

◆ isOriginalRender

- (BOOL) isOriginalRender

Gets whether the original scale rendering mode is turned on.

Returns
Turn on or not.
See also
setEnableOriginalRender

◆ removeAnimatedSticker:

- (NvsTrackAnimatedSticker *) removeAnimatedSticker: (NvsTrackAnimatedSticker *)  animatedSticker

Remove an animated sticker on the track.

Parameters
animatedStickerThe NvsTrackAnimatedSticker object which will be removed
Returns
Return the next NvsTrackAnimatedSticker object.
See also
addAnimatedSticker

◆ removeCaption:

- (NvsTrackCaption *) removeCaption: (NvsTrackCaption *)  caption

Remove the caption on the track.

Parameters
captiontrack caption object which removed
Returns
Returns the next NvsTrackCaption object.
See also
addCaption

◆ removeCompoundCaption:

- (NvsTrackCompoundCaption *) removeCompoundCaption: (NvsTrackCompoundCaption *)  caption

Remove compound caption from the track.

Parameters
captiontrack compound caption object which to be removed
Returns
Returns the next compound caption object.
Since
2.9.0
See also
addCompoundCaption

◆ removeTrackVideoFx:

- (NvsTrackVideoFx *) removeTrackVideoFx: (NvsTrackVideoFx *)  videoFx

Remove a track video effect from the track.

Parameters
videoFxThe NvsTrackVideoFx object which will be removed
Returns
Returns the next NvsTrackVideoFx object of current track video effect which has removed.
Since
2.15.0

◆ setBuiltinTransition:withName:

- (NvsVideoTransition *) setBuiltinTransition: (unsigned int)  srcClipIndex
withName: (NSString *)  transitionName 

Sets built-in transitions.

Parameters
srcClipIndexThe index of the source video clip.Note:If the value of srcClipIndex is more than clipCount-2 of this track ,the return object is nil.
transitionNameThe name of the transition. if users want to get the video transition name, please refer to getAllBuiltinVideoTransitionNames() or The List of Built-in Effect Name. Note: If the transition name is a null string, the original transition will be deleted.
Returns
Returns the NvsVideoTransition object. If the transition name is a null string(namely, delete the original transition), the function will return null.

Example is as follows:

The video transition is used to realize a smooth transition between clips and avoid jumping when previewing videos. The transition must be set between the connected clips. Between the clips with gaps, the transition cannot be set. For instance, there are four video clips C1, C2, C3, C4 in the image above, we could set a built-in transition between C1 and C2, while we can't do it between C3 and C4. Codes are as follow:

  NvsVideoTrack *videoTrack;
  [videoTrack setBuiltinTransition:0 withName:transitionName];

After setting a built-in transition, the result is as follow:

Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
See also
- setPackagedTransition:withPackageId:

◆ setCustomVideoTransition:withCustomRender:

- (NvsVideoTransition *) setCustomVideoTransition: (unsigned int)  srcClipIndex
withCustomRender: (id< NvsCustomVideoTransitionRenderer >)  customVideoFxRender 

Sets custom video transition.

Parameters
srcClipIndexSource video clip index.Note:If the value of srcClipIndex is more than clipCount-2 of this track ,the return object is null.
customVideoTransitionRenderUser-implemented custom video effects renderer interface;
Returns
Returns the video transition object.
Warning
This interface will cause the streaming engine state to jump to the engine stop state. For details, please refer to Engine Change.
See also
setBuiltinTransition

◆ setEnableOriginalRender:

- (void) setEnableOriginalRender: (BOOL)  enable

Turn on special effect rendering based on the original scale of the video track.

Parameters
EnableTurn on or not.
See also
- isOriginalRender

◆ setPackagedTransition:withPackageId:

- (NvsVideoTransition *) setPackagedTransition: (unsigned int)  srcClipIndex
withPackageId: (NSString *)  packageId 

Sets the package transition.

Parameters
srcClipIndexThe index of the source video clip.Note:If the value of srcClipIndex is more than clipCount-2 of this track ,the return object is null.
packageIdThe ID of the resource package. If the package Id is a null string, the transition will be deleted; if the package Id is set to "theme", the transition at the video clip will be set to the one in the current theme. Note: If there is no theme, the transition at the video clip will be deleted.
Returns
Returns the NvsVideoTransition object.
Warning
This interface causes the streaming engine state to jump to the state of stopping engine. For more details, please refer to The Topic of Changing Engine.
See also
- setBuiltinTransition:withName:

◆ setProxyScale:

- (void) setProxyScale: (NvsRational proxyScale

Disable the current track from rendering at the proxy scale.

Parameters
disableDisable or not.
See also
isProxyScaleDisable
Since
2.19.1

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