MeiCam SDK For Web
3.12.1
|
Streaming context:The streaming context class(NvsStreamingContext) can be refered to as the entry point of the whole SDK framework. In the process of development, NvsStreamingContext provides the static sharedInstance interface, which is the only instance to create streaming context. Through this instantce object, we can turn on the recording device to record videos, adding effects to capture videos, set various parameters for recording, which include autofocus, automatic exposure adjustment, swtiching on/off of the light supplement and so on. Meanwhile, this instance can also create timelines, connecting timelines to real-time preview windows to view the recorded videos in real-time. When the whole video has been produced completely, please destroy the instances of streaming context. When recording with special effects or adding resources packages (recording effects package, scene resources package and so on), one has to first install the package and obtain packageID after installation. For built-in special effects, one only needs to obtain the name of the effect in order to use them. In the SDK, users need to adopt the full pathway when importing resources or authorizations. More...
Public Member Functions | |
constructor () | |
get | onStreamingEngineStateChanged () |
State change of streaming engine. More... | |
set | onStreamingEngineStateChanged (fun) |
get | onSeekingTimelinePosition () |
Current postion of timeline refer toking. More... | |
set | onSeekingTimelinePosition (fun) |
streamingEngineReadyForTimelineModification () | |
ready for modify timeline of streaming engine More... | |
lastSeekingFinished () | |
verifySdkLicenseFile (requestUrl, type='') | |
Verifies the SDK license. More... | |
verifySdkLicenseFileWithExtraUserData (requestUrl, extraUserData) | |
verify sdk licence file with extra user data More... | |
getSdkVersion () | |
Obtains Meishe SDK's version information. More... | |
createTimeline (videoRes, fps, audioRes, flags=0) | |
Creates timeline. More... | |
createTemplateTimeline (templateId, templateFootages, flags=0) | |
Create template timeline according template id. More... | |
createEmptyTemplateTimeline (videoRes, fps, audioRes, templateId, flags=0) | |
Create timeline of empty template. More... | |
loadProject (projectId, resourceDir, flags=0) | |
Returns created timeline object. More... | |
removeTimeline (timeline) | |
Removes timeline. More... | |
createLiveWindow (canvasId) | |
create streaming live window according canvas id More... | |
removeLiveWindow (liveWindow) | |
remvoe live window More... | |
connectTimelineWithLiveWindow (timeline, liveWindow) | |
Connects timeline with the LiveWindow. More... | |
disconnectLiveWindow (liveWindow) | |
Disconnects timeline with the LiveWindow. More... | |
seekTimeline (timeline, timestamp, videoSizeMode, flags) | |
Seeking the frame at a specific timestamp. More... | |
seekTimelineWithProxyScale (timeline, timestamp, proxyScale, flags) | |
Seeking the frame at a specific timestamp with proxy scale. More... | |
playbackTimeline (timeline, startTime, endTime, videoSizeMode, preload, flags) | |
Timeline playback. More... | |
playbackTimelineWithProxyScale (timeline, startTime, endTime, proxyScale, preload, flags) | |
playback timeline with proxy scale More... | |
stop () | |
Stops the engine. More... | |
getTimelineCurrentPosition (timeline) | |
Gets the current positon of the timeline (in microseconds) More... | |
getStreamingEngineState () | |
Gets streaming engine's state. More... | |
getAssetPackageManager () | |
Gets resource package manager. More... | |
getAVFileInfo (avFilePath, extraFlag) | |
Gets detailed information of the audio/video file. More... | |
getLocalAVFileIcon (localAVFilePath, timestamp, iconFetched) | |
Start an local AV file icon fetching task. More... | |
getLocalAVFileIconFromCache (localAVFilePath, timestamp) | |
Fetch local AV file icon from cache. More... | |
getLocalAVFileThumbnail (localAVFilePath, timestamp, bypassCache, thumbnailFetched) | |
Start an local AV file thumbnail fetching task. More... | |
cancelLocalAVFileIconFetchingTask (iconFetchingTaskId) | |
Cancel icon fetching task for a specific task id. More... | |
clearLocalAVFileIconCache () | |
Clear all cached icons of local AV file. | |
getLocalAVFileWaveformData (localAVFilePath, sampleCountPerGroup, startGroupIndex, groupCount, waveformDataFetched) | |
Start an local AV file waveform data fetching task. More... | |
cancelLocalAVFileWaveformDataFetchingFetchingTask (waveformDataFetchingTaskId) | |
Cancel waveform data fetching task for a specific task id. More... | |
clearLocalAVFileWaveformDataCache () | |
Clear all cached waveform data of local AV file. | |
registerLocalFile (file) | |
Register a local File object. More... | |
unregisterLocalFile (localFileId) | |
Unregister a local File object according to its identifier. More... | |
registerFontByFilePath (fontFilePath) | |
Gets font file's fontFamily. More... | |
getFontCompoundFamilyNameByFilePath (fontFilePath) | |
Get the compound family name of font file. More... | |
grabImageFromTimeline (timeline, timestamp, proxyScale, flags) | |
Gets the specific frame in timeline with a specific timestamp. More... | |
setAudioOutputDeviceVolume (volume) | |
Set volume to audio output device. More... | |
setMaxVideoFileReaderCount (count) | |
set max count of video file reader More... | |
getMaxVideoFileReaderCount () | |
get max count of video file reader More... | |
setMaxImageReaderCount (count) | |
set max count of image reader More... | |
getMaxImageReaderCount () | |
get max count of image reader More... | |
setMaxVideoDecodingThreadCount (count) | |
set max count of video decoding thread More... | |
functionalityAuthorised (sdkFunctionName) | |
function authorise More... | |
setUseChineseLanguageOnly (useChineseLanguageOnly) | |
set Chinese language only More... | |
isUseChineseLanguageOnly () | |
Chinese language only or not. More... | |
initHumanDetection (modelFilePath, licenseFilePath, features) | |
Initializes human detection. Only once needed. More... | |
initHumanDetectionExt (modelFilePath, licenseFilePath, features) | |
Initializes human detection. Need use initHumanDetection first. More... | |
setupHumanDetectionData (dataType, dataFilePath) | |
Setup human detection data. More... | |
closeHumanDetection () | |
Turns off the human detection mechanism. More... | |
calcDurationAfterCurvesVariableSpeed (curvesString) | |
Calculate duration after using curves variable speed. More... | |
clearCachedResources () | |
Clears cached resources. More... | |
preloadEffectResources () | |
preload effects resource More... | |
notifyUpdateToWebReader (webAVFilePath) | |
update the notify to webReader More... | |
enableAudioVUMeter (enable) | |
enable audio VU meter More... | |
setDefaultCaptionFade (fade) | |
enable caption default fade More... | |
isDefaultCaptionFade () | |
caption default fade is enabled or not More... | |
isDecoderConfigSupported (codecType, codecAcceleration) | |
Video decoder configuration is supported or not. More... | |
getAutoToneParameters (imageData, width, height, isRawImage) | |
get automatic tone parameter More... | |
Streaming context:The streaming context class(NvsStreamingContext) can be refered to as the entry point of the whole SDK framework. In the process of development, NvsStreamingContext provides the static sharedInstance interface, which is the only instance to create streaming context. Through this instantce object, we can turn on the recording device to record videos, adding effects to capture videos, set various parameters for recording, which include autofocus, automatic exposure adjustment, swtiching on/off of the light supplement and so on. Meanwhile, this instance can also create timelines, connecting timelines to real-time preview windows to view the recorded videos in real-time. When the whole video has been produced completely, please destroy the instances of streaming context. When recording with special effects or adding resources packages (recording effects package, scene resources package and so on), one has to first install the package and obtain packageID after installation. For built-in special effects, one only needs to obtain the name of the effect in order to use them. In the SDK, users need to adopt the full pathway when importing resources or authorizations.
|
inline |
Calculate duration after using curves variable speed.
curvesString | curves string |
|
inline |
Cancel icon fetching task for a specific task id.
{Number} | iconFetchingTaskId Icon fetching task identifier to cancel. |
|
inline |
Cancel waveform data fetching task for a specific task id.
{Number} | waveformDataFetchingTaskId Waveform data fetching task identifier to cancel. |
|
inline |
Clears cached resources.
|
inline |
Turns off the human detection mechanism.
|
inline |
Connects timeline with the LiveWindow.
{NvsTimeline} | timeline Timeline |
{NvsLiveWindow} | liveWindow Preview image window in real time |
|
inline |
@constructor
|
inline |
Create timeline of empty template.
{NvsVideoResolution} | videoRes Video file's resolution (specified width to height ratio). For video editing resolution, when importing corresponding params, the imported image's width has to be a multiple of 4, the height has to be a multiple of 2. Note: if one creates NvsStreamingContext's instance that supports 4K video editing, then video editing's resolution cannot be higher then 3840*2160(imageWidth*imageHeight), otherwise the imageWidth*imageHeight cannot exceed 1920* 1080 pixels. |
{NvsRational} | fps Frame rate |
{NvsAudioResolution} | audioRes Audio file's resolution(specified file sampling rate, sampling format and number of channels. For audio editing resolution, imported audio only supports two types of sampling rate, 44100 or 48000.) |
{String} | templateId template id |
{Number} | flags flags |
|
inline |
create streaming live window according canvas id
{String} | canvasId canvas id |
|
inline |
Create template timeline according template id.
{String} | templateId template uuid,template must be installed firstly |
{NvsVectorVal} | templateFootages footage information in the template asset |
{Number} | flags Special flags for create timeline. If there is no special requirements please input 0. |
|
inline |
Creates timeline.
{NvsVideoResolution} | videoRes Video file's resolution (specified width to height ratio). For video editing resolution, when importing corresponding params, the imported image's width has to be a multiple of 4, the height has to be a multiple of 2. Note: if one creates NvsStreamingContext's instance that supports 4K video editing, then video editing's resolution cannot be higher then 3840*2160(imageWidth*imageHeight), otherwise the imageWidth*imageHeight cannot exceed 1920* 1080 pixels. |
{NvsRational} | fps Frame rate |
{NvsAudioResolution} | audioRes Audio file's resolution(specified file sampling rate, sampling format and number of channels. For audio editing resolution, imported audio only supports two types of sampling rate, 44100 or 48000.) |
{Number} | flags Special flags for create timeline. If there is no special requirements please input 0. |
|
inline |
Disconnects timeline with the LiveWindow.
{NvsLiveWindow} | liveWindow Preview image window in real time |
|
inline |
enable audio VU meter
{Boolean} | enable enable or not |
|
inline |
function authorise
{String} | sdkFunctionName sdk function name |
|
inline |
Gets resource package manager.
|
inline |
get automatic tone parameter
{ImageData} | imageData image data |
{Number} | width width |
{Number} | height height |
{Boolean} | isRawImage raw image or not |
|
inline |
Gets detailed information of the audio/video file.
{String} | avFilePath file path |
{Number} | extraFlag extra flags |
|
inline |
Get the compound family name of font file.
{String} | fontFilePath Font file path |
|
inline |
Start an local AV file icon fetching task.
{String} | localAVFilePath local AV file path, e.g. /localmedia/test.mp4.weblocal |
{Number} | timestamp Timestamp at which to fetch icon from the local AV file, in microseconds. |
{Function} | iconFetched A function to be executed when the icon has been fetched. It receives the following parameters: imageData: A ImageData object of the icon fetched. localAVFilePath: A string of the local AV file path from which we fetch icon. timestamp: Timestamp of the icon fetched, in microseconds. |
|
inline |
Fetch local AV file icon from cache.
{String} | localAVFilePath local AV file path, e.g. /localmedia/test.mp4.weblocal |
{Number} | timestamp time at which to fetch icon from the local AV file, in microseconds. |
|
inline |
Start an local AV file thumbnail fetching task.
{String} | localAVFilePath local AV file path, e.g. /localmedia/test.mp4.weblocal |
{Number} | timestamp time at which to fetch frame from the local AV file as thumbnail, in microseconds, -1 means the actual timestamp is determined by implementation. |
{Boolean} | bypassCache Whether to bypass thumnail cache. |
{Function} | thumbnailFetched A function to be executed when the thumbnail has been fetched. It receives the following parameters: imageData: A ImageData object of the thumbnail fetched. localAVFilePath: A string of the local AV file path from which we fetch thumbnail. timestamp: Timestamp of the thumbnail, in microseconds. |
|
inline |
Start an local AV file waveform data fetching task.
{String} | localAVFilePath local AV file path, e.g. /localmedia/test.m4a.weblocal |
{Number} | sampleCountPerGroup Indicates the sample count in a group where we extract a minimal/maximum waveform data pair. |
{Number} | startGroupIndex Start group index to fetch waveform data. |
{Number} | groupCount Group count to fetch waveform data. -1 indicates fetching waveform data till the end of the local AV file. |
{Function} | waveformDataFetched A function to be executed when the waveform data has been fetched. It receives the following parameters: leftChannelData: A Float32Array object to hold left channel waveform data, The array contain a sequence of min/max waveform data values. rightChannelData: Same as leftChannelData but it hold right channel waveform data. localAVFilePath: A string of the local AV file path from which we fetch waveform data. sampleCountPerGroup: sampleCountPerGroup parameter of the task. startGroupIndex: startGroupIndex parameter of the task. |
|
inline |
get max count of image reader
|
inline |
get max count of video file reader
|
inline |
Obtains Meishe SDK's version information.
|
inline |
Gets streaming engine's state.
|
inline |
Gets the current positon of the timeline (in microseconds)
{NvsTimeline} | timeline Timeline |
|
inline |
Gets the specific frame in timeline with a specific timestamp.
{NvsTimeline} | timeline The timeline that will be grabbed from. |
{Number} | timestamp The desired frame's timestamp(in microseconds). Timestamp should be within range [0,timeline.duration - 1]. Other inputs are invalid and will results grabImageFromTimeline returns null. |
{NvsRational} | proxyScale scale proxy |
{Number} | flags flags |
|
inline |
Initializes human detection. Only once needed.
{String} | modelFilePath mode file path |
{String} | licenseFilePath license file path |
{Number} | features features, see NvsHumanDetectionFeatureEnum for detail |
|
inline |
Initializes human detection. Need use initHumanDetection first.
{String} | modelFilePath mode file path |
{String} | licenseFilePath license file path |
{Number} | features features, see NvsHumanDetectionFeatureEnum for detail |
|
inline |
Video decoder configuration is supported or not.
|
inline |
caption default fade is enabled or not
|
inline |
Chinese language only or not.
|
inline |
Returns created timeline object.
{String} | projectId project uuid,project must be installed firstly |
{String} | resourceDir resource dir of the project asset |
{Number} | flags Special flags for create timeline. If there is no special requirements please input 0. Please refer to create timeline flag. |
|
inline |
update the notify to webReader
{String} | webAVFilePath web audio video file path |
|
inline |
Current postion of timeline refer toking.
{NvsTimeline} | timeline |
{String} | position Returns current postion of timeline refer toking. |
|
inline |
State change of streaming engine.
|
inline |
Timeline playback.
{NvsTimeline} | timeline Timeline |
{Number} | startTime Start time(in microseconds). Start time should be in the range [0,timeline.duration - 1], other inputs are invalid and playbackTimeline will return false resulting playback cannot be turned on. |
{Number} | endTime End time(in microseconds). If endtime input is a negative value, then the playback is defaultly set to play till the end. |
{Number} | videoSizeMode If no special requirements please input 0. Please refer to NvsVideoPreviewSizeModeEnum for reference. |
{Boolean} | preload Whether to preload |
{Number} | flags Flags for preview. If no special requirements please input 0. Please refer to NvsPlaybackFlagEnum for reference. |
|
inline |
playback timeline with proxy scale
{NvsTimeline} | timeline Timeline |
{Number} | startTime Start time(in microseconds). Start time should be in the range [0,timeline.duration - 1], other inputs are invalid and playbackTimeline will return false resulting playback cannot be turned on. |
{Number} | endTime End time(in microseconds). If endtime input is a negative value, then the playback is defaultly set to play till the end. |
{NvsRational} | proxyScale Zoom scale of proxy |
{Boolean} | preload Whether to preload |
{Number} | flags Flags for preview. If no special requirements please input 0. Please refer to NvsPlaybackFlagEnum for reference. |
|
inline |
preload effects resource
|
inline |
Gets font file's fontFamily.
{String} | fontFilePath Font file path |
|
inline |
Register a local File object.
{File} | file A File object to register. |
|
inline |
remvoe live window
{NvsLiveWindow} | liveWindow live window |
|
inline |
Removes timeline.
{NvsTimeline} | timeline The timeline to be removed |
|
inline |
Seeking the frame at a specific timestamp.
{NvsTimeline} | timeline Timeline |
{Number} | timestamp Timestamp (in microseconds). Timestamp should be in the range of [0,timeline.duration - 1]. Other input values are invalid and seekTimeline will return false, results can't targeting. |
{Number} | videoSizeMode Video preview mode. Please refer to NvsVideoPreviewSizeModeEnum. |
{Number} | flags Flags for streaming engine seeking. For specific please refer to NvsSeekFlagEnum. |
|
inline |
Seeking the frame at a specific timestamp with proxy scale.
{NvsTimeline} | timeline Timeline |
{Number} | timestamp Timestamp (in microseconds). Timestamp should be in the range of [0,timeline.duration - 1]. Other input values are invalid and seekTimeline will return false, results can't targeting. |
{NvsRational} | proxyScale Zoom scale of proxy |
{Number} | flags Flags for streaming engine seeking. For specific please refer to NvsSeekFlagEnum. |
|
inline |
Set volume to audio output device.
{Number} | volume new volume to device, value range[0, 1] |
|
inline |
enable caption default fade
{Boolean} | fade enable fade or not |
|
inline |
set max count of image reader
{Number} | count max count of image reader |
|
inline |
set max count of video decoding thread
{Number} | count count |
|
inline |
set max count of video file reader
{Number} | count max count of video file reader |
|
inline |
Setup human detection data.
{Number} | dataType data type of human detection, see NvsHumanDetectionDataTypeEnum for detail |
{String} | dataFilePath data file path |
|
inline |
set Chinese language only
{Boolean} | useChineseLanguageOnly use Chinese language only |
|
inline |
Stops the engine.
|
inline |
ready for modify timeline of streaming engine
|
inline |
Unregister a local File object according to its identifier.
{String} | localFileId A string object of the local file object identifier to unregister. |
|
inline |
Verifies the SDK license.
{String} | requestUrl request url |
{String} | type type |
|
inline |
verify sdk licence file with extra user data
{String} | requestUrl request url |
{} | extraUserData extra user data |