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

Timeline is which the entity of editing the scene. More...

#import <NvsTimeline.h>

Inheritance diagram for NvsTimeline:
NvsObject

Instance Methods

(int) - getCreationFlags
 Get the flag for creating timeline. NvsCreateTimelineTypeFlag. More...
 
(NvsVideoTrack *) - appendVideoTrack
 Appends video track. More...
 
(NvsAudioTrack *) - appendAudioTrack
 Appends audio track. More...
 
(NvsVideoTrack *) - insertVideoTrack:
 insert video track. More...
 
(NvsAudioTrack *) - insertAudioTrack:
 Appends audio track. More...
 
(BOOL) - removeVideoTrack:
 Remove video track. More...
 
(BOOL) - removeAudioTrack:
 Remove audio track. More...
 
(unsigned int) - videoTrackCount
 Get count of video track. More...
 
(unsigned int) - audioTrackCount
 Get count of audio track. More...
 
(NvsVideoTrack *) - getVideoTrackByIndex:
 Gets video track with track index. More...
 
(NvsAudioTrack *) - getAudioTrackByIndex:
 Gets audio track with track index. More...
 
(BOOL) - changeVideoSize:videoHeight:
 Change the timeline video resolution.
Remark:If timeline is linked to a surfaceTexture, the surfaceTexture must be detached first, and then timeline video resolution can be changed. After timeline resolution is changed, the SurfaceTexture can be re-attached to timeline. More...
 
(BOOL) - changeVideoBitDepth:
 Change the timeline video bit depth. More...
 
(void) - setCaptionBoundingRectInActualMode:
 Set the border of the caption to the actual envelope size of the text. More...
 
(void) - enableRenderOrderByZValue:
 Turn on use the Z value as the render order. Note: there are timeline caption, compound caption, module captions, animation stickers and timeline filters If the Z value in the same type is the same, it is the same as the sorting method in which the property is not enabled If the Z values of different types are the same, the order is: timeline Filter > Animation sticker > timeline caption (including module caption) > compound caption. More...
 
(BOOL) - isRenderOrderByZValueEnabled
 Whether to turn on use Z value as the rendering order. More...
 
(NvsTimelineCaption *) - getFirstCaption
 Get the first caption on the timeline. More...
 
(NvsTimelineCaption *) - getLastCaption
 Get the last caption on the timeline. More...
 
(NvsTimelineCaption *) - getPrevCaption:
 Get the previous caption of the current caption on the timeline. More...
 
(NvsTimelineCaption *) - getNextCaption:
 Get the next caption of the current caption on the timeline. More...
 
(NSArray *) - getCaptionsByTimelinePosition:
 Get a list of captions based on the position on the timeline. More...
 
(NvsTimelineCaption *) - addCaption:inPoint:duration:captionStylePackageId:
 Add a caption on the timeline. More...
 
(NvsTimelineCaption *) - addPanoramicCaption:inPoint:duration:captionStylePackageId:
 Add a panorama caption on the timeline. More...
 
(NvsTimelineCaption *) - addModularCaption:inPoint:duration:
 Add a modular caption on the timeline. More...
 
(NvsTimelineCaption *) - removeCaption:
 Remove the caption on the timeline. More...
 
(NvsTimelineCompoundCaption *) - getFirstCompoundCaption
 Get the first compound caption on the timeline. More...
 
(NvsTimelineCompoundCaption *) - getLastCompoundCaption
 Get the last compound caption on the timeline. More...
 
(NvsTimelineCompoundCaption *) - getPrevCompoundCaption:
 Get the previous compound caption of the current compound caption on the timeline. More...
 
(NvsTimelineCompoundCaption *) - getNextCompoundCaption:
 Get the next compound caption of the current compound caption on the timeline. More...
 
(NSArray< NvsTimelineCompoundCaption * > *) - getCompoundCaptionsByTimelinePosition:
 Get a list of compound captions based on the position on the timeline. More...
 
(NvsTimelineCompoundCaption *) - addCompoundCaption:duration:compoundCaptionPackageId:
 Add a caption on the timeline. More...
 
(NvsTimelineCompoundCaption *) - addPanoramicCompoundCaption:duration:compoundCaptionPackageId:
 Add a VR caption on the timeline. More...
 
(NvsTimelineCompoundCaption *) - removeCompoundCaption:
 Remove compound caption from the timeline. More...
 
(NvsTimelineAnimatedSticker *) - getFirstAnimatedSticker
 Get the first animated sticker on the timeline. More...
 
(NvsTimelineAnimatedSticker *) - getLastAnimatedSticker
 Get the last animated sticker on the timeline. More...
 
(NvsTimelineAnimatedSticker *) - getPrevAnimatedSticker:
 Get the previous animated sticker of the current animated sticker of the timeline. More...
 
(NvsTimelineAnimatedSticker *) - getNextAnimatedSticker:
 Get the next animated sticker of the current animated sticker of the timeline. More...
 
(NSArray *) - getAnimatedStickersByTimelinePosition:
 Get an animated sticker list based on the position on the timeline. More...
 
(NvsTimelineAnimatedSticker *) - addAnimatedSticker:duration:animatedStickerPackageId:
 Add a animated sticker on the timeline. More...
 
(NvsTimelineAnimatedSticker *) - addPanoramicAnimatedSticker:duration:animatedStickerPackageId:
 Add a panorama animation sticker on the timeline. More...
 
(NvsTimelineAnimatedSticker *) - addCustomAnimatedSticker:duration:animatedStickerPackageId:customImagePath:
 Add a custom animated sticker on the timeline. More...
 
(NvsTimelineAnimatedSticker *) - addCustomPanoramicAnimatedSticker:duration:animatedStickerPackageId:customImagePath:
 Add a a custom panorama animated sticker on the timeline. More...
 
(NvsTimelineAnimatedSticker *) - removeAnimatedSticker:
 Remove an animated sticker on the timeline. More...
 
(NvsTimelineVideoFx *) - getFirstTimelineVideoFx
 Get the first timeline video effect on the timeline. More...
 
(NvsTimelineVideoFx *) - getLastTimelineVideoFx
 Get the last timeline video effect on the timeline. More...
 
(NvsTimelineVideoFx *) - getPrevTimelineVideoFx:
 Get the previous timeline video effect of a timeline video effect on the timeline. More...
 
(NvsTimelineVideoFx *) - getNextTimelineVideoFx:
 Get the next timeline video effect of a timeline video effect on the timeline. More...
 
(NSArray *) - getTimelineVideoFxByTimelinePosition:
 Get a list of timeline video effects based on position on the timeline. More...
 
(NvsTimelineVideoFx *) - addBuiltinTimelineVideoFx:duration:videoFxName:
 Add a built-in timeline video effect on the timeline. More...
 
(NvsTimelineVideoFx *) - addPackagedTimelineVideoFx:duration:videoFxPackageId:
 Add a timeline video effect in the form of a resource package on the timeline. More...
 
(NvsTimelineVideoFx *) - addCustomTimelineVideoFx:duration:customVideoFxRender:
 Add a custom timeline video effect on the timeline. More...
 
(NvsTimelineVideoFx *) - removeTimelineVideoFx:
 Remove a timeline video effect from the timeline. More...
 
(NSString *) - getCurrentThemeId
 Get the id of the current theme. More...
 
(BOOL) - applyTheme:
 Apply a theme to the current timeline (the theme is relative to the entire timeline). More...
 
(void) - removeCurrentTheme
 Remove current theme. More...
 
(void) - setThemeTitleCaptionText:
 Set the caption text for theme title. More...
 
(void) - setThemeTrailerCaptionText:
 Set the caption text for theme trailer. More...
 
(void) - setThemeMusicVolumeGain:rightVolumeGain:
 Set the volume value for theme music. More...
 
(void) - getThemeMusicVolumeGain:rightVolumeGain:
 Get the volume value for theme music. More...
 
(bool) - addWatermark:displayWidth:displayHeight:opacity:position:marginX:marginY:
 Add watermark. More...
 
(void) - deleteWatermark
 Delete watermark which has added. More...
 
(bool) - setWatermarkOpacity:
 Set watermark opacity. More...
 
(bool) - setTimelineEndingLogo:displayWidth:displayHeight:centerX:centerY:
 Set the logo effect at the end of the timeline.The duration is one second. More...
 
(void) - removeTimelineEndingLogo
 Remove the logo effect at the end of the timeline. More...
 
(void) - setPlaybackRateControl:
 
(NSArray *) - getPlaybackRateControl
 
(BOOL) - moveVideoTrackIndex:dstTrackIndex:
 Move video track.After moving, all video tracks will reset their index from 0. More...
 
(NvsTimelineGraphCompositor *) - getFirstTimelineGraphCompositor
 Get the first timeline GraphCompositor on the timeline. More...
 
(NvsTimelineGraphCompositor *) - getLastTimelineGraphCompositor
 Get the last timeline GraphCompositor on the timeline. More...
 
(NvsTimelineGraphCompositor *) - getPrevTimelineGraphCompositor:
 Get the previous timeline GraphCompositor of a timeline GraphCompositor on the timeline. More...
 
(NvsTimelineGraphCompositor *) - getNextTimelineGraphCompositor:
 Get the next timeline GraphCompositor of a timeline GraphCompositor on the timeline. More...
 
(NvsTimelineGraphCompositor *) - getTimelineGraphCompositorByTimelinePosition:
 Get a timeline GraphCompositor based on position on the timeline. More...
 
(NvsTimelineGraphCompositor *) - addTimelineGraphCompositor:duration:graphDescStr:
 Add a timeline GraphCompositor on the timeline. More...
 
(NvsTimelineGraphCompositor *) - addTimelineGraphCompositor:duration:graphDescStr:buddyTrackIndex:
 Add a timeline GraphCompositor on the timeline. More...
 
(NvsTimelineGraphCompositor *) - removeTimelineGraphCompositor:
 Remove a timeline GraphCompositor from the timeline. More...
 
(unsigned int) - creationFlags
 Get count of video track. More...
 
(bool) - applyThemeTemplate:
 
(NSArray< NvsCaptionBoundingVerticesInfo * > *) - getCaptionsBoundingVerticesRecursively:timelinePosition:
 
(NSArray< NvsClipBoundingVerticesInfo * > *) - getVideoClipBoundingVerticesRecursively:
 
- 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

NvsVideoResolution videoRes
 Video resolution (width:height ratio of video image). More...
 
NvsAudioResolution audioRes
 Audio resolution (sampling rate, format and channel count) More...
 
NvsRational videoFps
 Video frame rate. More...
 
int64_t duration
 Timeline duration(in micro-second). More...
 
int64_t audioFadeOutDuration
 Audio fade out duration(in micro-second). More...
 

Detailed Description

Timeline is which the entity of editing the scene.

The timeline consists of tracks and can be thought of as a collection of audio and video tracks. The timeline can add or remove multiple video and audio tracks, and the multiple tracks are superimposed and combined. When editing video,users can add captions. themes, animated stickers to make final beautifull videos.Otherwise,User needs to install asset package (theme package, animated stick package, Caption style and timeline effect package) before loading and using them. Each package comes with its unique package ID.For built-in timeline effects, they can be applied only with obtaining their effect name.

Warning
: for NvsTimeline class,all public APIs should be implemented in a UI thread!!!

Method Documentation

◆ addAnimatedSticker:duration:animatedStickerPackageId:

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

Add a animated sticker on the timeline.

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

◆ addBuiltinTimelineVideoFx:duration:videoFxName:

- (NvsTimelineVideoFx *) addBuiltinTimelineVideoFx: (int64_t)  inPoint
duration: (int64_t)  duration
videoFxName: (NSString *)  videoFxName 

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

Parameters
inPointThe in point of the timeline video effect on the timeline (in microseconds)
durationDuration of the timeline video effect which displayed (in microseconds)
videoFxNameThe video effect name
Returns
Return the NvsTimelineVideoFx object
It will return nil in the following situations:
1. videoFxName is empty or nil;
2. videoFxName is not built in fx;
3. If inPoint is less than 0 or greater than or equal to the current timeline duration, or duration is not greater than 0.

◆ addCaption:inPoint:duration:captionStylePackageId:

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

Add a caption on the timeline.

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

◆ addCompoundCaption:duration:compoundCaptionPackageId:

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

Add a caption on the timeline.

Parameters
captionTextText of caption
inPointThe in point of the caption on the timeline (in microseconds)
durationCaption display duration (in microseconds)
captionStylePackageIdCaption style package Id.If it does not exist, you can pass an empty string or nil.
Returns
Returns the NvsTimelineCaption object
It will return nil 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 timeline duration, or duration is not greater than 0.
Since
2.9.0
See also
removeCaption

◆ addCustomAnimatedSticker:duration:animatedStickerPackageId:customImagePath:

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

Add a custom animated sticker on the timeline.

Parameters
inPointThe in point of custom animated sticker on the timeline (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 NvsTimelineAnimatedSticker object.
It will return nil in the following situations:
1. No animated sticker function authorization;
2. The animatedStickerPackageId is empty or nil;
3. The animatedSticker has not install successed;
4. If inPoint is less than 0 or greater than or equal to the current timeline duration, or duration is not greater than 0.
Note: If the return value is not nil, you still cannot see the sticker effect, you need to check whether the customImagePath actually exists.
See also
- removeAnimatedSticker:

◆ addCustomPanoramicAnimatedSticker:duration:animatedStickerPackageId:customImagePath:

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

Add a a custom panorama animated sticker on the timeline.

Parameters
inPointThe in point of custom animated sticker on the timeline (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 NvsTimelineAnimatedSticker object.
It will return nil in the following situations:
1. No animated sticker function authorization or no panoramic function authorization;
2. The animatedStickerPackageId is empty or nil;
3. The animatedSticker has not install successed;
4. If inPoint is less than 0 or greater than or equal to the current timeline duration, or duration is not greater than 0.
Note: If the return value is not nil, you still cannot see the sticker effect, you need to check whether the customImagePath actually exists.
Since
1.6.0
See also
removeAnimatedSticker

◆ addCustomTimelineVideoFx:duration:customVideoFxRender:

- (NvsTimelineVideoFx *) addCustomTimelineVideoFx: (int64_t)  inPoint
duration: (int64_t)  duration
customVideoFxRender: (id< NvsCustomVideoFxRenderer >)  customVideoFxRender 

Add a custom timeline video effect on the timeline.

Parameters
inPointThe in point of the timeline video effect on the timeline (in microseconds)
durationDuration of the timeline video effect which displayed (in microseconds)
customVideoFxRenderUser-implemented custom video effects renderer interface
Returns
Return the NvsTimelineVideoFx object
It will return nil in the following situations:
1. No video effect function authorization;
2.customVideoFxRender is nil;
3. If inPoint is less than 0 or greater than or equal to the current timeline duration, or duration is not greater than 0.
Since
1.7.0

◆ addModularCaption:inPoint:duration:

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

Add a modular caption on the timeline.

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

◆ addPackagedTimelineVideoFx:duration:videoFxPackageId:

- (NvsTimelineVideoFx *) addPackagedTimelineVideoFx: (int64_t)  inPoint
duration: (int64_t)  duration
videoFxPackageId: (NSString *)  videoFxPackageId 

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

Parameters
inPointThe in point of the timeline video effect on the timeline (in microseconds)
durationDuration of the timeline video effect which displayed (in microseconds)
videoFxPackageIdThe Id of resource package
Returns
Return the NvsTimelineVideoFx object
It will return nil in the following situations:
1. No timeline video effect function authorization, if this is particle effect, may have no particle effect function authorization;
2. The videoFxPackageId is empty or nil;
3. The videoFxPackage has not install successed;
4. If inPoint is less than 0 or greater than or equal to the current timeline duration, or duration is not greater than 0.

◆ addPanoramicAnimatedSticker:duration:animatedStickerPackageId:

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

Add a panorama animation sticker on the timeline.

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

◆ addPanoramicCaption:inPoint:duration:captionStylePackageId:

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

Add a panorama caption on the timeline.

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

◆ addPanoramicCompoundCaption:duration:compoundCaptionPackageId:

- (NvsTimelineCompoundCaption *) addPanoramicCompoundCaption: (int64_t)  inPoint
duration: (int64_t)  duration
compoundCaptionPackageId: (NSString *)  compoundCaptionPackageId 

Add a VR caption on the timeline.

Parameters
captionTextText of caption
inPointThe in point of the caption on the timeline (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 NvsTimelineCaption 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 timeline duration, or duration is not greater than 0.
Since
3.7.0
See also
removeCompoundCaption

◆ addTimelineGraphCompositor:duration:graphDescStr:

- (NvsTimelineGraphCompositor *) addTimelineGraphCompositor: (int64_t)  inPoint
duration: (int64_t)  duration
graphDescStr: (NSString *)  graphDescStr 

Add a timeline GraphCompositor on the timeline.

Parameters
inPointThe in point of the timeline GraphCompositor on the timeline (in microseconds)
durationDuration of the timeline GraphCompositor which displayed (in microseconds)
graphDescStrThe string parameter value of the effect
Returns
Return the NvsTimelineGraphCompositor object
Since
3.3.0

◆ addTimelineGraphCompositor:duration:graphDescStr:buddyTrackIndex:

- (NvsTimelineGraphCompositor *) addTimelineGraphCompositor: (int64_t)  inPoint
duration: (int64_t)  duration
graphDescStr: (NSString *)  graphDescStr
buddyTrackIndex: (int)  buddyTrackIndex 

Add a timeline GraphCompositor on the timeline.

Parameters
inPointThe in point of the timeline GraphCompositor on the timeline (in microseconds)
durationDuration of the timeline GraphCompositor which displayed (in microseconds)
graphDescStrThe string parameter value of the effect
buddyTrackIndexThe buddy frame track index
Returns
Return the NvsTimelineGraphCompositor object
Since
3.3.1

◆ addWatermark:displayWidth:displayHeight:opacity:position:marginX:marginY:

- (bool) addWatermark: (NSString *)  watermarkFilePath
displayWidth: (int)  displayWidth
displayHeight: (int)  displayHeight
opacity: (float)  opacity
position: (int)  position
marginX: (int)  marginX
marginY: (int)  marginY 

Add watermark.

Parameters
watermarkFilePathThe path of the watermark file must be a .PNG or .JPG or .CAF file.
displayWidthThe width of the watermark displayed in the timeline. If 0, the width of the image file is used.
displayHeightThe height of the watermark displayed in the timeline. If 0, the height of the image file is used.
opacityWatermark opacity, the range is [0,1]
positionThe position of the watermark, please refer to NvsTimelineWatermarkPosition
marginXThe margin of the watermark in the horizontal direction
marginYThe margin of the watermark in the vertical direction
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
- deleteWatermark:
- setWatermarkOpacity:

◆ appendAudioTrack

- (NvsAudioTrack *) appendAudioTrack

Appends audio track.

Returns
returns the appended NvsAudioTrack object.. When adding more than one audio track, nil may be returned due to multi-musictrack authorization.
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
- removeAudioTrack:
- audioTrackCount
- getAudioTrackByIndex:

◆ appendVideoTrack

- (NvsVideoTrack *) appendVideoTrack

Appends video track.

Returns
returns the appended NvsVideoTrack object.. When adding more than one video track, nil may be returned due to multi-videotrack authorization.
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
- removeVideoTrack:
- videoTrackCount
- getVideoTrackByIndex:

◆ applyTheme:

- (BOOL) applyTheme: (NSString *)  themeId

Apply a theme to the current timeline (the theme is relative to the entire timeline).

For themes, there may be a title or a trailer, or both of them, or none. When applying a theme with a title or a trailer or both of them are treated as a clip, resulting in an increase in the count of clips. When using this interface, be careful to determine the count of clips.

Parameters
themeIdId of theme package(if themeId if empty string or nil, will remove current theme)
Returns
Determine if the theme is applied successfully. If YES is returned, the theme is used successfully, and NO means the oppsite.
It will return NO in the following situations:
1.No theme function authorization;
2.The theme package install failed;
3.No video track on timeline.
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
- getCurrentThemeId
- removeCurrentTheme

◆ applyThemeTemplate:

- (bool) applyThemeTemplate: (NSString *)  templateId
Parameters

◆ audioTrackCount

- (unsigned int) audioTrackCount

Get count of audio track.

Returns
returns count of audio track.
See also
- appendAudioTrack
- removeAudioTrack:

◆ changeVideoBitDepth:

- (BOOL) changeVideoBitDepth: (NvsVideoResolutionBitDepth newBitDepth

Change the timeline video bit depth.

Parameters
newBitDepthNew video bit depth
Returns
Reurns YES means it changes successfully, NO means it fails.If the autheneticator is not support HDR editing, return false.
Since
2.23.0

◆ changeVideoSize:videoHeight:

- (BOOL) changeVideoSize: (int)  videoWidth
videoHeight: (int)  videoHeight 

Change the timeline video resolution.
Remark:If timeline is linked to a surfaceTexture, the surfaceTexture must be detached first, and then timeline video resolution can be changed. After timeline resolution is changed, the SurfaceTexture can be re-attached to timeline.

Parameters
videoWidthNew video width(the imported image's width has to be a multiple of 4)
videoHeightNew video height(the imported image's height has to be a multiple of 2)
Returns
Reurns YES means it changes successfully, NO means it fails.If the passed width or height is less than 0 or the width is not a multiple of 4 and the height is not a multiple of 2, return false.
Since
2.5.0

◆ creationFlags

- (unsigned int) creationFlags

Get count of video track.

Returns
returns count of video track.
Since
3.4.2

◆ deleteWatermark

- (void) deleteWatermark

Delete watermark which has added.

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
- addWatermark:displayWidth:displayHeight:opacity:position:marginX:marginY:
- setWatermarkOpacity:

◆ enableRenderOrderByZValue:

- (void) enableRenderOrderByZValue: (BOOL)  enable

Turn on use the Z value as the render order. Note: there are timeline caption, compound caption, module captions, animation stickers and timeline filters If the Z value in the same type is the same, it is the same as the sorting method in which the property is not enabled If the Z values of different types are the same, the order is: timeline Filter > Animation sticker > timeline caption (including module caption) > compound caption.

Parameters
enableEnable or not
Since
2.17.0

◆ getAnimatedStickersByTimelinePosition:

- (NSArray *) getAnimatedStickersByTimelinePosition: (int64_t)  timelinePos

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

Parameters
timelinePosPosition on the timeline (in microseconds)
Returns
Returns an array 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:duration:animatedStickerPackageId:

◆ getAudioTrackByIndex:

- (NvsAudioTrack *) getAudioTrackByIndex: (unsigned int)  trackIndex

Gets audio track with track index.

Parameters
trackIndexIndex of audio track
Returns
returns the NvsAudioTrack object.If trackIndex is less than 0 or greater than or equal to the current track number, return nil.
See also
- appendAudioTrack
- audioTrackCount
- removeAudioTrack:

◆ getCaptionsBoundingVerticesRecursively:timelinePosition:

- (NSArray<NvsCaptionBoundingVerticesInfo*>*) getCaptionsBoundingVerticesRecursively: (NvsBoundingType boundingType
timelinePosition: (int64_t)  timelinePosition 
Parameters

◆ getCaptionsByTimelinePosition:

- (NSArray *) getCaptionsByTimelinePosition: (int64_t)  timelinePos

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

Parameters
timelinePosThe position on the timeline(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:inPoint:duration:captionStylePackageId:

◆ getCompoundCaptionsByTimelinePosition:

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

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

Parameters
timelinePosThe position on the timeline(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

◆ getCreationFlags

- (int) getCreationFlags

Get the flag for creating timeline. NvsCreateTimelineTypeFlag.

Returns
returns flags.

◆ getCurrentThemeId

- (NSString *) getCurrentThemeId

Get the id of the current theme.

Returns
Current theme id, if no theme,returns nil.
See also
- applyTheme:
- removeCurrentTheme

◆ getFirstAnimatedSticker

- (NvsTimelineAnimatedSticker *) getFirstAnimatedSticker

Get the first animated sticker on the timeline.

Returns
Return the acquired NvsTimelineAnimatedSticker object.
See also
- getLastAnimatedSticker
- addAnimatedSticker:duration:animatedStickerPackageId:

◆ getFirstCaption

- (NvsTimelineCaption *) getFirstCaption

Get the first caption on the timeline.

Returns
Returns the NvsTimelineCaption object.
See also
- getLastCaption
- addCaption:inPoint:duration:captionStylePackageId:

◆ getFirstCompoundCaption

- (NvsTimelineCompoundCaption *) getFirstCompoundCaption

Get the first compound caption on the timeline.

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

◆ getFirstTimelineGraphCompositor

- (NvsTimelineGraphCompositor *) getFirstTimelineGraphCompositor

Get the first timeline GraphCompositor on the timeline.

Returns
Returns the acquired NvsTimelineGraphCompositor object.
Since
3.3.0

◆ getFirstTimelineVideoFx

- (NvsTimelineVideoFx *) getFirstTimelineVideoFx

Get the first timeline video effect on the timeline.

Returns
Returns the acquired NvsTimelineVideoFx object.

◆ getLastAnimatedSticker

- (NvsTimelineAnimatedSticker *) getLastAnimatedSticker

Get the last animated sticker on the timeline.

Returns
Return the acquired NvsTimelineAnimatedSticker object.
See also
- getFirstAnimatedSticker

◆ getLastCaption

- (NvsTimelineCaption *) getLastCaption

Get the last caption on the timeline.

Returns
Returns the NvsTimelineCaption object.
See also
- getFirstCaption
- addCaption:inPoint:duration:captionStylePackageId:

◆ getLastCompoundCaption

- (NvsTimelineCompoundCaption *) getLastCompoundCaption

Get the last compound caption on the timeline.

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

◆ getLastTimelineGraphCompositor

- (NvsTimelineGraphCompositor *) getLastTimelineGraphCompositor

Get the last timeline GraphCompositor on the timeline.

Returns
Returns the acquired NvsTimelineGraphCompositor object.
Since
3.3.0

◆ getLastTimelineVideoFx

- (NvsTimelineVideoFx *) getLastTimelineVideoFx

Get the last timeline video effect on the timeline.

Returns
Returns the acquired NvsTimelineVideoFx object.

◆ getNextAnimatedSticker:

- (NvsTimelineAnimatedSticker *) getNextAnimatedSticker: (NvsTimelineAnimatedSticker *)  animatedSticker

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

Parameters
animatedStickerthe current NvsTimelineAnimatedSticker obejct
Returns
Return the acquired NvsTimelineAnimatedSticker object.
See also
- getPrevAnimatedSticker:

◆ getNextCaption:

- (NvsTimelineCaption *) getNextCaption: (NvsTimelineCaption *)  caption

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

Parameters
captionThe current caption on the timeline
Returns
Returns the NvsTimelineCaption object.
See also
- getPrevCaption:

◆ getNextCompoundCaption:

- (NvsTimelineCompoundCaption *) getNextCompoundCaption: (NvsTimelineCompoundCaption *)  caption

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

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

◆ getNextTimelineGraphCompositor:

- (NvsTimelineGraphCompositor *) getNextTimelineGraphCompositor: (NvsTimelineGraphCompositor *)  graphCompositor

Get the next timeline GraphCompositor of a timeline GraphCompositor on the timeline.

Parameters
graphCompositorThe NvsTimelineGraphCompositor object
Returns
Returns the acquired NvsTimelineGraphCompositor object.
Since
3.3.0

◆ getNextTimelineVideoFx:

- (NvsTimelineVideoFx *) getNextTimelineVideoFx: (NvsTimelineVideoFx *)  videoFx

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

Parameters
videoFxThe NvsTimelineVideoFx object
Returns
Returns the acquired NvsTimelineVideoFx object.

◆ getPlaybackRateControl

- (NSArray *) getPlaybackRateControl

◆ getPrevAnimatedSticker:

- (NvsTimelineAnimatedSticker *) getPrevAnimatedSticker: (NvsTimelineAnimatedSticker *)  animatedSticker

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

Parameters
animatedStickerthe current NvsTimelineAnimatedSticker obejct
Returns
Return the acquired NvsTimelineAnimatedSticker object.
See also
- getNextAnimatedSticker:

◆ getPrevCaption:

- (NvsTimelineCaption *) getPrevCaption: (NvsTimelineCaption *)  caption

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

Parameters
captionThe current caption on the timeline
Returns
Returns the NvsTimelineCaption object.
See also
- getNextCaption:

◆ getPrevCompoundCaption:

- (NvsTimelineCompoundCaption *) getPrevCompoundCaption: (NvsTimelineCompoundCaption *)  caption

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

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

◆ getPrevTimelineGraphCompositor:

- (NvsTimelineGraphCompositor *) getPrevTimelineGraphCompositor: (NvsTimelineGraphCompositor *)  graphCompositor

Get the previous timeline GraphCompositor of a timeline GraphCompositor on the timeline.

Parameters
graphCompositorThe NvsTimelineGraphCompositor object
Returns
Returns the acquired NvsTimelineGraphCompositor object.
Since
3.3.0

◆ getPrevTimelineVideoFx:

- (NvsTimelineVideoFx *) getPrevTimelineVideoFx: (NvsTimelineVideoFx *)  videoFx

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

Parameters
videoFxThe NvsTimelineVideoFx object
Returns
Returns the acquired NvsTimelineVideoFx object.

◆ getThemeMusicVolumeGain:rightVolumeGain:

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

Get the volume value for theme music.

Parameters
leftVolumeGainOutput the value of left channel
rightVolumeGainOutput the value of right channel
See also
- getThemeMusicVolumeGain:rightVolumeGain:

◆ getTimelineGraphCompositorByTimelinePosition:

- (NvsTimelineGraphCompositor *) getTimelineGraphCompositorByTimelinePosition: (int64_t)  timelinePos

Get a timeline GraphCompositor based on position on the timeline.

Parameters
timelinePosThe position on the timeline (in microseconds)
Returns
Returns the timeline GraphCompositor in current position.
Since
3.3.0

◆ getTimelineVideoFxByTimelinePosition:

- (NSArray *) getTimelineVideoFxByTimelinePosition: (int64_t)  timelinePos

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

Parameters
timelinePosThe position on the timeline (in microseconds)
Returns
Returns an array of timeline video effects in current position.
The ordering rules for the acquired timeline 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.

◆ getVideoClipBoundingVerticesRecursively:

- (NSArray<NvsClipBoundingVerticesInfo*>*) getVideoClipBoundingVerticesRecursively: (int64_t)  timelinePosition
Parameters

◆ getVideoTrackByIndex:

- (NvsVideoTrack *) getVideoTrackByIndex: (unsigned int)  trackIndex

Gets video track with track index.

Parameters
trackIndexIndex of video track
Returns
returns the NvsVideoTrack object.If trackIndex is less than 0 or greater than or equal to the current track number, return nil.
See also
- appendVideoTrack
- videoTrackCount
- removeVideoTrack:

◆ insertAudioTrack:

- (NvsAudioTrack *) insertAudioTrack: (unsigned int)  clipIndex

Appends audio track.

Parameters
trackIndexIndex of the inserted track.If you pass in an index less than 0 or more than current audio track count, it will be inserted at the end of the current audio track number.
Returns
returns the appended NvsAudioTrack object.When adding more than one audio track, nil may be returned due to multi-musictrack authorization.
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
removeAudioTrack
- audioTrackCount
getAudioTrackByIndex

◆ insertVideoTrack:

- (NvsVideoTrack *) insertVideoTrack: (unsigned int)  clipIndex

insert video track.

Parameters
trackIndexIndex of the inserted track.If you pass in an index less than 0 or more than current video track count, it will be inserted at the end of the current video track number.
Returns
returns the insert NvsVideoTrack object. When adding more than one video track, nil may be returned due to multi-videotrack authorization.
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
removeVideoTrack
- videoTrackCount
getVideoTrackByIndex

◆ isRenderOrderByZValueEnabled

- (BOOL) isRenderOrderByZValueEnabled

Whether to turn on use Z value as the rendering order.

Returns
Returns True means has turn on, otherwise not
Since
2.17.0

◆ moveVideoTrackIndex:dstTrackIndex:

- (BOOL) moveVideoTrackIndex: (unsigned int)  srcTrackIndex
dstTrackIndex: (unsigned int)  dstTrackIndex 

Move video track.After moving, all video tracks will reset their index from 0.

Parameters
srcTrackIndexIndex of source video track
dstTrackIndexIndex of destination video track
Returns
Returns a boolean value.YES means it moves successfully, NO means it fails.If srcTrackIndex and dstTrackIndex is less than 0 or greater than or equal to the current track number, return NO.
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.

◆ removeAnimatedSticker:

- (NvsTimelineAnimatedSticker *) removeAnimatedSticker: (NvsTimelineAnimatedSticker *)  animatedSticker

Remove an animated sticker on the timeline.

Parameters
animatedStickerThe NvsTimelineAnimatedSticker object which will be removed
Returns
Return the next NvsTimelineAnimatedSticker object.
See also
- addAnimatedSticker:duration:animatedStickerPackageId:

◆ removeAudioTrack:

- (BOOL) removeAudioTrack: (unsigned int)  trackIndex

Remove audio track.

Parameters
trackIndexIndex of audio track
Returns
Returns a BOOL value.YES means it removes successfully, NO means it fails.If trackIndex is less than 0 or greater than or equal to the current track number, return NO.
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
- appendAudioTrack
- audioTrackCount
- getAudioTrackByIndex:

◆ removeCaption:

- (NvsTimelineCaption *) removeCaption: (NvsTimelineCaption *)  caption

Remove the caption on the timeline.

Parameters
captiontimeline caption object which removed
Returns
Returns the next NvsTimelineCaption object.
See also
- addCaption:inPoint:duration:captionStylePackageId:

◆ removeCompoundCaption:

- (NvsTimelineCompoundCaption *) removeCompoundCaption: (NvsTimelineCompoundCaption *)  caption

Remove compound caption from the timeline.

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

◆ removeCurrentTheme

- (void) removeCurrentTheme

Remove current theme.

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
- applyTheme:
- getCurrentThemeId

◆ removeTimelineEndingLogo

- (void) removeTimelineEndingLogo

Remove the logo effect at the end of the timeline.

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
- setTimelineEndingLogo:displayWidth:displayHeight:centerX:centerY:

◆ removeTimelineGraphCompositor:

- (NvsTimelineGraphCompositor *) removeTimelineGraphCompositor: (NvsTimelineGraphCompositor *)  graphCompositor

Remove a timeline GraphCompositor from the timeline.

Parameters
graphCompositorThe NvsTimelineGraphCompositor object which will be removed
Returns
Returns the next NvsTimelineGraphCompositor object.
Since
3.3.0

◆ removeTimelineVideoFx:

- (NvsTimelineVideoFx *) removeTimelineVideoFx: (NvsTimelineVideoFx *)  videoFx

Remove a timeline video effect from the timeline.

Parameters
videoFxThe NvsTimelineVideoFx object which will be removed
Returns
Returns the next NvsTimelineVideoFx object of current timeline video effect which has removed.

◆ removeVideoTrack:

- (BOOL) removeVideoTrack: (unsigned int)  trackIndex

Remove video track.

Parameters
trackIndexIndex of video track
Returns
Returns a BOOL value.YES means it removes successfully, NO means it fails.If trackIndex is less than 0 or greater than or equal to the current track number, return NO.
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
- appendVideoTrack
- videoTrackCount
- getVideoTrackByIndex:

◆ setCaptionBoundingRectInActualMode:

- (void) setCaptionBoundingRectInActualMode: (BOOL)  isActualBoundingRect

Set the border of the caption to the actual envelope size of the text.

Parameters
isActualBoundingRectWhether to display the actual envelope size
Since
2.5.0

◆ setPlaybackRateControl:

- (void) setPlaybackRateControl: (NSArray *)  arrayPlaybackRateControlRegion

◆ setThemeMusicVolumeGain:rightVolumeGain:

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

Set the volume value for theme music.

Parameters
leftVolumeGainLeft channel, value range [0, 8). The suggestion is [0, 3], if it exceeds 3, the sound may break.
rightVolumeGainRight channel, value range [0, 8). The suggestion is [0, 3], if it exceeds 3, the sound may break.
See also
- getThemeMusicVolumeGain:rightVolumeGain:

◆ setThemeTitleCaptionText:

- (void) setThemeTitleCaptionText: (NSString *)  text

Set the caption text for theme title.

Parameters
textThe caption text
See also
- setThemeTrailerCaptionText:
- applyTheme:

◆ setThemeTrailerCaptionText:

- (void) setThemeTrailerCaptionText: (NSString *)  text

Set the caption text for theme trailer.

Parameters
text字幕文本
See also
- setThemeTitleCaptionText:
- applyTheme:

◆ setTimelineEndingLogo:displayWidth:displayHeight:centerX:centerY:

- (bool) setTimelineEndingLogo: (NSString *)  logoFilePath
displayWidth: (unsigned int)  displayWidth
displayHeight: (unsigned int)  displayHeight
centerX: (int)  centerX
centerY: (int)  centerY 

Set the logo effect at the end of the timeline.The duration is one second.

Parameters
logoFilePathThe path of the logo file must be a .PNG or .JPG or .CAF file.
displayWidthThe width of the logo displayed in the timeline. If 0, the width of the image file is used.
displayHeightThe height of the logo displayed in the timeline. If 0, the height of the image file is used.
centerXlogo中心点在X方向的位置
centerYlogo中心点在Y方向的位置
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
- removeTimelineEndingLogo:

◆ setWatermarkOpacity:

- (bool) setWatermarkOpacity: (float)  opacity

Set watermark opacity.

Parameters
opacityThe opacity, the range is [0,1]
See also
addWatermark:
- deleteWatermark:

◆ videoTrackCount

- (unsigned int) videoTrackCount

Get count of video track.

Returns
returns count of video track.
See also
- appendVideoTrack
- removeVideoTrack:

Property Documentation

◆ audioFadeOutDuration

- (int64_t) audioFadeOutDuration
readwritenonatomicassign

Audio fade out duration(in micro-second).

◆ audioRes

- (NvsAudioResolution) audioRes
readatomicassign

Audio resolution (sampling rate, format and channel count)

◆ duration

- (int64_t) duration
readatomicassign

Timeline duration(in micro-second).

◆ videoFps

- (NvsRational) videoFps
readatomicassign

Video frame rate.

◆ videoRes

- (NvsVideoResolution) videoRes
readatomicassign

Video resolution (width:height ratio of video image).


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