MeiCam SDK For Web
3.12.1
|
Timeline class: edit the timeline entity of the scene. The timeline is composed of tracks and can be regarded as a collection of a series of audio and video tracks. Multiple video tracks and audio tracks can be added or removed on the timeline. Multiple tracks are superimposed and synthesized with each other. When editing a video, you can also add timeline subtitles, themes and corresponding animation stickers as needed to make a beautiful video. In addition, the added material resource package (theme package, animation sticker package, subtitle style package, timeline special effect package, etc.) must be installed first. After successful installation, the packageid can be used, while the built-in timeline special effect (builtin) only needs to obtain the special effect name. More...
Public Member Functions | |
constructor () | |
getVideoRes () | |
Gets video's resolution (image's width, height and aspect ratio). More... | |
getAudioRes () | |
Gets audio's resolution (sampling rate, sampling format and number of channels). More... | |
getDuration () | |
Gets timeline's duration. More... | |
appendVideoTrack () | |
Appends video track. More... | |
appendAudioTrack () | |
Appends audio track. More... | |
insertVideoTrack (insertPoint) | |
Insert video track. More... | |
insertAudioTrack (insertPoint) | |
Appends audio track. More... | |
removeVideoTrack (trackIndex) | |
remove video track More... | |
removeAudioTrack (trackIndex) | |
remove Remove audio track. More... | |
videoTrackCount () | |
Get count of video track. More... | |
audioTrackCount () | |
Get count of audio track. More... | |
getVideoTrackByIndex (trackIndex) | |
Gets video track with track index. More... | |
getAudioTrackByIndex (trackIndex) | |
get audio track according to index More... | |
changeVideoSize (videoWidth, 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... | |
changeVideoSize2 (videoWidth, videoHeight) | |
Change video size. More... | |
getFirstCaption () | |
Get the first caption on the timeline. More... | |
getLastCaption () | |
Get the last caption on the timeline. More... | |
getPrevCaption (caption) | |
Get the previous caption of the current caption on the timeline. More... | |
getNextCaption (caption) | |
Get the next caption of the current caption on the timeline. More... | |
getCaptionsByTimelinePosition (timelinePos) | |
Get a list of captions based on the position on the timeline. More... | |
addCaption (captionText, inPoint, duration, captionStylePackageId, isPanoramic) | |
Add a caption on the timeline. More... | |
addModularCaption (captionText, inPoint, duration) | |
add modular caption More... | |
removeCaption (caption) | |
Remove the caption on the timeline. More... | |
getFirstCompoundCaption () | |
Get the first compound caption on the timeline. More... | |
getLastCompoundCaption () | |
Get the last compound caption on the timeline. More... | |
getPrevCompoundCaption (caption) | |
Get the previous compound caption of the current compound caption on the timeline. More... | |
getNextCompoundCaption (caption) | |
Get the next compound caption of the current caption on the timeline. More... | |
getCompoundCaptionsByTimelinePosition (timelinePos) | |
Get a list of compound captions based on the position on the timeline. More... | |
addCompoundCaption (inPoint, duration, compoundCaptionPackageId) | |
add compound caption More... | |
removeCompoundCaption (caption) | |
Remove compound caption from the timeline. More... | |
getFirstAnimatedSticker () | |
Get the first animated sticker on the timeline. More... | |
getLastAnimatedSticker () | |
Get the last animated sticker on the timeline. More... | |
getPrevAnimatedSticker (animatedSticker) | |
Get the previous animated sticker of the current animated sticker of the timeline. More... | |
getNextAnimatedSticker (animatedSticker) | |
Get the next animated sticker of the current animated sticker of the timeline. More... | |
getAnimatedStickersByTimelinePosition (timelinePos) | |
Get an animated sticker list based on the position on the timeline. More... | |
addAnimatedSticker (inPoint, duration, animatedStickerPackageId, isPanoramic, isCustom, customImagePath) | |
add animated sticker More... | |
removeAnimatedSticker (animatedSticker) | |
Remove an animated sticker on the timeline. More... | |
getFirstTimelineVideoFx () | |
Get the first timeline video effect on the timeline. More... | |
getLastTimelineVideoFx () | |
Get the last timeline video effect on the timeline. More... | |
getPrevTimelineVideoFx (timelineVideoFx) | |
Get the previous timeline video effect of a timeline video effect on the timeline. More... | |
getNextTimelineVideoFx (timelineVideoFx) | |
Get the next timeline video effect of a timeline video effect on the timeline. More... | |
getTimelineVideoFxByTimelinePosition (timelinePos) | |
Get a list of timeline video effects based on position on the timeline. More... | |
addBuiltinTimelineVideoFx (inPoint, duration, videoFxName) | |
Add a built-in timeline video effect on the timeline. More... | |
addPackagedTimelineVideoFx (inPoint, duration, videoFxPackageId) | |
Add a timeline video effect in the form of a resource package on the timeline. More... | |
removeTimelineVideoFx (timelineVideoFx) | |
remove Remove a timeline video effect from the timeline. More... | |
getCurrentThemeId () | |
Get the id of the current theme. More... | |
applyTheme (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. More... | |
applyThemeTemplate (templateId) | |
Apply adaptive duration template. More... | |
removeCurrentTheme () | |
Remove current theme. More... | |
setThemeTitleCaptionText (text) | |
Set the caption text for theme title. More... | |
setThemeTrailerCaptionText (text) | |
Set the caption text for theme trailer. More... | |
setThemeMusicVolumeGain (leftVolumeGain, rightVolumeGain) | |
Set the volume value for theme music. More... | |
getThemeMusicVolumeGain () | |
Get the volume value for theme music. More... | |
setPlaybackRateControl (playbackRateControlRegions) | |
set playback rate control More... | |
addWatermark (filePath, displayWidth, displayHeight, opacity, position, marginX, marginY) | |
Add watermark. More... | |
addWatermark2 (sceneWidth, sceneHeight, imageName, imgWidth, imgHeight, tx, ty, dirPath, opacity) | |
add watermark More... | |
deleteWatermark () | |
Delete watermark which has added. More... | |
setWatermarkOpacity (opacity) | |
Set watermark opacity. More... | |
getWatermarkInfo () | |
get watermark information More... | |
setMaxAudioStreamSupportedOnVideoTrack (maxStream) | |
set max audio stream of video track supported More... | |
getMaxAudioStreamSupportedOnVideoTrack () | |
get max audio stream of video track supported More... | |
enableRenderOrderByZValue (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. More... | |
isRenderOrderByZValueEnabled () | |
Whether to turn on use Z value as the rendering order. More... | |
setVolumeGain (leftVolumeGain, rightVolumeGain) | |
Sets the volume. More... | |
getVolumeGain () | |
Get the volume information. More... | |
getCreationFlags () | |
Get the creation flags of timeline. More... | |
getCaptionsBoundingVerticesRecursively (boundingType, timelinePosition) | |
Get the bounding vertices of all captions at timeline position. More... | |
getVideoClipBoundingVerticesRecursively (timelinePosition) | |
Get the bounding vertices of all video clips at timeline position. More... | |
![]() | |
constructor () | |
setInternalObject (obj) | |
set internal object More... | |
getInternalObject () | |
get internal object More... | |
setTemplateAttachment (key, value) | |
Adds additional template data to the NvsObject object to identify the NvsObject template object. More... | |
getTemplateAttachment (key) | |
Gets an template attachment to NvsObject. More... | |
Timeline class: edit the timeline entity of the scene. The timeline is composed of tracks and can be regarded as a collection of a series of audio and video tracks. Multiple video tracks and audio tracks can be added or removed on the timeline. Multiple tracks are superimposed and synthesized with each other. When editing a video, you can also add timeline subtitles, themes and corresponding animation stickers as needed to make a beautiful video. In addition, the added material resource package (theme package, animation sticker package, subtitle style package, timeline special effect package, etc.) must be installed first. After successful installation, the packageid can be used, while the built-in timeline special effect (builtin) only needs to obtain the special effect name.
|
inline |
add animated sticker
{Number} | inPoint The in point of the animated sticker on the timeline (in microseconds) |
{Number} | duration The duration of the animation sticker which displayed (in microseconds) |
{String} | animatedStickerPackageId Animated sticker packageId |
{Boolean} | isPanoramic Panoramic or not |
{Boolean} | isCustom Customize or not |
{String} | customImagePath Custome image path |
|
inline |
Add a built-in timeline video effect on the timeline.
{Number} | inPoint The in point of the timeline video effect on the timeline (in microseconds) |
{Number} | duration Duration of the timeline video effect which displayed (in microseconds) |
{String} | videoFxName The video effect name |
|
inline |
Add a caption on the timeline.
{String} | captionText caption text |
{Number} | inPoint in point |
{Number} | duration duration |
{String} | captionStylePackageId caption style package id |
{Boolean} | isPanoramic panoramic or not |
|
inline |
add compound caption
{Number} | inPoint in point |
{Number} | duration duration |
{String} | compoundCaptionPackageId compound caption package id |
|
inline |
add modular caption
{String} | captionText caption text |
{Number} | inPoint in point |
{Number} | duration duration |
|
inline |
Add a timeline video effect in the form of a resource package on the timeline.
{Number} | inPoint The in point of the timeline video effect on the timeline (in microseconds) |
{Number} | duration Duration of the timeline video effect which displayed (in microseconds) |
{String} | videoFxPackageId The Id of resource package |
|
inline |
Add watermark.
{String} | filePath The path of the watermark file must be a .PNG or .JPG or .CAF file. |
{Number} | displayWidth The width of the watermark displayed in the timeline. If 0, the width of the image file is used. |
{Number} | displayHeight The height of the watermark displayed in the timeline. If 0, the height of the image file is used. |
{Number} | opacity Watermark opacity, the range is [0,1] |
{Number} | position The position of the watermark |
{Number} | marginX The margin of the watermark in the horizontal direction |
{Number} | marginY The margin of the watermark in the vertical direction |
|
inline |
add watermark
{Number} | sceneWidth |
{Number} | sceneHeight |
{String} | imageName |
{Number} | imgWidth |
{Number} | imgHeight |
{Number} | tx |
{Number} | ty |
{String} | dirPath |
{Number} | opacity |
|
inline |
Appends audio track.
|
inline |
Appends video track.
|
inline |
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.
{String} | themeId Id of theme package(if themeId if empty string or null, will remove current theme) |
|
inline |
Apply adaptive duration template.
{String} | templateId uuid |
|
inline |
Get count of audio track.
|
inline |
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.
{Number} | videoWidth New video width(the imported image's width has to be a multiple of 4) |
{Number} | videoHeight New video height(the imported image's height has to be a multiple of 2) |
|
inline |
Change video size.
{Number} | videoWidth New video width(the imported image's width has to be a multiple of 4) |
{Number} | videoHeight New video height(the imported image's height has to be a multiple of 2) |
|
inline |
@constructor
|
inline |
Delete watermark which has added.
|
inline |
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.
{Boolean} | enable Enable or not |
|
inline |
Get an animated sticker list based on the position on the timeline.
{Number} | timelinePos Position on the timeline (in microseconds) |
|
inline |
Gets audio's resolution (sampling rate, sampling format and number of channels).
|
inline |
get audio track according to index
{Number} | trackIndex track index |
|
inline |
Get the bounding vertices of all captions at timeline position.
{NvsCaptionTextBoundingTypeEnum} | boundingType Bounding type |
{Number} | timelinePosition Timeline position |
|
inline |
Get a list of captions based on the position on the timeline.
{Number} | timelinePos The position on the timeline(in micro-second) |
|
inline |
Get a list of compound captions based on the position on the timeline.
{Number} | timelinePos The position on the timeline(in micro-second) |
|
inline |
Get the creation flags of timeline.
|
inline |
Get the id of the current theme.
|
inline |
Gets timeline's duration.
|
inline |
Get the first animated sticker on the timeline.
|
inline |
Get the first caption on the timeline.
|
inline |
Get the first compound caption on the timeline.
|
inline |
Get the first timeline video effect on the timeline.
|
inline |
Get the last animated sticker on the timeline.
|
inline |
Get the last caption on the timeline.
|
inline |
Get the last compound caption on the timeline.
|
inline |
Get the last timeline video effect on the timeline.
|
inline |
get max audio stream of video track supported
|
inline |
Get the next animated sticker of the current animated sticker of the timeline.
{NvsTimelineAnimatedSticker} | animatedSticker The current NvsTimelineAnimatedSticker obejct |
|
inline |
Get the next caption of the current caption on the timeline.
{NvsTimelineCaption} | caption The current caption on the timeline |
|
inline |
Get the next compound caption of the current caption on the timeline.
{NvsTimelineCompoundCaption} | caption The current compound caption on the timeline |
|
inline |
Get the next timeline video effect of a timeline video effect on the timeline.
{NvsTimelineVideoFx} | timelineVideoFx The NvsTimelineVideoFx object |
|
inline |
Get the previous animated sticker of the current animated sticker of the timeline.
{NvsTimelineAnimatedSticker} | animatedSticker The current NvsTimelineAnimatedSticker obejct |
|
inline |
Get the previous caption of the current caption on the timeline.
{NvsTimelineCaption} | caption The current caption on the timeline |
|
inline |
Get the previous compound caption of the current compound caption on the timeline.
{NvsTimelineCompoundCaption} | caption The current compound caption on the timeline |
|
inline |
Get the previous timeline video effect of a timeline video effect on the timeline.
{NvsTimelineVideoFx} | timelineVideoFx The NvsTimelineVideoFx object |
|
inline |
|
inline |
Get a list of timeline video effects based on position on the timeline.
{Number} | timelinePos The position on the timeline (in microseconds) |
|
inline |
Get the bounding vertices of all video clips at timeline position.
{Number} | timelinePosition Timeline position |
|
inline |
Gets video's resolution (image's width, height and aspect ratio).
|
inline |
Gets video track with track index.
{Number} | trackIndex Index of video track |
|
inline |
Get the volume information.
|
inline |
get watermark information
|
inline |
Appends audio track.
{Number} | insertPoint Index 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. |
|
inline |
Insert video track.
{Number} | insertPoint Index 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. |
|
inline |
Whether to turn on use Z value as the rendering order.
|
inline |
Remove an animated sticker on the timeline.
{NvsTimelineAnimatedSticker} | animatedSticker The NvsTimelineAnimatedSticker object which will be removed |
|
inline |
remove Remove audio track.
{Number} | trackIndex Index of audio track |
|
inline |
Remove the caption on the timeline.
{NvsTimelineCaption} | caption timeline caption object which removed |
|
inline |
Remove compound caption from the timeline.
{NvsTimelineCompoundCaption} | caption Timeline compound caption object which to be removed |
|
inline |
Remove current theme.
|
inline |
remove Remove a timeline video effect from the timeline.
{NvsTimelineVideoFx} | timelineVideoFx The NvsTimelineVideoFx object which will be removed |
|
inline |
remove video track
{Number} | trackIndex Index of video track |
|
inline |
set max audio stream of video track supported
{Number} | maxStream max count of stream |
|
inline |
set playback rate control
{NvsVectorVal} | playbackRateControlRegions control region of playback rate |
|
inline |
Set the volume value for theme music.
{Number} | leftVolumeGain Left channel, value range [0, 8). The suggestion is [0, 3], if it exceeds 3, the sound may break. |
{Number} | rightVolumeGain Right channel, value range [0, 8). The suggestion is [0, 3], if it exceeds 3, the sound may break. |
|
inline |
Set the caption text for theme title.
{String} | text The caption text |
|
inline |
Set the caption text for theme trailer.
{String} | text Caption text |
|
inline |
Sets the volume.
{Number} | leftVolumeGain Left volume value |
{Number} | rightVolumeGain Right volume value |
|
inline |
Set watermark opacity.
{Number} | opacity Set watermark opacity. |
|
inline |
Get count of video track.