MeiCam SDK For iOS
3.14.0
|
Video track is the collection of video clips. More...
#import <NvsVideoTrack.h>
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... | |
(void) | - updateAudioForTrackVideoFx |
Update the audio information in the current track effect. More... | |
(NvsTrackVideoFx *) | - addBuiltinTrackVideoFx:duration:videoFxName: |
Add a built-in track video effect on the track. More... | |
(NvsTrackVideoFx *) | - addBuiltinTrackVideoFx:duration:videoFxName:flags: |
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 *) | - addPackagedTrackVideoFx:duration:videoFxPackageId:flags: |
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... | |
![]() | |
(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... | |
![]() | |
(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 | |
![]() | |
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... | |
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.
- (NvsTrackAnimatedSticker *) addAnimatedSticker: | (int64_t) | inPoint | |
duration: | (int64_t) | duration | |
animatedStickerPackageId: | (NSString *) | animatedStickerPackageId | |
Add a animated sticker on the track.
inPoint | The in point of the animated sticker on the track (in microseconds) |
duration | The duration of the animation sticker which displayed (in microseconds) |
animatedStickerPackageId | Animated sticker package Id |
- (NvsTrackVideoFx *) addBuiltinTrackVideoFx: | (int64_t) | inPoint | |
duration: | (int64_t) | duration | |
videoFxName: | (NSString *) | videoFxName | |
Add a built-in track video effect on the track.
inPoint | The in point of the track video effect on the track (in microseconds) |
duration | Duration of the track video effect which displayed (in microseconds) |
videoFxName | The video effect name |
- (NvsTrackVideoFx *) addBuiltinTrackVideoFx: | (int64_t) | inPoint | |
duration: | (int64_t) | duration | |
videoFxName: | (NSString *) | videoFxName | |
flags: | (int) | flags | |
Add a built-in track video effect on the track.
inPoint | The in point of the track video effect on the track (in microseconds) |
duration | Duration of the track video effect which displayed (in microseconds) |
videoFxName | The video effect name |
flags | Special flag for previewing. If there is no special need, please fill in 0. Please refer to NvsTrackAddFxFlags. |
- (NvsTrackCaption *) addCaption: | (NSString *) | captionText | |
inPoint: | (int64_t) | inPoint | |
duration: | (int64_t) | duration | |
captionStylePackageId: | (NSString *) | captionStylePackageId | |
Add a caption on the track.
captionText | Text of caption |
inPoint | The in point of the caption on the track (in microseconds) |
duration | Caption display duration (in microseconds) |
captionStylePackageId | Caption style package Id.If it does not exist, you can pass an empty string or null. |
- (NvsVideoClip *) addClip: | (NSString *) | filePath | |
inPoint: | (int64_t) | inPoint | |
Adds the clip.
filePath | The path of clip |
For the clip's path in IOS, there are four ways:
a. 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";
b. When imported through the sand box path, the clip's path format is as follows: "/var/mobile/Containers/Data/Documents/tmp/video20170406101714.mp4";
c. Imports via the PHAset instance. The clip's path is as follows: "file:///var/mobile/Media/DCIM/100APPLE/IMG_0646.MP4".
inPoint | The in point Which the clip is on the timeline (in microseconds) |
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.
- (NvsVideoClip *) addClip: | (NSString *) | filePath | |
inPoint: | (int64_t) | inPoint | |
trimIn: | (int64_t) | trimIn | |
trimOut: | (int64_t) | trimOut | |
Adds a clip of the specified duration.
filePath | The path of clip. For the method of the clip path, please refer to the "filePath" which is the parameter of addClip:inPoint:. |
inPoint | The in point which the clip is on the timeline (in microseconds) |
trimIn | The in point of triming on the video clip (in microseconds) |
trimOut | The out point of triming on the video clip (in microseconds) |
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:
- (NvsTrackCompoundCaption *) addCompoundCaption: | (int64_t) | inPoint | |
duration: | (int64_t) | duration | |
compoundCaptionPackageId: | (NSString *) | compoundCaptionPackageId | |
Add a caption on the track.
captionText | Text of caption |
inPoint | The in point of the caption on the track (in microseconds) |
duration | Caption display duration (in microseconds) |
captionStylePackageId | Caption style package Id.If it does not exist, you can pass an empty string or null. |
- (NvsTrackAnimatedSticker *) addCustomAnimatedSticker: | (int64_t) | inPoint | |
duration: | (int64_t) | duration | |
animatedStickerPackageId: | (NSString *) | animatedStickerPackageId | |
customImagePath: | (NSString *) | customImagePath | |
Add a custom animated sticker on the track.
inPoint | The in point of custom animated sticker on the track (in microseconds) |
duration | The duration of custom animation sticker which displayed (in microseconds) |
animatedStickerPackageId | Animated sticker package Id |
customImagePath | Path of custom animated sticker image(It can be a jpg, png image, or a dynamic caf format image supported by Meishe sdk) |
- (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.
inPoint | The in point of custom animated sticker on the track (in microseconds) |
duration | The duration of custom animation sticker which displayed (in microseconds) |
animatedStickerPackageId | Animated sticker package Id |
customImagePath | Path of custom animated sticker image |
- (NvsTrackVideoFx *) addCustomTrackVideoFx: | (int64_t) | inPoint | |
duration: | (int64_t) | duration | |
customVideoFxRender: | (id< NvsCustomVideoFxRenderer >) | customVideoFxRender | |
Add a custom track video effect on the track.
inPoint | The in point of the track video effect on the track (in microseconds) |
duration | Duration of the track video effect which displayed (in microseconds) |
customVideoFxRender | User-implemented custom video effects renderer interface |
- (NvsTrackCaption *) addModularCaption: | (NSString *) | captionText | |
inPoint: | (int64_t) | inPoint | |
duration: | (int64_t) | duration | |
Add a modular caption on the track.
captionText | Text of caption |
inPoint | The in point of the caption on the track (in microseconds) |
duration | Caption display duration (in microseconds) |
- (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.
inPoint | The in point of the track video effect on the track (in microseconds) |
duration | Duration of the timeline video effect which displayed (in microseconds) |
videoFxPackageId | The Id of resource package |
- (NvsTrackVideoFx *) addPackagedTrackVideoFx: | (int64_t) | inPoint | |
duration: | (int64_t) | duration | |
videoFxPackageId: | (NSString *) | videoFxPackageId | |
flags: | (int) | flags | |
Add a track video effect in the form of a resource package on the track.
inPoint | The in point of the track video effect on the track (in microseconds) |
duration | Duration of the timeline video effect which displayed (in microseconds) |
videoFxPackageId | The Id of resource package |
flags | Special flag for previewing. If there is no special need, please fill in 0. Please refer to NvsTrackAddFxFlags. |
- (NvsTrackAnimatedSticker *) addPanoramicAnimatedSticker: | (int64_t) | inPoint | |
duration: | (int64_t) | duration | |
animatedStickerPackageId: | (NSString *) | animatedStickerPackageId | |
Add a panorama animation sticker on the track.
inPoint | The in point of the animated sticker on the track (in microseconds) |
duration | The duration of the animation sticker which displayed (in microseconds) |
animatedStickerPackageId | Animated sticker package Id |
- (NvsTrackCaption *) addPanoramicCaption: | (NSString *) | captionText | |
inPoint: | (int64_t) | inPoint | |
duration: | (int64_t) | duration | |
captionStylePackageId: | (NSString *) | captionStylePackageId | |
Add a panorama caption on the track.
captionText | Text of caption |
inPoint | The in point of the caption on the track (in microseconds) |
duration | Caption display duration (in microseconds) |
captionStylePackageId | Caption style package Id.If it does not exist, you can pass an empty string or null. |
- (NvsVideoClip *) addTimelineClip: | (NvsTimeline *) | timeline | |
inPoint: | (int64_t) | inPoint | |
Adds a timeline clip.
timeline | The timeline object to be added |
inPoint | The in point Which the clip is on the timeline (in microseconds) |
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.
- (NvsVideoClip *) addTimelineClip: | (NvsTimeline *) | timeline | |
inPoint: | (int64_t) | inPoint | |
trimIn: | (int64_t) | trimIn | |
trimOut: | (int64_t) | trimOut | |
Adds a timeline clip of the specified duration.
timeline | The timeline object to be added |
inPoint | The in point which the clip is on the timeline (in microseconds) |
trimIn | The in point of triming on the video clip (in microseconds) |
trimOut | The out point of triming on the video clip (in microseconds) |
- (NvsVideoClip *) appendClip: | (NSString *) | filePath |
Appends clip at the end of the video track.
filePath | The path of clip. For the method of the clip path, please refer to the "filePath" which is the parameter of addClip:inPoint:. |
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:
- (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.
filePath | The path of clip. For the method of the clip path, please refer to the "filePath" which is the parameter of addClip:inPoint:. |
trimIn | The in point of triming on the video clip (in microseconds) |
trimOut | The out point of triming on the video clip (in microseconds) |
For more information of triming in and out points, please refer to The Topic of Triming In and Out Points.
- (NvsVideoClip *) appendTimelineClip: | (NvsTimeline *) | timeline |
Appends a timeline clip at the end of the video track.
timeline | The timeline object to be appended. |
- (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.
timeline | The timeline object to be appended. |
trimIn | The in point of triming on the video clip (in microseconds) |
trimOut | The out point of triming on the video clip (in microseconds) |
- (NSArray *) getAnimatedStickersByTimelinePosition: | (int64_t) | timelinePos |
Get an animated sticker list based on the position on the track.
trackPos | Position on the track (in microseconds) |
- (NSArray *) getCaptionsByTimelinePosition: | (int64_t) | timelinePos |
Get a list of captions based on the position on the track.
trackPos | The position on the track(in micro-second) |
- (NvsVideoClip *) getClipWithIndex: | (unsigned int) | clipIndex |
Gets the video clip by index.
clipIndex | The index of clip. Range of "clipIndex" is [0,clipCount-1]. |
- (NvsVideoClip *) getClipWithTimelinePosition: | (int64_t) | timelinePos |
Gets the video clip by time.
timelinePos | The position on the timeline (in microseconds) |
- (NSArray<NvsTrackCompoundCaption*> *) getCompoundCaptionsByTimelinePosition: | (int64_t) | timelinePos |
Get a list of compound captions based on the position on the track.
trackPos | The position on the track(in micro-second) |
- (NvsTrackAnimatedSticker *) getFirstAnimatedSticker |
Get the first animated sticker on the track.
- (NvsTrackCaption *) getFirstCaption |
Get the first caption on the track.
- (NvsTrackCompoundCaption *) getFirstCompoundCaption |
Get the first compound caption on the track.
- (NvsTrackVideoFx *) getFirstTrackVideoFx |
Get the first track video effect on the track.
- (NvsTrackAnimatedSticker *) getLastAnimatedSticker |
Get the last animated sticker on the track.
- (NvsTrackCaption *) getLastCaption |
Get the last caption on the track.
- (NvsTrackCompoundCaption *) getLastCompoundCaption |
Get the last compound caption on the track.
- (NvsTrackVideoFx *) getLastTrackVideoFx |
Get the last track video effect on the track.
- (NvsTrackAnimatedSticker *) getNextAnimatedSticker: | (NvsTrackAnimatedSticker *) | animatedSticker |
Get the next animated sticker of the current animated sticker of the track.
animatedSticker | the current NvsTrackAnimatedSticker obejct |
- (NvsTrackCaption *) getNextCaption: | (NvsTrackCaption *) | caption |
Get the next caption of the current caption on the track.
caption | The current caption on the track |
- (NvsTrackCompoundCaption *) getNextCompoundCaption: | (NvsTrackCompoundCaption *) | caption |
Get the next compound caption of the current compound caption on the track.
caption | The current compound caption on the track |
- (NvsTrackVideoFx *) getNextTrackVideoFx: | (NvsTrackVideoFx *) | videoFx |
Get the next track video effect of a track video effect on the track.
videoFx | The NvsTrackVideoFx object |
- (NvsTrackAnimatedSticker *) getPrevAnimatedSticker: | (NvsTrackAnimatedSticker *) | animatedSticker |
Get the previous animated sticker of the current animated sticker of the track.
animatedSticker | the current NvsTrackAnimatedSticker obejct |
- (NvsTrackCaption *) getPrevCaption: | (NvsTrackCaption *) | caption |
Get the previous caption of the current caption on the track.
caption | The current caption on the track |
- (NvsTrackCompoundCaption *) getPrevCompoundCaption: | (NvsTrackCompoundCaption *) | caption |
Get the previous compound caption of the current compound caption on the track.
caption | The current compound caption on the track |
- (NvsTrackVideoFx *) getPrevTrackVideoFx: | (NvsTrackVideoFx *) | videoFx |
Get the previous track video effect of a track video effect on the track.
videoFx | The NvsTrackVideoFx object |
- (NvsRational) getProxyScale |
Gets whether the current track is disabled from rendering at the proxy scale.
- (NSArray *) getTrackVideoFxByPosition: | (int64_t) | pos |
Get a list of track video effects based on position on the track.
pos | The position on the track (in microseconds) |
- (NvsVideoTransition *) getTransitionWithSourceClipIndex: | (unsigned int) | srcClipIndex |
Gets the transition by the source clip index.
srcClipIndex | The index of the source clip.Note:If the value of srcClipIndex is more than clipCount-2 of this track ,the return object is null. |
- (NvsVideoClip *) insertClip: | (NSString *) | filePath | |
clipIndex: | (unsigned int) | clipIndex | |
Inserts a video clip at the specified clip index on the video track.
filePath | The path of clip. For the method of the clip path, please refer to the "filePath" which is the parameter of addClip:inPoint:. |
clipIndex | Index of the specified clip |
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:
- (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.
filePath | The path of clip. For the method of the clip path, please refer to the "filePath" which is the parameter of addClip:inPoint:. |
trimIn | The in point of triming on the video clip (in microseconds) |
trimOut | The out point of triming on the video clip (in microseconds) |
clipIndex | Index of the specified clip |
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:
- (NvsVideoClip *) insertTimelineClip: | (NvsTimeline *) | timeline | |
clipIndex: | (unsigned int) | clipIndex | |
Inserts a timeline clip at the specified clip index on the video track.
timeline | The timeline object to be inserted. |
- (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.
timeline | The timeline object to be inserted. |
trimIn | The in point of triming on the video clip (in microseconds) |
trimOut | The out point of triming on the video clip (in microseconds) |
clipIndex | Index of the specified clip |
- (BOOL) isOriginalRender |
Gets whether the original scale rendering mode is turned on.
- (NvsTrackAnimatedSticker *) removeAnimatedSticker: | (NvsTrackAnimatedSticker *) | animatedSticker |
Remove an animated sticker on the track.
animatedSticker | The NvsTrackAnimatedSticker object which will be removed |
- (NvsTrackCaption *) removeCaption: | (NvsTrackCaption *) | caption |
Remove the caption on the track.
caption | track caption object which removed |
- (NvsTrackCompoundCaption *) removeCompoundCaption: | (NvsTrackCompoundCaption *) | caption |
Remove compound caption from the track.
caption | track compound caption object which to be removed |
- (NvsTrackVideoFx *) removeTrackVideoFx: | (NvsTrackVideoFx *) | videoFx |
Remove a track video effect from the track.
videoFx | The NvsTrackVideoFx object which will be removed |
- (NvsVideoTransition *) setBuiltinTransition: | (unsigned int) | srcClipIndex | |
withName: | (NSString *) | transitionName | |
Sets built-in transitions.
srcClipIndex | The 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. |
transitionName | The 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. |
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:
- (NvsVideoTransition *) setCustomVideoTransition: | (unsigned int) | srcClipIndex | |
withCustomRender: | (id< NvsCustomVideoTransitionRenderer >) | customVideoFxRender | |
Sets custom video transition.
srcClipIndex | Source video clip index.Note:If the value of srcClipIndex is more than clipCount-2 of this track ,the return object is null. |
customVideoTransitionRender | User-implemented custom video effects renderer interface; |
- (void) setEnableOriginalRender: | (BOOL) | enable |
Turn on special effect rendering based on the original scale of the video track.
Enable | Turn on or not. |
- (NvsVideoTransition *) setPackagedTransition: | (unsigned int) | srcClipIndex | |
withPackageId: | (NSString *) | packageId | |
Sets the package transition.
srcClipIndex | The 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. |
packageId | The 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. |
- (void) setProxyScale: | (NvsRational) | proxyScale |
Disable the current track from rendering at the proxy scale.
disable | Disable or not. |
- (void) updateAudioForTrackVideoFx |
Update the audio information in the current track effect.