MeiCam SDK For Android  1.0.0
Classes | Public Member Functions | Static Public Member Functions | List of all members
com.meicam.sdk.NvsStreamingContext Class Reference

Streaming context. More...

Classes

interface  CaptureDeviceCallback
 Capture device callback interface. More...
 
class  CaptureDeviceCapability
 Description of capturing device's capabilities. More...
 
interface  CapturedVideoFrameGrabberCallback
 Gets callback interface of the captured preview. More...
 
interface  CaptureRecordingDurationCallback
 Callback interface for recording duration. More...
 
interface  CaptureRecordingStartedCallback
 Callback interface for starting capturing. More...
 
interface  CompileCallback
 Callback interface for timeline's compiling file. More...
 
interface  CompileCallback2
 The second callback interface for timeline file compilation. More...
 
interface  HardwareErrorCallback
 Hardware error callback interface. More...
 
interface  PlaybackCallback
 Callback interface for timeline playback. More...
 
interface  PlaybackCallback2
 The second callback interface for timeline playback. More...
 
interface  PlaybackDelayCallback
 Callback interface for playback delay. More...
 
interface  PlaybackExceptionCallback
 Callback interface for timeline playback exception. More...
 
class  SdkVersion
 The version information of Meishe SDK. More...
 
interface  SeekingCallback
 Callback interface for timeline search. More...
 
interface  StreamingEngineCallback
 Callback interface for streaming engine. More...
 
interface  TimelineTimestampCallback
 Callback interface for timeline timestamp (note: Do not use this interface unless neccessary). More...
 
class  VerifyLicenseResult
 

Public Member Functions

boolean isSdkAuthorised ()
 Checks if sdk is authorized. More...
 
float detectEngineRenderFramePerSecond ()
 从流媒体上下文中获取引擎当前的渲染速度,只在StartCapturePreview和PlaybackTimeline之后有效 More...
 
SdkVersion getSdkVersion ()
 Obtains Meishe SDK's version information. More...
 
NvsAssetPackageManager getAssetPackageManager ()
 Gets resource package manager. More...
 
void setCaptureDeviceCallback (CaptureDeviceCallback cb)
 Sets callback interface for capturing device. More...
 
void setCapturedVideoFrameGrabberCallback (CapturedVideoFrameGrabberCallback cb)
 Sets callback interface for getting capture preview frame. More...
 
void setCaptureRecordingStartedCallback (CaptureRecordingStartedCallback cb)
 
void setCaptureRecordingDurationCallback (CaptureRecordingDurationCallback cb)
 Sets callback interface of recording duration. More...
 
void setPlaybackCallback (PlaybackCallback cb)
 Sets the callback interface for timeline playback. More...
 
void setCompileCallback (CompileCallback cb)
 Sets callback interface for timeline file compilation. More...
 
void setStreamingEngineCallback (StreamingEngineCallback cb)
 Sets callback interface for streaming engine. More...
 
void setTimelineTimestampCallback (TimelineTimestampCallback cb)
 Sets callback interface for timeline timestamp. More...
 
void setCompileCallback2 (CompileCallback2 cb)
 Sets the second callback interface for timeline file compilation. More...
 
void setPlaybackCallback2 (PlaybackCallback2 cb)
 Sets callback interface for timeline playback. More...
 
void setPlaybackDelayCallback (PlaybackDelayCallback cb)
 Sets callback interface for delay playback. More...
 
void setPlaybackExceptionCallback (PlaybackExceptionCallback cb)
 Sets callback interface for playback exception. More...
 
void setSeekingCallback (SeekingCallback cb)
 Sets the timeline search callback interface. More...
 
void setHardwareErrorCallback (HardwareErrorCallback cb)
 Sets callback interface for hardware error. More...
 
NvsAVFileInfo getAVFileInfo (String avFilePath)
 Gets detailed information of the audio/video file. More...
 
NvsAVFileInfo getAVFileInfo (String avFilePath, int extraFlag)
 Gets detailed information of the audio/video file. More...
 
int detectVideoFileKeyframeInterval (String videoFilePath)
 Detects video file's I-Frame interval. More...
 
boolean setDefaultThemeEndingLogoImageFilePath (String logoImageFilePath)
 Sets default theme's ending logo. More...
 
String getDefaultThemeEndingLogoImageFilePath ()
 Gets the file path of the default ending logo. More...
 
String registerFontByFilePath (String fontFilePath)
 Gets font file's fontFamily. More...
 
boolean setThemeEndingEnabled (boolean enable)
 Sets whether to display theme ending's special effects. More...
 
NvsTimeline createTimeline (NvsVideoResolution videoEditRes, NvsRational videoFps, NvsAudioResolution audioEditRes)
 Creates timeline. More...
 
boolean removeTimeline (NvsTimeline timeline)
 Removes timeline. More...
 
int getStreamingEngineState ()
 Gets streaming engine's state. More...
 
long getTimelineCurrentPosition (NvsTimeline timeline)
 Gets the current positon of the timeline (in microseconds) More...
 
boolean compileTimeline (NvsTimeline timeline, long startTime, long endTime, String outputFilePath, int videoResolutionGrade, int videoBitrateGrade, int flags)
 Compiles timeline into a file. More...
 
void setCustomCompileVideoHeight (int videoHeight)
 Sets the customized height for video. More...
 
int getCustomCompileVideoHeight ()
 Gets the customized video height. More...
 
boolean connectTimelineWithLiveWindow (NvsTimeline timeline, NvsLiveWindow liveWindow)
 Connects timeline with the LiveWindow. More...
 
boolean connectTimelineWithLiveWindowExt (NvsTimeline timeline, NvsLiveWindowExt liveWindow)
 Connects timeline with the LiveWindow (based on TextureView) More...
 
boolean connectTimelineWithSurfaceTexture (NvsTimeline timeline, SurfaceTexture outputSurfaceTexture)
 Connects timeline with a SurfaceTexture, of which the rendering outcome of the timeline will be output to this SurfaceTexture. More...
 
boolean connectTimelineWithSurfaceTexture (NvsTimeline timeline, SurfaceTexture outputSurfaceTexture, NvsRational proxyScale)
 Connects timeline with SurfaceTexture and set the proxy scale. The timeline's rendering outcome will be output to this SurfaceTexture. More...
 
boolean seekTimeline (NvsTimeline timeline, long timestamp, int videoSizeMode, int flags)
 定位某一时间戳的图像 More...
 
boolean seekTimeline (NvsTimeline timeline, long timestamp, NvsRational proxyScale, int flags)
 Seeking the frame at a specific timestamp. More...
 
Bitmap grabImageFromTimeline (NvsTimeline timeline, long timestamp, NvsRational proxyScale)
 Gets the specific frame in timeline with a specific timestamp. For details please refer to The video frame retriever . More...
 
Bitmap grabImageFromTimeline (NvsTimeline timeline, long timestamp, NvsRational proxyScale, int flags)
 Gets the specific frame in timeline with a specific timestamp. For details please refer to The video frame retriever. More...
 
boolean playbackTimeline (NvsTimeline timeline, long startTime, long endTime, int videoSizeMode, boolean preload, int flags)
 Timeline playback. More...
 
boolean playbackTimeline (NvsTimeline timeline, long startTime, long endTime, NvsRational proxyScale, boolean preload, int flags)
 Timeline playback. More...
 
void stop ()
 Stops the engine. More...
 
void stop (int flags)
 Stops the engine. More...
 
void clearCachedResources (boolean asynchronous)
 Clears cached resources. More...
 
int getCaptureDeviceCount ()
 Number of capture device. More...
 
boolean isCaptureDeviceBackFacing (int captureDeviceIndex)
 Whether it's a rear capturing device. More...
 
CaptureDeviceCapability getCaptureDeviceCapability (int captureDeviceIndex)
 Gets the capability description object of the capture device. More...
 
boolean checkDontSetCameraParamOnRecordingWithSystemRecorder ()
 Checks if the camera's parameters cannot be set when recording with system recorder. More...
 
boolean connectCapturePreviewWithLiveWindow (NvsLiveWindow liveWindow)
 Connects the captured preview with live window. More...
 
boolean connectCapturePreviewWithLiveWindowExt (NvsLiveWindowExt liveWindow)
 Connects the captured preview with live window(based on TextureView) More...
 
boolean connectCapturePreviewWithSurfaceTexture (SurfaceTexture outputSurfaceTexture)
 Connects a capture preview with a SurfaceTexture object. The capture preview's rendering result will be output to this SurfaceTexture object. More...
 
void setUserWatermarkForCapture (String watermarkFilePath, int displayWidth, int displayHeight, float opacity, int position, int marginX, int marginY)
 Adds a custom watermark for capturing video. More...
 
void removeUserWatermarkForCapture ()
 Removes custom watermark which added for capturing video. More...
 
boolean startCapturePreview (int captureDeviceIndex, int videoResGrade, int flags, NvsRational aspectRatio)
 Starts the capture preview. More...
 
boolean startBufferCapturePreview (int width, int heidht, NvsRational fps, int rotation, boolean flipHorizontally)
 Starts the capture preview with inputting buffer mode. More...
 
boolean startDualBufferCapturePreview (SurfaceTexture surfaceTexture, int surfaceTextureWidth, int surfaceTextureHeight, int surfaceTextureRotation, int cpuBufferWidth, int cpuBufferHeight, boolean cpuBufferFlipHorizontally, int cpuBufferRotation, NvsRational fps, int flags)
 Starts dual buffer mode for capture preview, one input is from SurfaceTexture and another is from cpu buffer. Two input must be of the same size when rotated to positive direction. More...
 
boolean sendBufferToCapturePreview (byte[] data, long streamTime)
 Transfers the input buffer to capture preivew. More...
 
boolean sendBufferToCapturePreview (byte[] data, long streamTime, int flags)
 Sends buffer to the capture preview. More...
 
NvsSize getCapturePreviewVideoSize (int captureDeviceIndex)
 Gets the capture preview resolution. More...
 
NvsColor sampleColorFromCapturedVideoFrame (RectF sampleRect)
 Samples the capture device's video frame. More...
 
void startAutoFocus (RectF focusRect)
 Starts autofocus. More...
 
void cancelAutoFocus ()
 Cancels the ongoing autofocus. More...
 
void StartContinuousFocus ()
 Starts continuous focus. More...
 
void setAutoExposureRect (RectF exposureRect)
 Set the auto exposure detection area. More...
 
void setZoom (int zoom)
 Sets the zoom value. More...
 
int getZoom ()
 Gets the zoom factor. More...
 
void toggleFlash (boolean flashOn)
 Sets which the flash light is on/off. More...
 
boolean isFlashOn ()
 get state of the flash light. More...
 
int getVideoStabilization ()
 Gets the current video’s stabilization flag. More...
 
void setVideoStabilization (int flags)
 Sets video stabilization. More...
 
void setExposureCompensation (int exposureCompensation)
 Set exposure compensation. More...
 
int getExposureCompensation ()
 Gets exposure compensation. More...
 
NvsCaptureVideoFx appendBuiltinCaptureVideoFx (String videoFxName)
 Appends a built-in capture video effect. More...
 
NvsCaptureVideoFx insertBuiltinCaptureVideoFx (String videoFxName, int insertPosition)
 Inserts a built-in video capture effect. More...
 
NvsCaptureVideoFx appendPackagedCaptureVideoFx (String videoFxPackageId)
 Appends a package capture effectx. More...
 
NvsCaptureVideoFx insertPackagedCaptureVideoFx (String videoFxPackageId, int insertPosition)
 Inserts a package capture effect. More...
 
NvsCaptureVideoFx appendCustomCaptureVideoFx (NvsCustomVideoFx.Renderer customVideoFxRender)
 Appends a custom capture video effect. More...
 
NvsCaptureVideoFx insertCustomCaptureVideoFx (NvsCustomVideoFx.Renderer customVideoFxRender, int insertPosition)
 Inserts a custom capture video effect. More...
 
NvsCaptureVideoFx appendBeautyCaptureVideoFx ()
 Appends a beauty effect. More...
 
NvsCaptureVideoFx insertBeautyCaptureVideoFx (int insertPosition)
 Inserts a skin beauty video effect. More...
 
boolean removeCaptureVideoFx (int captureVideoFxIndex)
 Removes a certain capture video effect indicated by its index. More...
 
void removeAllCaptureVideoFx ()
 Removes all capture video effects. More...
 
int getCaptureVideoFxCount ()
 Gets the count of video effects. More...
 
NvsCaptureVideoFx getCaptureVideoFxByIndex (int captureVideoFxIndex)
 Gets a certain capture video effect. More...
 
boolean applyCaptureScene (String captureSceneId)
 Apply a capture scene resource package to the capture device. More...
 
String getCurrentCaptureSceneId ()
 Gets the ID of the current capture scene resource package. More...
 
void removeCurrentCaptureScene ()
 Removes the current capture scene. More...
 
NvsAREffectContext getAREffectContext ()
 Gets the face effect context. More...
 
void setCompileConfigurations (Hashtable< String, Object > compileConfigurations)
 Sets the timeline configurations, which stay valid once set. More...
 
Hashtable< String, Object > getCompileConfigurations ()
 Gets configurations for compiling timeline. More...
 
void setCompileVideoBitrateMultiplier (float compileVideoBitrateMultiplier)
 Set the rate multiplier for compiling video. More...
 
float getCompileVideoBitrateMultiplier ()
 Get the rate multiplier for compiling video. More...
 
void setRecordVideoBitrateMultiplier (float recordVideoBitrateMultiplier)
 Set the rate multiplier for recording video. More...
 
float getRecordVideoBitrateMultiplier ()
 Get the rate multiplier for recording video. More...
 
boolean startRecording (String outputFilePath)
 Starts recording. Please refer to Method of Recording Video. More...
 
boolean startRecording (String outputFilePath, int flags)
 Starts recording. Please refer to Method of Recording Video. More...
 
boolean startRecording (String outputFilePath, int flags, Hashtable< String, Object > recordConfigurations)
 Starts recording. Please refer to Method of Recording Video. More...
 
void stopRecording ()
 Stops recording. More...
 
boolean pauseRecording ()
 Pause to record. Resuming recording after a pause will output the recorded video to the same file. Note: Recording can only be paused without using the built-in recorder! More...
 
boolean resumeRecording ()
 Continues to record. Continuing recording will output the recorded video to the same media file, to which the recording before suspend outputs contents. More...
 
boolean isRecordingPaused ()
 Checks if the recording has been paused. More...
 
List< String > getAllBuiltinVideoFxNames ()
 Gets the list of all built-in video effect names. More...
 
List< String > getAllBuiltinAudioFxNames ()
 Gets the list of all built-in audio effect names. More...
 
List< String > getAllBuiltinVideoTransitionNames ()
 Gets the list of all built-in video transitions’ names. More...
 
List< String > getAllBuiltinCaptureVideoFxNames ()
 Gets the list of all built-in capture video effects’ names. More...
 
String getBeautyVideoFxName ()
 Gets the name of beauty effect. More...
 
String getDefaultVideoTransitionName ()
 Gets the default video transition’s name. More...
 
NvsFxDescription getVideoFxDescription (String fxName)
 Gets the description of a video effect. More...
 
NvsFxDescription getAudioFxDescription (String fxName)
 Gets the description of an audio effect. More...
 
NvsVideoFrameRetriever createVideoFrameRetriever (String videoFilePath)
 Creates an object of video frame retriever. More...
 
void setDefaultCaptionFade (boolean fade)
 Sets whether default caption mode is fade in and fade out. More...
 
boolean isDefaultCaptionFade ()
 gets whether default caption mode is fade in and fade out. More...
 

Static Public Member Functions

static NvsStreamingContext init (Context ctx, String sdkLicenseFilePath, int flags)
 Initializes streaming context instance. More...
 
static NvsStreamingContext init (Activity mainActivity, String sdkLicenseFilePath, int flags)
 Initializes the instance of streaming context object. for more please refer to (4k video editing). More...
 
static NvsStreamingContext init (Activity mainActivity, String sdkLicenseFilePath)
 Initializes an instance of streaming context object. More...
 
static void close ()
 Destroys the streaming context object instance. note: it can be created again after destruction. More...
 
static NvsStreamingContext getInstance ()
 Gets the instance of streaming context object (only can use this after initialization) More...
 
static boolean initHumanDetection (Context ctx, String modelFilePath, String licenseFilePath, int features)
 Initializes human detection mechanism. More...
 
static boolean setupHumanDetectionData (int dataType, String dataFilePath)
 Initializes human detection data pack. More...
 
static void closeHumanDetection ()
 Turns off the human detection mechanism. More...
 
static int hasARModule ()
 Checks if current SDK has an AR module. More...
 

Static Public Attributes

Streaming context flags

static final int STREAMING_CONTEXT_FLAG_SUPPORT_4K_EDIT = 1
 Supports 4K video editting. More...
 
static final int STREAMING_CONTEXT_FLAG_COMPACT_MEMORY_MODE = 2
 Minimizes the memory occupation. More...
 
static final int STREAMING_CONTEXT_FLAG_SUPPORT_8K_EDIT = 4
 Supports 8K edittingting(only for pictures) More...
 
static final int STREAMING_CONTEXT_FLAG_NO_HARDWARE_VIDEO_READER = 8
 Disable hardware decoding. More...
 
static final int STREAMING_CONTEXT_FLAG_ASYNC_ENGINE_STATE = 16
 Switches engine states asynchronously to reduce main thread's jam. More...
 
static final int STREAMING_CONTEXT_VIDEO_DECODER_WITHOUT_SURFACE_TEXTURE = 32
 
Streaming engine states

static final int STREAMING_ENGINE_STATE_STOPPED = 0
 Engine stopped. More...
 
static final int STREAMING_ENGINE_STATE_CAPTUREPREVIEW = 1
 Capture preview. More...
 
static final int STREAMING_ENGINE_STATE_CAPTURERECORDING = 2
 Capture recording. More...
 
static final int STREAMING_ENGINE_STATE_PLAYBACK = 3
 Playback. More...
 
static final int STREAMING_ENGINE_STATE_SEEKING = 4
 Seeking. More...
 
static final int STREAMING_ENGINE_STATE_COMPILE = 5
 Compiling file. More...
 
Video capture resolution level

static final int VIDEO_CAPTURE_RESOLUTION_GRADE_LOW = 0
 Low resolution for video capture. More...
 
static final int VIDEO_CAPTURE_RESOLUTION_GRADE_MEDIUM = 1
 Medium resolution for video capture. More...
 
static final int VIDEO_CAPTURE_RESOLUTION_GRADE_HIGH = 2
 High resolution for video capture. More...
 
static final int VIDEO_CAPTURE_RESOLUTION_GRADE_SUPER_HIGH = 3
 Super high resolution for video capture. More...
 
Video compile resolution level

static final int COMPILE_VIDEO_RESOLUTION_GRADE_360 = 0
 Compiles the video with height 360(the width of video is determined by height and the selected width when creating timeline, caculated by resolution ratio) More...
 
static final int COMPILE_VIDEO_RESOLUTION_GRADE_480 = 1
 Compiles the video with height 480. More...
 
static final int COMPILE_VIDEO_RESOLUTION_GRADE_720 = 2
 Compiles the video with height 720. More...
 
static final int COMPILE_VIDEO_RESOLUTION_GRADE_1080 = 3
 Compiles the video with height 1080. More...
 
static final int COMPILE_VIDEO_RESOLUTION_GRADE_2160 = 4
 Compiles the video with height 2160. More...
 
static final int COMPILE_VIDEO_RESOLUTION_GRADE_CUSTOM = 256
 Customizes the height of video compiled. More...
 
The bitrate of video compiled

static final int COMPILE_BITRATE_GRADE_LOW = 0
 Low bitrate for video compiled. More...
 
static final int COMPILE_BITRATE_GRADE_MEDIUM = 1
 Medium bitrate for video compiled. More...
 
static final int COMPILE_BITRATE_GRADE_HIGH = 2
 High bitrate for video compiled. More...
 
Configurations for recording

static final String RECORD_BITRATE = "bitrate"
 Record bitrate. More...
 
static final String RECORD_GOP_SIZE = "gopsize"
 Record GOP size. More...
 
Configurations for creating the timeline

static final String COMPILE_BITRATE = "bitrate"
 Compile bitrate. More...
 
static final String COMPILE_GOP_SIZE = "gopsize"
 Compile GOP size. More...
 
static final String COMPILE_AUDIO_BITRATE = "audio bitrate"
 Compile audio bitrate. More...
 
static final String COMPILE_LOSSLESS_AUDIO = "lossless audio"
 Whether to compile lossless audio. More...
 
static final String COMPILE_OPTIMIZE_FOR_NETWORK_USE = "optimize-for-network-use"
 Whether to prepose the index table. More...
 
static final String COMPILE_SOFTWARE_ENCODER_PRESET = "software encorder preset"
 Preset parameters for software encoder. More...
 
static final String COMPILE_SOFTWARE_ENCODER_CRF = "software encorder crf"
 Preset crf parameters for software encoder. More...
 
static final String COMPILE_SOFTWARE_ENCODER_CRF_BITRATE_MAX = "software encorder crf bitrate max"
 Preset maximum bitrate for software encoder in crf mode. More...
 
static final String COMPILE_SOFTWARE_ENCODER_MODE = "software encorder mode"
 Software encoder mode. More...
 
static final String COMPILE_VIDEO_ENCODER_NAME = "video encoder name"
 Assigned video encoding format, hevc(h.256) is supported. More...
 
static final String COMPILE_USE_OPERATING_RATE = "use operating rate"
 
Error flags for capture device

static final int CAPTURE_DEVICE_ERROR_UNKNOWN = 1
 Unknown error with the capturing device. More...
 
static final int CAPTURE_DEVICE_ERROR_SERVER_DIED = 2
 Capture device's error, the server died. More...
 
Size mode for preview

static final int VIDEO_PREVIEW_SIZEMODE_FULLSIZE = 0
 Full-screen preview mode. More...
 
static final int VIDEO_PREVIEW_SIZEMODE_LIVEWINDOW_SIZE = 1
 Livewindow size preview mode. More...
 
Video capture flag

static final int STREAMING_ENGINE_CAPTURE_FLAG_GRAB_CAPTURED_VIDEO_FRAME = 1
 Grabs frame from captured video (turnning on this flag would affect performance, turn on only when neccessary) More...
 
static final int STREAMING_ENGINE_CAPTURE_FLAG_DONT_USE_SYSTEM_RECORDER = 4
 Not using the system built-in recorder to record. More...
 
static final int STREAMING_ENGINE_CAPTURE_FLAG_STRICT_PREVIEW_VIDEO_SIZE = 8
 Resticts the preview video's size to system's built-in preview video size. More...
 
static final int STREAMING_ENGINE_CAPTURE_FLAG_DONT_CAPTURE_AUDIO = 16
 Does not record audio. More...
 
static final int STREAMING_ENGINE_CAPTURE_FLAG_CAPTURE_BUDDY_HOST_VIDEO_FRAME = 32
 Records buddy video frame. More...
 
static final int STREAMING_ENGINE_CAPTURE_FLAG_FACE_ACTION_WITH_PARTICLE = 256
 Uses face action to control particle special effects. More...
 
static final int STREAMING_ENGINE_CAPTURE_FLAG_LOW_PIPELINE_SIZE = 512
 
Video anti-shake mode

static final int VIDEO_STABILIZATION_MODE_OFF = 0
 Turns off the video anti-shake mode. More...
 
static final int VIDEO_STABILIZATION_MODE_AUTO = 1
 Sets on/off of the video stabilization mode to auto. More...
 
static final int VIDEO_STABILIZATION_MODE_STANDARD = 2
 Standard mode for video anti-shake mode. More...
 
static final int VIDEO_STABILIZATION_MODE_SUPER = 3
 
Recording flags

static final int STREAMING_ENGINE_RECORDING_FLAG_VIDEO_INTRA_FRAME_ONLY = 2
 Records files that only include I-Frame. (Note: only works when using with STREAMING_ENGINE_CAPTURE_FLAG_DONT_USE_SYSTEM_RECORDER) More...
 
static final int STREAMING_ENGINE_RECORDING_FLAG_DISABLE_HARDWARE_ENCODER = 4
 Records without hardware encoder. More...
 
static final int STREAMING_ENGINE_RECORDING_FLAG_SOFTWARE_VIDEO_INTRA_FRAME_ONLY_FAST_STOP = 8
 Fast stop when recording I-Frame-only video with software encoder, this could result in a discard of video frame. More...
 
static final int STREAMING_ENGINE_RECORDING_FLAG_ONLY_RECORD_VIDEO = 16
 Only records video streams to file, all audio streams would not be recorded. More...
 
static final int STREAMING_ENGINE_RECORDING_FLAG_IGNORE_VIDEO_ROTATION = 32
 Video recorded is not rotated according to the capture device's orientation. (Note: only workds with STREAMING_ENGINE_CAPTURE_FLAG_DONT_USE_SYSTEM_RECORDER) More...
 
static final int STREAMING_ENGINE_RECORDING_FLAG_DONT_USE_INPUT_SURFACE = 64
 
Engine seek flag

static final int STREAMING_ENGINE_SEEK_FLAG_SHOW_CAPTION_POSTER = 2
 Shows the entire caption effects. More...
 
static final int STREAMING_ENGINE_SEEK_FLAG_SHOW_ANIMATED_STICKER_POSTER = 4
 Shows the entire animated sticker effects. More...
 
Engine playback flag

static final int STREAMING_ENGINE_PLAYBACK_FLAG_LOW_PIPELINE_SIZE = 8
 Decreases the pipeline size of playback engine. More...
 
static final int STREAMING_ENGINE_PLAYBACK_FLAG_DISABLE_FIXED_PREROLL_TIME = 16
 
Engine compile flag

static final int STREAMING_ENGINE_COMPILE_FLAG_DISABLE_HARDWARE_ENCODER = 1
 Disables the hardware encoder. More...
 
static final int STREAMING_ENGINE_COMPILE_FLAG_DONT_USE_INPUT_SURFACE = 2
 Not using input surface. More...
 
static final int STREAMING_ENGINE_COMPILE_FLAG_ONLY_VIDEO = 4
 Generate file only with video stream. More...
 
static final int STREAMING_ENGINE_COMPILE_FLAG_ONLY_AUDIO = 8
 Generate file only with audio stream. More...
 
Engine stop flag

static final int STREAMING_ENGINE_STOP_FLAG_FORCE_STOP_COMPILATION = 1
 Forces stop of compilation, resulting compiled file incomplete. More...
 
static final int STREAMING_ENGINE_STOP_FLAG_ASYNC = 2
 
Engine playback exception type

static final int STREAMING_ENGINE_PLAYBACK_EXCEPTION_TYPE_MEDIA_FILE_ERROR = 0
 Media file error. More...
 
Hardware error type

static final int STREAMING_ENGINE_HARDWARE_ERROR_TYPE_VIDEO_ENCODER_SETUP_ERROR = 0
 
static final int STREAMING_ENGINE_HARDWARE_ERROR_TYPE_VIDEO_ENCODING_ERROR = 1
 
static final int STREAMING_ENGINE_HARDWARE_ERROR_TYPE_VIDEO_DECODER_SETUP_ERROR = 2
 
static final int STREAMING_ENGINE_HARDWARE_ERROR_TYPE_VIDEO_DECODING_ERROR = 3
 
Rotation angle of input buffer image

static final int BUFFER_IMAGE_ROTATION_0 = 0
 
static final int BUFFER_IMAGE_ROTATION_90 = 1
 
static final int BUFFER_IMAGE_ROTATION_180 = 2
 
static final int BUFFER_IMAGE_ROTATION_270 = 3
 
Human detection characteristics

static final int HUMAN_DETECTION_FEATURE_FACE_LANDMARK = 1
 Landmarks on human face. More...
 
static final int HUMAN_DETECTION_FEATURE_FACE_ACTION = 2
 
Type of human detection data pack

static final int HUMAN_DETECTION_DATA_TYPE_FAKE_FACE = 0
 
Engine sends buffer flag

static final int STREAMING_ENGINE_SEND_BUFFER_FLAG_ONLY_FOR_GRAB = 1
 
static final int STREAMING_ENGINE_SEND_BUFFER_FLAG_ONLY_FOR_BUDDY = 2
 
Speical flags when capturing video and audio information

static final int AV_FILEINFO_EXTRA_NULL = 0
 
static final int AV_FILEINFO_EXTRA_PIXELFORMAT = 1
 

Detailed Description

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.

Warning
For NvsStreamingContext class, all public APIs must be used in the UI thread except getAVFileInfo(), detectVideoFileKeyframeInterval(),createVideoFrameRetriever(), which can be used across threads.

Member Function Documentation

NvsCaptureVideoFx com.meicam.sdk.NvsStreamingContext.appendBeautyCaptureVideoFx ( )
inline

Appends a beauty effect.

Returns
Returns the Appended NvsCaptureVideoFx object.
See also
insertBeautyCaptureVideoFx
NvsCaptureVideoFx com.meicam.sdk.NvsStreamingContext.appendBuiltinCaptureVideoFx ( String  videoFxName)
inline

Appends a built-in capture video effect.

Parameters
videoFxNameVideo effect name. To get the video effect name, please refer to getAllBuiltinCaptureVideoFxNames() or The List of Built-in Effect Name.
Returns
Returns the appended NvsCaptureVideoFx object.
See also
insertBuiltinCaptureVideoFx
NvsCaptureVideoFx com.meicam.sdk.NvsStreamingContext.appendCustomCaptureVideoFx ( NvsCustomVideoFx.Renderer  customVideoFxRender)
inline

Appends a custom capture video effect.

Parameters
customVideoFxRenderInterface of user-implemented custom video effect renderer
Returns
Returns the appended NvsCaptureVideoFx object.
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.
Since
1.7.0
NvsCaptureVideoFx com.meicam.sdk.NvsStreamingContext.appendPackagedCaptureVideoFx ( String  videoFxPackageId)
inline

Appends a package capture effectx.

Parameters
videoFxPackageIdVideo effect package ID
Returns
Returns the appended NvsCaptureVideoFx object.
See also
insertPackagedCaptureVideoFx
boolean com.meicam.sdk.NvsStreamingContext.applyCaptureScene ( String  captureSceneId)
inline

Apply a capture scene resource package to the capture device.

Parameters
captureSceneIdThe ID of capture scene resource package
Returns
Returns a BOOL value. A value of YES will result in a successful application and NO means it fails to apply.
Since
1.2.0
See also
getCurrentCaptureSceneId
removeCurrentCaptureScene
void com.meicam.sdk.NvsStreamingContext.cancelAutoFocus ( )
inline

Cancels the ongoing autofocus.

See also
startAutoFocus
boolean com.meicam.sdk.NvsStreamingContext.checkDontSetCameraParamOnRecordingWithSystemRecorder ( )
inline

Checks if the camera's parameters cannot be set when recording with system recorder.

For certain Android mobile phones, when recording with system built-in recorders, if one set cameras' parameters (for instance the exposure compensation or autofocus), the recorded video will have problems or the recording cannot be stopped. To avoid this kind of problems, the Meishe SDK keeps a blacklist of unwantted Android phones. If a phone is in the blacklist, any setting of the parameters while recording will be ignored. This method is used to check if current phone used is in the blacklist. If yes, the user may have to make certain adjustment to the recording interface, say disabling the exposure compensation button. Note: if the user does not use the system built-in recorder when recording, then the blacklist will not work.

Since
1.4.1
void com.meicam.sdk.NvsStreamingContext.clearCachedResources ( boolean  asynchronous)
inline

Clears cached resources.

Parameters
asynchronousWhether to set it to asynchronous mode
static void com.meicam.sdk.NvsStreamingContext.close ( )
inlinestatic

Destroys the streaming context object instance. note: it can be created again after destruction.

See also
init
getInstance
static void com.meicam.sdk.NvsStreamingContext.closeHumanDetection ( )
inlinestatic

Turns off the human detection mechanism.

Since
2.5.0
boolean com.meicam.sdk.NvsStreamingContext.compileTimeline ( NvsTimeline  timeline,
long  startTime,
long  endTime,
String  outputFilePath,
int  videoResolutionGrade,
int  videoBitrateGrade,
int  flags 
)
inline

Compiles timeline into a file.

Parameters
timelineTimeline
startTimeStart time in microseconds. Start time should be in the range of [0, timeline.duration-1], other input value is invalid.
endTimeEnd time in microseconds. End time should be within [startTime,timeline.duration], other values are invalid.
outputFilePathThe path of output file.
videoResolutionGradeResolution grade of the output file. please refer to compile video resolution grade
videoBitrateGradeBitrate of the file compiled. Please refer to compile bitrate grade. The output bitrate can be low-bitrate, medium-bitrate or high-bitrate. The specific bitrate of video compiled is correlated with compiled file's resolution. Taking a 1280*720 pixels video for example, the approximate bitrate of low grade is 2.2Mbps, with 3.3Mbps for medium grade and 6.7Mbps for high grade.
flagsSpecial flags for output file. If there is no special requirements please input 0. Please refer to streaning engine compile flag.
Returns
Returns a boolean value. Note: compiling timeline to file is an asynchronous operation. Returns true if compile is successful and false if compile fails.
Warning
This interface will trigger streaming engine to jump to stop state. For detailed situations please refer to the state changes of engine.
See also
seekTimeline
playbackTimeline
boolean com.meicam.sdk.NvsStreamingContext.connectCapturePreviewWithLiveWindow ( NvsLiveWindow  liveWindow)
inline

Connects the captured preview with live window.

Parameters
liveWindowLive window for previewing
Returns
Returns the boolean value. YES indicates a successful connection, and NO means the opposite.
See also
connectTimelineWithLiveWindow
boolean com.meicam.sdk.NvsStreamingContext.connectCapturePreviewWithLiveWindowExt ( NvsLiveWindowExt  liveWindow)
inline

Connects the captured preview with live window(based on TextureView)

Parameters
liveWindowLive window for previewing
Returns
Returns the boolean value. YES indicates a successful connection, and NO means the opposite.
See also
connectTimelineWithLiveWindowExt
Since
1.15.0
boolean com.meicam.sdk.NvsStreamingContext.connectCapturePreviewWithSurfaceTexture ( SurfaceTexture  outputSurfaceTexture)
inline

Connects a capture preview with a SurfaceTexture object. The capture preview's rendering result will be output to this SurfaceTexture object.

Parameters
outputSurfaceTextureThe SurfaceTexture object which rendering result will be output.
Returns
Returns a boolean value, true means connection succeeded and false means it failed.
Since
1.7.1
boolean com.meicam.sdk.NvsStreamingContext.connectTimelineWithLiveWindow ( NvsTimeline  timeline,
NvsLiveWindow  liveWindow 
)
inline

Connects timeline with the LiveWindow.

Parameters
timelineTimeline
liveWindowPreview image window in real time
Returns
Returns a boolean value, true means a successful connection and false means failure
boolean com.meicam.sdk.NvsStreamingContext.connectTimelineWithLiveWindowExt ( NvsTimeline  timeline,
NvsLiveWindowExt  liveWindow 
)
inline

Connects timeline with the LiveWindow (based on TextureView)

Parameters
timelineTimeline
liveWindowPreview image window in real time
Returns
Returns a boolean value, true means a successful connection and false means failure
Since
1.15.0
boolean com.meicam.sdk.NvsStreamingContext.connectTimelineWithSurfaceTexture ( NvsTimeline  timeline,
SurfaceTexture  outputSurfaceTexture 
)
inline

Connects timeline with a SurfaceTexture, of which the rendering outcome of the timeline will be output to this SurfaceTexture.

Parameters
timelineTimeline
outputSurfaceTextureThe SurfaceTexture object that rendering outcome output to
Returns
Returns a boolean value. true means a successful connection and false means failure
Since
1.5.0
boolean com.meicam.sdk.NvsStreamingContext.connectTimelineWithSurfaceTexture ( NvsTimeline  timeline,
SurfaceTexture  outputSurfaceTexture,
NvsRational  proxyScale 
)
inline

Connects timeline with SurfaceTexture and set the proxy scale. The timeline's rendering outcome will be output to this SurfaceTexture.

Parameters
timelineTimeline
outputSurfaceTextureThe SurfaceTexture object that rendering outcome output to
proxyScaleScale of proxy
Returns
Returns a boolean value, true means a successful connection and false means failure
Since
1.6.0
NvsTimeline com.meicam.sdk.NvsStreamingContext.createTimeline ( NvsVideoResolution  videoEditRes,
NvsRational  videoFps,
NvsAudioResolution  audioEditRes 
)
inline

Creates timeline.

Parameters
videoEditResVideo file's resolution (specified width to height ratio). For video editting 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 editting, then video editting's resolution cannot be higher then 3840*2160(imageWidth*imageHeight), otherwise the imageWidth*imageHeight cannot exceed 1920* 1080 pixels.
videoFpsFrame rate
audioEditResAudio file's resolution(specified file sampling rate, sampling format and number of channels. For audio editting resolution, imported audio only supports two types of sampling rate, 44100 or 48000.)
Returns
Returns created timeline object
See also
removeTimeline
NvsVideoFrameRetriever com.meicam.sdk.NvsStreamingContext.createVideoFrameRetriever ( String  videoFilePath)
inline

Creates an object of video frame retriever.

Parameters
videoFilePathPath of the original video
Returns
Returns an NvsVideoFrameRetriever object representing the video frame retriever object.
Since
1.2.0
float com.meicam.sdk.NvsStreamingContext.detectEngineRenderFramePerSecond ( )
inline

从流媒体上下文中获取引擎当前的渲染速度,只在StartCapturePreview和PlaybackTimeline之后有效

Returns
返回值表示当前的渲染速度
Since
2.8.0
int com.meicam.sdk.NvsStreamingContext.detectVideoFileKeyframeInterval ( String  videoFilePath)
inline

Detects video file's I-Frame interval.

Parameters
videoFilePathFile path of the vidio file
Returns
Returns the detected interval of I-Frame, returns 0 means detection failed
Since
1.6.0
List<String> com.meicam.sdk.NvsStreamingContext.getAllBuiltinAudioFxNames ( )
inline

Gets the list of all built-in audio effect names.

Returns
Returns a list which containing all the built-in audio effects’ names.
See also
getAllBuiltinVideoFxNames
List<String> com.meicam.sdk.NvsStreamingContext.getAllBuiltinCaptureVideoFxNames ( )
inline

Gets the list of all built-in capture video effects’ names.

Returns
Returns a list which containing all built-in capture video effects’ names.
See also
getBeautyVideoFxName
getAllBuiltinVideoFxNames
List<String> com.meicam.sdk.NvsStreamingContext.getAllBuiltinVideoFxNames ( )
inline

Gets the list of all built-in video effect names.

Returns
Returns a list which containing all the built-in video effects’ names.
See also
getAllBuiltinAudioFxNames
List<String> com.meicam.sdk.NvsStreamingContext.getAllBuiltinVideoTransitionNames ( )
inline

Gets the list of all built-in video transitions’ names.

Returns
Returns a list which containing all built-in video transitions’ names.
See also
getAllBuiltinCaptureVideoFxNames
getBeautyVideoFxName
getDefaultVideoTransitionName
NvsAREffectContext com.meicam.sdk.NvsStreamingContext.getAREffectContext ( )
inline

Gets the face effect context.

Since
1.17.0
NvsAssetPackageManager com.meicam.sdk.NvsStreamingContext.getAssetPackageManager ( )
inline

Gets resource package manager.

Returns
Returns resource package manager object.
NvsFxDescription com.meicam.sdk.NvsStreamingContext.getAudioFxDescription ( String  fxName)
inline

Gets the description of an audio effect.

Parameters
fxNameAudio effect’s name
Returns
Returns the object of the audio effect description.
See also
getVideoFxDescription
NvsAVFileInfo com.meicam.sdk.NvsStreamingContext.getAVFileInfo ( String  avFilePath)
inline

Gets detailed information of the audio/video file.

Parameters
avFilePathFile path of the audio/video file
Returns
Returns the audio/video information
NvsAVFileInfo com.meicam.sdk.NvsStreamingContext.getAVFileInfo ( String  avFilePath,
int  extraFlag 
)
inline

Gets detailed information of the audio/video file.

Parameters
avFilePathFile path of the audio/video file
extraFlagGet extra information of the audio/video file. please refer to AV_FILEINFO_EXTRA
Returns
Returns the audio/video file information object
String com.meicam.sdk.NvsStreamingContext.getBeautyVideoFxName ( )
inline

Gets the name of beauty effect.

Returns
Returns the name of beauty effect.
See also
getAllBuiltinVideoFxNames
getAllBuiltinCaptureVideoFxNames
CaptureDeviceCapability com.meicam.sdk.NvsStreamingContext.getCaptureDeviceCapability ( int  captureDeviceIndex)
inline

Gets the capability description object of the capture device.

Parameters
captureDeviceIndexIndex of capturing device
Returns
Returns the NvsCaptureDeviceCapability object.
int com.meicam.sdk.NvsStreamingContext.getCaptureDeviceCount ( )
inline

Number of capture device.

Returns
Returns the number of capture device
See also
isCaptureDeviceBackFacing
NvsSize com.meicam.sdk.NvsStreamingContext.getCapturePreviewVideoSize ( int  captureDeviceIndex)
inline

Gets the capture preview resolution.

Parameters
captureDeviceIndexIndex of capturing device
Returns
Gets the capture preview resolution.
Since
1.7.1
NvsCaptureVideoFx com.meicam.sdk.NvsStreamingContext.getCaptureVideoFxByIndex ( int  captureVideoFxIndex)
inline

Gets a certain capture video effect.

Parameters
captureVideoFxIndexVideo effect index
Returns
Returns the NvsCaptureVideoFx object.
See also
removeCaptureVideoFx
int com.meicam.sdk.NvsStreamingContext.getCaptureVideoFxCount ( )
inline

Gets the count of video effects.

Returns
Returns the count of video effects.
Hashtable<String, Object> com.meicam.sdk.NvsStreamingContext.getCompileConfigurations ( )
inline

Gets configurations for compiling timeline.

Returns
Returns the configurations. If no configurations is set, ruturns a hashtable with no object. For key values in hashtable please refer to Configuration of compiling timeline.
See also
setCompileConfigurations
float com.meicam.sdk.NvsStreamingContext.getCompileVideoBitrateMultiplier ( )
inline

Get the rate multiplier for compiling video.

Since
1.5.0
See also
setCompileVideoBitrateMultiplier
String com.meicam.sdk.NvsStreamingContext.getCurrentCaptureSceneId ( )
inline

Gets the ID of the current capture scene resource package.

Returns
Retruns the current ID of the capture scene resource package. nil indicates that there is no capture scene resource package for now.
Since
1.2.0
See also
applyCaptureScene
removeCurrentCaptureScene
int com.meicam.sdk.NvsStreamingContext.getCustomCompileVideoHeight ( )
inline

Gets the customized video height.

Returns
Returns the customized video height.
Since
1.6.1
String com.meicam.sdk.NvsStreamingContext.getDefaultThemeEndingLogoImageFilePath ( )
inline

Gets the file path of the default ending logo.

Returns
Returns the file path of the default ending logo
See also
setDefaultThemeEndingLogoImageFilePath
String com.meicam.sdk.NvsStreamingContext.getDefaultVideoTransitionName ( )
inline

Gets the default video transition’s name.

Returns
Returns a string representing the default transition’s name.
See also
getAllBuiltinVideoTransitionNames
int com.meicam.sdk.NvsStreamingContext.getExposureCompensation ( )
inline

Gets exposure compensation.

Returns
Returns exposure compensation value
See also
setExposureCompensation
static NvsStreamingContext com.meicam.sdk.NvsStreamingContext.getInstance ( )
inlinestatic

Gets the instance of streaming context object (only can use this after initialization)

Returns
Returns the streaming context object instance.
See also
init
close
float com.meicam.sdk.NvsStreamingContext.getRecordVideoBitrateMultiplier ( )
inline

Get the rate multiplier for recording video.

Since
1.5.0
See also
setRecordVideoBitrateMultiplier
SdkVersion com.meicam.sdk.NvsStreamingContext.getSdkVersion ( )
inline

Obtains Meishe SDK's version information.

Returns
Returns the object about Meishe SDK's version information.
Since
1.4.1
int com.meicam.sdk.NvsStreamingContext.getStreamingEngineState ( )
inline

Gets streaming engine's state.

Returns
Returns streaming engine's state. please refer to The flags of streaming engine state
long com.meicam.sdk.NvsStreamingContext.getTimelineCurrentPosition ( NvsTimeline  timeline)
inline

Gets the current positon of the timeline (in microseconds)

Parameters
timelineTimeline
Returns
Returns the current position of the timeline
See also
seekTimeline
NvsFxDescription com.meicam.sdk.NvsStreamingContext.getVideoFxDescription ( String  fxName)
inline

Gets the description of a video effect.

Parameters
fxNameVideo effect’s name
Returns
Returns the object of the video effect description.
See also
getAudioFxDescription
int com.meicam.sdk.NvsStreamingContext.getVideoStabilization ( )
inline

Gets the current video’s stabilization flag.

Returns
Returns the current flag.Please refer to Flag of stabilization.
See also
setVideoStabilization
int com.meicam.sdk.NvsStreamingContext.getZoom ( )
inline

Gets the zoom factor.

Returns
Returns zoom factor value.
See also
setZoom
Bitmap com.meicam.sdk.NvsStreamingContext.grabImageFromTimeline ( NvsTimeline  timeline,
long  timestamp,
NvsRational  proxyScale 
)
inline

Gets the specific frame in timeline with a specific timestamp. For details please refer to The video frame retriever .

Parameters
timelineThe timeline that will be grabbed from.
timestampThe 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.
proxyScaleZoom scale of proxy
Returns
Returns the frame's Bitmap object which the timestamp corresponding to, returns null if grabbing frame failed.
Since
1.1.2
Bitmap com.meicam.sdk.NvsStreamingContext.grabImageFromTimeline ( NvsTimeline  timeline,
long  timestamp,
NvsRational  proxyScale,
int  flags 
)
inline

Gets the specific frame in timeline with a specific timestamp. For details please refer to The video frame retriever.

Parameters
timelineThe timeline that will be grabbed from.
timestampThe 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.
proxyScaleZoom scale of proxy
flagsFlags for streaming engine seeking. For specific please refer to The seek flag of streaming engine.
Returns
Returns the frame's Bitmap object the timestamp corresponding to, returns null if grabbing frame failed.
Since
1.16.0
static int com.meicam.sdk.NvsStreamingContext.hasARModule ( )
inlinestatic

Checks if current SDK has an AR module.

Returns
Return value tells whether it has an AR module.
Since
2.5.0
static NvsStreamingContext com.meicam.sdk.NvsStreamingContext.init ( Context  ctx,
String  sdkLicenseFilePath,
int  flags 
)
inlinestatic

Initializes streaming context instance.

Parameters
ctxAndroid context object.
sdkLicenseFilePathSpecified SDK license file path.
flagsFlags, 0 if no special requirement, please refer to (STREAMING_CONTEXT_FLAG).
Returns
Returns a streaming context instance object.
Since
2.0.1
See also
getInstance
close
static NvsStreamingContext com.meicam.sdk.NvsStreamingContext.init ( Activity  mainActivity,
String  sdkLicenseFilePath,
int  flags 
)
inlinestatic

Initializes the instance of streaming context object. for more please refer to (4k video editing).

Parameters
mainActivityMain activity object from android.
sdkLicenseFilePathSpecified SDK license file path.
flagsFlags filed, 0 if no special demand, please refer to [STREAMING_CONTEXT_FLAG].
Returns
Returns a streaming context instance object.
Since
1.5.0
See also
getInstance
close
static NvsStreamingContext com.meicam.sdk.NvsStreamingContext.init ( Activity  mainActivity,
String  sdkLicenseFilePath 
)
inlinestatic

Initializes an instance of streaming context object.

Parameters
mainActivityMain activity object from android.
sdkLicenseFilePathSpecified SDK license file path.
Returns
Returns the streaming context instance object.
See also
getInstance
close
static boolean com.meicam.sdk.NvsStreamingContext.initHumanDetection ( Context  ctx,
String  modelFilePath,
String  licenseFilePath,
int  features 
)
inlinestatic

Initializes human detection mechanism.

Parameters
ctxThe context object from android.
modelFilePathThe path of face modle file.
licenseFilePathThe path of authorization file.
featuresHuman detection features field, please refer to [HUMAN_DETECTION_FEATURE_FACE_LANDMARK].
Returns
Returns a value represent if it succeeded.
Since
2.5.0
NvsCaptureVideoFx com.meicam.sdk.NvsStreamingContext.insertBeautyCaptureVideoFx ( int  insertPosition)
inline

Inserts a skin beauty video effect.

Parameters
insertPositionInsertion position
Returns
Returns the inserted NvsCaptureVideoFx object.
See also
appendBeautyCaptureVideoFx
NvsCaptureVideoFx com.meicam.sdk.NvsStreamingContext.insertBuiltinCaptureVideoFx ( String  videoFxName,
int  insertPosition 
)
inline

Inserts a built-in video capture effect.

Parameters
videoFxNameVideo effect name. To get the video effect name, please refer to getAllBuiltinCaptureVideoFxNames() or The List of Built-in Effect Name.
insertPositionInsertion position.
Returns
Returns the inserted NvsCaptureVideoFx object.
See also
appendBuiltinCaptureVideoFx
NvsCaptureVideoFx com.meicam.sdk.NvsStreamingContext.insertCustomCaptureVideoFx ( NvsCustomVideoFx.Renderer  customVideoFxRender,
int  insertPosition 
)
inline

Inserts a custom capture video effect.

Parameters
customVideoFxRenderInterface of user-implemented custom video effect renderer
insertPositionInsertion position
Returns
Returns the inserted NvsCaptureVideoFx object.
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.
Since
1.7.0
NvsCaptureVideoFx com.meicam.sdk.NvsStreamingContext.insertPackagedCaptureVideoFx ( String  videoFxPackageId,
int  insertPosition 
)
inline

Inserts a package capture effect.

Parameters
videoFxPackageIdVideo effect package ID
insertPositionInsertion position
Returns
Returns the inserted NvsCaptureVideoFx object.
See also
appendPackagedCaptureVideoFx
boolean com.meicam.sdk.NvsStreamingContext.isCaptureDeviceBackFacing ( int  captureDeviceIndex)
inline

Whether it's a rear capturing device.

Parameters
captureDeviceIndexIndex of capturing device
Returns
Returns boolean value. YES means it is a rear capture device, and NO means the opposite.
boolean com.meicam.sdk.NvsStreamingContext.isDefaultCaptionFade ( )
inline

gets whether default caption mode is fade in and fade out.

Returns
Returns whether is fade in and fade out.
Since
1.8.0
See also
setDefaultCaptionFade
boolean com.meicam.sdk.NvsStreamingContext.isFlashOn ( )
inline

get state of the flash light.

Returns
Returns a boolean value, true means flash light is on and false means off.
See also
toggleFlash
boolean com.meicam.sdk.NvsStreamingContext.isRecordingPaused ( )
inline

Checks if the recording has been paused.

Returns
Returns a boolean value. If the value is YES, the recording has been paused, and NO means it's not paused.
Since
1.17.0
See also
pauseRecording
resumeRecording
boolean com.meicam.sdk.NvsStreamingContext.isSdkAuthorised ( )
inline

Checks if sdk is authorized.

boolean com.meicam.sdk.NvsStreamingContext.pauseRecording ( )
inline

Pause to record. Resuming recording after a pause will output the recorded video to the same file. Note: Recording can only be paused without using the built-in recorder!

Returns
Returns a boolean value. A value of YES pause to record successfully and NO means it fails to pause.
Since
1.17.0
See also
resumeRecording
boolean com.meicam.sdk.NvsStreamingContext.playbackTimeline ( NvsTimeline  timeline,
long  startTime,
long  endTime,
int  videoSizeMode,
boolean  preload,
int  flags 
)
inline

Timeline playback.

Parameters
timelineTimeline
startTimeStart 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.
endTimeEnd time(in microseconds). If endtime input is a negative value, then the playback is defaultly set to play till the end.
videoSizeModeIf no special requirements please input 0. Please refer to The video preview sizemode for reference.
preloadWhether to preload
flagsFlags for preview. If no special requirements please input 0. Please refer to The Streaming engine playback flags for reference.
Returns
Returns a boolean value. Note: timeline playback is an asynchronous operation, it returns true if timeline playback can be turned on.
Warning
This interface will trigger streaming engine to jump to stop state. For detailed situations please refer to The engine change.
See also
seekTimeline
compileTimeline
boolean com.meicam.sdk.NvsStreamingContext.playbackTimeline ( NvsTimeline  timeline,
long  startTime,
long  endTime,
NvsRational  proxyScale,
boolean  preload,
int  flags 
)
inline

Timeline playback.

Parameters
timelineTimeline
startTimeStart 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.
endTimeEnd time(in microseconds). If endtime input is a negative value, then the playback is defaultly set to play till the end.
proxyScaleZoom scale of proxy
preloadWhether to preload
flagsFlags for preview. If no special requirements please input 0. Please refer to The Streaming engine playback flags
Returns
Returns a boolean value. Note: timeline playback is an asynchronous operation, it returns true if timeline playback can be turned on.
Warning
This interface will trigger streaming engine to jump to stop state. For detailed situations please refer to The engine change.
See also
seekTimeline
compileTimeline
String com.meicam.sdk.NvsStreamingContext.registerFontByFilePath ( String  fontFilePath)
inline

Gets font file's fontFamily.

Parameters
fontFilePathFont file path
Returns
Returns font file's fontFamily information
void com.meicam.sdk.NvsStreamingContext.removeAllCaptureVideoFx ( )
inline

Removes all capture video effects.

See also
removeCaptureVideoFx
getCaptureVideoFxCount
boolean com.meicam.sdk.NvsStreamingContext.removeCaptureVideoFx ( int  captureVideoFxIndex)
inline

Removes a certain capture video effect indicated by its index.

Parameters
captureVideoFxIndexVideo effect index
Returns
Returns a boolean value. If it is YES, the removal is successful, and NO means failure.
See also
appendBuiltinCaptureVideoFx
appendPackagedCaptureVideoFx
appendBeautyCaptureVideoFx
void com.meicam.sdk.NvsStreamingContext.removeCurrentCaptureScene ( )
inline

Removes the current capture scene.

Since
1.2.0
See also
applyCaptureScene
getCurrentCaptureSceneId
boolean com.meicam.sdk.NvsStreamingContext.removeTimeline ( NvsTimeline  timeline)
inline

Removes timeline.

Parameters
timelineThe timeline to be removed
Returns
Returns a boolean value. true means a successful remove, false means failure.
Warning
This interface will trigger streaming engine to jump to stop state. For detailed situations please refer to The engine change.
See also
createTimeline
void com.meicam.sdk.NvsStreamingContext.removeUserWatermarkForCapture ( )
inline

Removes custom watermark which added for capturing video.

Since
2.0.1
boolean com.meicam.sdk.NvsStreamingContext.resumeRecording ( )
inline

Continues to record. Continuing recording will output the recorded video to the same media file, to which the recording before suspend outputs contents.

Returns
Returns a boolean value. A value of YES means it continues recording successfully and NO means it fails to continue.
Since
1.17.0
See also
pauseRecording
NvsColor com.meicam.sdk.NvsStreamingContext.sampleColorFromCapturedVideoFrame ( RectF  sampleRect)
inline

Samples the capture device's video frame.

Parameters
sampleRectRectangular area to sample, of which coordinates are in livewindow's coordinate system
Returns
Returns the NvsColor object. This color value is the average color value of all pixels in sampled rectangular area.
Since
1.2.0
boolean com.meicam.sdk.NvsStreamingContext.seekTimeline ( NvsTimeline  timeline,
long  timestamp,
int  videoSizeMode,
int  flags 
)
inline

定位某一时间戳的图像

Parameters
timeline时间线
timestamp时间戳(单位微秒)。timestamp取值范围在[0,timeline.duration - 1]。传入其他值无效,seekTimeline会返回false,导致无法开启定位。
videoSizeMode图像预览模式。请参见视频大小预览模式
flags引擎定位的特殊标志。具体参见引擎定位标识
Returns
返回布尔值。注意:定位某时间戳图像是异步操作。返回true则成功开启定位,false则无法开启定位。
Warning
此接口会引发流媒体引擎状态跳转到引擎停止状态,具体情况请参见引擎变化专题
See also
playbackTimeline
compileTimeline
boolean com.meicam.sdk.NvsStreamingContext.seekTimeline ( NvsTimeline  timeline,
long  timestamp,
NvsRational  proxyScale,
int  flags 
)
inline

Seeking the frame at a specific timestamp.

Parameters
timelineTimeline
timestampTimestamp(in microseconds). Timestamp should be in the range of [0,timeline.duration - 1]. Other input values are invalid and seeking timeline will return false, results seeking cannot be turned on.
proxyScaleZoom scale of proxy
flagsFlags for streaming engine seeking. For specific please refer toseeking flags of streaming engine
Returns
Returns a boolean value. Note: Seeking to a specific timestamp is an asynchronous operation, it returns true is refer seeking is successfully turned on, false means seeking cannot be turned on.
Warning
This interface will trigger streaming engine to jump to stop state. For detailed situations please refer to The engine change.
See also
playbackTimeline
compileTimeline
boolean com.meicam.sdk.NvsStreamingContext.sendBufferToCapturePreview ( byte[]  data,
long  streamTime 
)
inline

Transfers the input buffer to capture preivew.

Parameters
dataThe byte array to send to buffer, only NV21 is supported.
streamTimeTimestamp of the input buffer
Returns
Returns boolean value.
See also
startBufferCapturePreview
boolean com.meicam.sdk.NvsStreamingContext.sendBufferToCapturePreview ( byte[]  data,
long  streamTime,
int  flags 
)
inline

Sends buffer to the capture preview.

Parameters
dataThe byte array to send to buffer, only NV21 is supported.
streamTimeTimestamp of the input buffer
flagsflag value
Returns
Returns boolean value.
See also
startBufferCapturePreview
void com.meicam.sdk.NvsStreamingContext.setAutoExposureRect ( RectF  exposureRect)
inline

Set the auto exposure detection area.

Parameters
exposureRectAutomatic exposure detection area, the coordinates are the real-time preview window's own coordinate system.
Since
1.15.1
void com.meicam.sdk.NvsStreamingContext.setCaptureDeviceCallback ( CaptureDeviceCallback  cb)
inline

Sets callback interface for capturing device.

Parameters
cbCallback interface for capturing device.
void com.meicam.sdk.NvsStreamingContext.setCapturedVideoFrameGrabberCallback ( CapturedVideoFrameGrabberCallback  cb)
inline

Sets callback interface for getting capture preview frame.

Parameters
cbCallback interface for getting capture preview frame
void com.meicam.sdk.NvsStreamingContext.setCaptureRecordingDurationCallback ( CaptureRecordingDurationCallback  cb)
inline

Sets callback interface of recording duration.

Parameters
cbCallback interface for recording duration
Since
1.17.0
void com.meicam.sdk.NvsStreamingContext.setCaptureRecordingStartedCallback ( CaptureRecordingStartedCallback  cb)
inline
void com.meicam.sdk.NvsStreamingContext.setCompileCallback ( CompileCallback  cb)
inline

Sets callback interface for timeline file compilation.

Parameters
cbCallback interface for timeline file compilation
void com.meicam.sdk.NvsStreamingContext.setCompileCallback2 ( CompileCallback2  cb)
inline

Sets the second callback interface for timeline file compilation.

Parameters
cbThe second callback socket for timeline file compilation
Since
1.6.0
void com.meicam.sdk.NvsStreamingContext.setCompileConfigurations ( Hashtable< String, Object >  compileConfigurations)
inline

Sets the timeline configurations, which stay valid once set.

Parameters
compileConfigurationsCompile timeline configurations. For key values in Hashtable please refer to Configuration of compiling timeline.for example:
        Hashtable<String, Object> config = new Hashtable<>();
        config.put(NvsStreamingContext.COMPILE_GOP_SIZE, 15); //If set to 1 then a I-frame-only video is compiled. (Note: some android phones cannot compile I-frame-only video. In this case,please use STREAMING_ENGINE_COMPILE_FLAG_DISABLE_HARDWARE_ENCODER to encode)
        config.put(NvsStreamingContext.COMPILE_BITRATE, 10000000); // 10M bps
        config.put(NvsStreamingContext.COMPILE_AUDIO_BITRATE, 320000); //  Sets audio bitrate to 320Kbps.
        config.put(NvsStreamingContext.COMPILE_LOSSLESS_AUDIO, true); // Sets audio to lossless.
        config.put(NvsStreamingContext.COMPILE_OPTIMIZE_FOR_NETWORK_USE, true); // Sets index table to prepose.
        config.put(NvsStreamingContext.COMPILE_USE_OPERATING_RATE, true); // using operating rate
        m_streamingContext.setCompileConfigurations(config);

Cancels configurations and returns to default settings:

         config.put(NvsStreamingContext.COMPILE_GOP_SIZE, null);
Since
1.8.0
See also
getCompileConfigurations
void com.meicam.sdk.NvsStreamingContext.setCompileVideoBitrateMultiplier ( float  compileVideoBitrateMultiplier)
inline

Set the rate multiplier for compiling video.

Parameters
compileVideoBitrateMultiplierMultiplier
Since
1.5.0
See also
getCompileVideoBitrateMultiplier
void com.meicam.sdk.NvsStreamingContext.setCustomCompileVideoHeight ( int  videoHeight)
inline

Sets the customized height for video.

When compiling videos, set the bitrate grade for compiled video to COMPILE_VIDEO_RESOLUTION_GRADE_CUSTOM. Plesae note, to make sure the file is compiled successfully, Meishe SDK would calibrate the height accordingly, thus the final output file may not necessarily be the height set here.

Parameters
videoHeightCustomized height value of the compiled video.
Since
1.6.1
void com.meicam.sdk.NvsStreamingContext.setDefaultCaptionFade ( boolean  fade)
inline

Sets whether default caption mode is fade in and fade out.

Parameters
fadewhether is fade in and fade out.
Since
1.8.0
See also
isDefaultCaptionFade
boolean com.meicam.sdk.NvsStreamingContext.setDefaultThemeEndingLogoImageFilePath ( String  logoImageFilePath)
inline

Sets default theme's ending logo.

Parameters
logoImageFilePathFile path of the ending logo image
Returns
Returns whether setting the logo is successful. True means success, false means failure
See also
getDefaultThemeEndingLogoImageFilePath
void com.meicam.sdk.NvsStreamingContext.setExposureCompensation ( int  exposureCompensation)
inline

Set exposure compensation.

Parameters
exposureCompensationExposure compensation value
See also
getExposureCompensation
void com.meicam.sdk.NvsStreamingContext.setHardwareErrorCallback ( HardwareErrorCallback  cb)
inline

Sets callback interface for hardware error.

Parameters
cbCallback interface for hardware error
Since
1.16.0
void com.meicam.sdk.NvsStreamingContext.setPlaybackCallback ( PlaybackCallback  cb)
inline

Sets the callback interface for timeline playback.

Parameters
cbCallback interface for timeline playback
void com.meicam.sdk.NvsStreamingContext.setPlaybackCallback2 ( PlaybackCallback2  cb)
inline

Sets callback interface for timeline playback.

Parameters
cbCallback interface for timeline playback
void com.meicam.sdk.NvsStreamingContext.setPlaybackDelayCallback ( PlaybackDelayCallback  cb)
inline

Sets callback interface for delay playback.

Parameters
cbCallback interface for delay playback
void com.meicam.sdk.NvsStreamingContext.setPlaybackExceptionCallback ( PlaybackExceptionCallback  cb)
inline

Sets callback interface for playback exception.

Parameters
cbCallback interface for playback exception
void com.meicam.sdk.NvsStreamingContext.setRecordVideoBitrateMultiplier ( float  recordVideoBitrateMultiplier)
inline

Set the rate multiplier for recording video.

Parameters
recordVideoBitrateMultiplierMultiplier
Since
1.5.0
See also
getRecordVideoBitrateMultiplier
void com.meicam.sdk.NvsStreamingContext.setSeekingCallback ( SeekingCallback  cb)
inline

Sets the timeline search callback interface.

Parameters
cbCallback interface for search
void com.meicam.sdk.NvsStreamingContext.setStreamingEngineCallback ( StreamingEngineCallback  cb)
inline

Sets callback interface for streaming engine.

Parameters
cbCallback interface for streaming engine
boolean com.meicam.sdk.NvsStreamingContext.setThemeEndingEnabled ( boolean  enable)
inline

Sets whether to display theme ending's special effects.

Returns
Returns a boolean value, yes means success and no means failure.
See also
setDefaultThemeEndingLogoImageFilePath
void com.meicam.sdk.NvsStreamingContext.setTimelineTimestampCallback ( TimelineTimestampCallback  cb)
inline

Sets callback interface for timeline timestamp.

Parameters
cbCallback interface for timeline timestamp
Since
1.2.0
static boolean com.meicam.sdk.NvsStreamingContext.setupHumanDetectionData ( int  dataType,
String  dataFilePath 
)
inlinestatic

Initializes human detection data pack.

Parameters
dataTypeType of human detection data pack, please refer to [HUMAN_DETECTION_DATA_TYPE].
dataFilePathThe path of data file.
Returns
Returns a value represent if it succeeded.
Since
2.6.0
void com.meicam.sdk.NvsStreamingContext.setUserWatermarkForCapture ( String  watermarkFilePath,
int  displayWidth,
int  displayHeight,
float  opacity,
int  position,
int  marginX,
int  marginY 
)
inline

Adds a custom watermark for capturing video.

Parameters
watermarkFilePathPath of the watermark file, which should be a .PNG or .JPG file.
displayWidthThe width of the watermark displayed in the preview. If it is 0, the original width of the image is used.
displayHeightThe height of the watermark displayed in the preview. If it is 0, the original height of the image is used.
opacityWatermark opacity, the range of which is 0~1
positionPosition of the watermark, please refer to NvsTimelineWatermarkPosition.
marginXWatermark horizontal margin
marginYWatermark vertical margin
Since
2.0.1
void com.meicam.sdk.NvsStreamingContext.setVideoStabilization ( int  flags)
inline

Sets video stabilization.

Parameters
flagsVideo stabilization value.Please refer to Flag of stabilization.
See also
getVideoStabilization
void com.meicam.sdk.NvsStreamingContext.setZoom ( int  zoom)
inline

Sets the zoom value.

Parameters
zoomZoom ratio
See also
getZoom
void com.meicam.sdk.NvsStreamingContext.startAutoFocus ( RectF  focusRect)
inline

Starts autofocus.

Parameters
focusRectThe target area for autofocus, of which coordinates are in live-window's coordinate system
See also
cancelAutoFocus
boolean com.meicam.sdk.NvsStreamingContext.startBufferCapturePreview ( int  width,
int  heidht,
NvsRational  fps,
int  rotation,
boolean  flipHorizontally 
)
inline

Starts the capture preview with inputting buffer mode.

Parameters
widthInput buffer width.
heidhtInput buffer height.
fpsInput buffer framerate.
rotationInput buffer rotation angle. Please refer to Image rotation angle of input buffer
flipHorizontallywhether to flip the buffer horizontally.
Returns
Returns boolean value. YES indicates that the preview is started successfully, and NO means the opposite.
See also
sendBufferToCapturePreview
boolean com.meicam.sdk.NvsStreamingContext.startCapturePreview ( int  captureDeviceIndex,
int  videoResGrade,
int  flags,
NvsRational  aspectRatio 
)
inline

Starts the capture preview.

Parameters
captureDeviceIndexIndex of the capture device
videoResGradeGrade for video capture resolution. Please refer to Grade for video capture resolution. The video resolution grade means the shorter edge's resolution value when capturing video (could be the height or the width). According to the aspectRatio (if null then system's capturing device will determine aspect ratio), another edge's resolution value will be calculated (could be the height or the width). Four grades include LOW, MEDIUM, HIGH and SUPER_HIGH, of which correspond to 360p, 480p, 720p and 1080p. Android SDK's front-faced and back-faced cameras should be of the same resolution grade. There are two ways to record, recording with special effects and without. When recording with special effects (not using the system's built-in recorder), the SDK will evaluate user's phone's processing ability. If the phone is capable of process the recorded video, then the video will be recorded in resolution grade as set. If not, the SDK will lower the resolution grade to a level that the user's phone are capable of. For example: when using certain model of phone and setting to SUPER_HIGH grade, of which the phone are not capable of supporting, the SDK will lower the grade to HIGH or MEDIUM, thus resulting the grade recorded is not same as the grade user sets. Likewise, if recording without special effects (using the system's built-in camera), then the resolution grade will be determined according to camera's capability. If the camera cannot satisfy the grade setted, the SDK would lower the resolution grade when recording. If the user wants to customize the recording resolution, say 540*960 pixels, then the user will need to record a video with identical aspect ratio, create a timeline with aspect ratio of 540*960 and compile it to file. When compiling, there is no grade corresponding to a height of 960p, thus the user needs to call setCustomCompileVideoHeight() to customize the height before compilation. Then the user needs to call compileTimeline(), with the height grade set to COMPILE_VIDEO_RESOLUTION_GRADE_CUSTOM. The code may be used as follows:
    NvsVideoResolution videoEditRes = new NvsVideoResolution();
    videoEditRes.imageWidth = 540;
    videoEditRes.imageHeight = 960;
    videoEditRes.imagePAR = new NvsRational(1, 1);
    NvsRational videoFps = new NvsRational(25, 1);

    NvsAudioResolution audioEditRes = new NvsAudioResolution();
    audioEditRes.sampleRate = 44100;
    audioEditRes.channelCount = 2;

    mTimeline = mStreamingContext.createTimeline(videoEditRes, videoFps, audioEditRes);
    mStreamingContext.setCustomCompileVideoHeight(960);
    mStreamingContext.compileTimeline(mTimeline, 0, mTimeline.getDuration(), m_compilePath,
    NvsStreamingContext.COMPILE_VIDEO_RESOLUTION_GRADE_CUSTOM, NvsStreamingContext.COMPILE_BITRATE_GRADE_HIGH, 0);
flagsFlag field, if there is no special requirement, please fill in 0. Please refer to Flag of capturing. The application scene for each flag is as follows:
STREAMING_ENGINE_CAPTURE_FLAG_GRAB_CAPTURED_VIDEO_FRAME which is used in grabing video frame;
STREAMING_ENGINE_CAPTURE_FLAG_STRICT_PREVIEW_VIDEO_SIZE is used for face detection combination STREAMING_ENGINE_CAPTURE_FLAG_CAPTURE_BUDDY_HOST_VIDEO_FRAME;
STREAMING_ENGINE_CAPTURE_FLAG_DONT_USE_SYSTEM_RECORDER which used for recording video with special effects.
NvsStreamingEngineCaptureFlag_DontCaptureAudio Used for live video without audio stream. Usually not used.
aspectRatioAspect ratio for previewing, setting null means that it will be determined by the system capture device.
Returns
Returns boolean value. YES indicates that the preview is started successfully, and NO means the opposite.
void com.meicam.sdk.NvsStreamingContext.StartContinuousFocus ( )
inline

Starts continuous focus.

boolean com.meicam.sdk.NvsStreamingContext.startDualBufferCapturePreview ( SurfaceTexture  surfaceTexture,
int  surfaceTextureWidth,
int  surfaceTextureHeight,
int  surfaceTextureRotation,
int  cpuBufferWidth,
int  cpuBufferHeight,
boolean  cpuBufferFlipHorizontally,
int  cpuBufferRotation,
NvsRational  fps,
int  flags 
)
inline

Starts dual buffer mode for capture preview, one input is from SurfaceTexture and another is from cpu buffer. Two input must be of the same size when rotated to positive direction.

Parameters
surfaceTextureSurface texture object
surfaceTextureWidthWidth of the input SurfaceTexture buffer
surfaceTextureHeightHeight of the input SurfaceTexture buffer
surfaceTextureRotationRotation angle of input SurfaceTexture buffer (clockwise). Please refer to Input the image rotation angle of the buffer.
cpuBufferWidthWidth of input cpu buffer
cpuBufferHeightHeight of input cpu buffer
cpuBufferFlipHorizontallyWhether input cpu buffer is flipped horizontally (prior to rotation)
cpuBufferRotationRotation angle of input cpu buffer (clockwise). please refer to Input the image rotation angle of the buffer
fpsfps of input buffer
flagsFlag value, if no special requirements please input 0. Please refer to STREAMING_ENGINE_CAPTURE_FLAG.
Returns
Returns a boolean value. True means preview starts successfully and false means the opposite.
See also
sendBufferToCapturePreview
boolean com.meicam.sdk.NvsStreamingContext.startRecording ( String  outputFilePath)
inline

Starts recording. Please refer to Method of Recording Video.

Parameters
outputFilePathThe path to the recording file. Note: .mov is recommended as the output format.
Returns
Returns a boolean value. Returning YES means it starts recording successfully, and NO means it fails to start.
See also
stopRecording
boolean com.meicam.sdk.NvsStreamingContext.startRecording ( String  outputFilePath,
int  flags 
)
inline

Starts recording. Please refer to Method of Recording Video.

Parameters
outputFilePathThe path to the recording file. Note: .mov is recommended as the output format.
flagsFlag field, if there is no special requirement, please fill in 0. Please refer to Flag of recording.
Returns
Returns a boolean value. Returning YES means it starts recording successfully, and NO means it fails to start.
Since
1.5.1
See also
stopRecording
boolean com.meicam.sdk.NvsStreamingContext.startRecording ( String  outputFilePath,
int  flags,
Hashtable< String, Object >  recordConfigurations 
)
inline

Starts recording. Please refer to Method of Recording Video.

Parameters
outputFilePathThe path to the recording file. Note: .mov is recommended as the output format.
flagsFlag field, if there is no special requirement, please fill in 0. Please refer to Flag of recording.
recordConfigurationsConfigurations for recording videos. For key values in Hashtable,please refer to Configurations of recording video.
For instance:
 Hashtable<String, Object> config = new Hashtable<>();
 config.put(NvsStreamingContext.RECORD_GOP_SIZE, 15); //If set to 1 then a I-frame-only video is compiled. (Note: some android phones cannot compile I-frame-only video. In this case,please use STREAMING_ENGINE_COMPILE_FLAG_DISABLE_HARDWARE_ENCODER to encode)
 config.put(NvsStreamingContext.RECORD_BITRATE, 10000000); // 10M bps
Returns
Returns a boolean value. Returning YES means it starts recording successfully, and NO means it fails to start.
Since
1.5.1
See also
stopRecording
void com.meicam.sdk.NvsStreamingContext.stop ( )
inline

Stops the engine.

void com.meicam.sdk.NvsStreamingContext.stop ( int  flags)
inline

Stops the engine.

Parameters
flagsEngine stop flags. Please refer to Engine stop flags.
Since
1.16.0
void com.meicam.sdk.NvsStreamingContext.stopRecording ( )
inline

Stops recording.

See also
startRecording
void com.meicam.sdk.NvsStreamingContext.toggleFlash ( boolean  flashOn)
inline

Sets which the flash light is on/off.

Parameters
flashOnwhether the flash light is on or not
See also
isFlashOn

Member Data Documentation

final int com.meicam.sdk.NvsStreamingContext.AV_FILEINFO_EXTRA_NULL = 0
static
final int com.meicam.sdk.NvsStreamingContext.AV_FILEINFO_EXTRA_PIXELFORMAT = 1
static
final int com.meicam.sdk.NvsStreamingContext.BUFFER_IMAGE_ROTATION_0 = 0
static
final int com.meicam.sdk.NvsStreamingContext.BUFFER_IMAGE_ROTATION_180 = 2
static
final int com.meicam.sdk.NvsStreamingContext.BUFFER_IMAGE_ROTATION_270 = 3
static
final int com.meicam.sdk.NvsStreamingContext.BUFFER_IMAGE_ROTATION_90 = 1
static
final int com.meicam.sdk.NvsStreamingContext.CAPTURE_DEVICE_ERROR_SERVER_DIED = 2
static

Capture device's error, the server died.

final int com.meicam.sdk.NvsStreamingContext.CAPTURE_DEVICE_ERROR_UNKNOWN = 1
static

Unknown error with the capturing device.

final String com.meicam.sdk.NvsStreamingContext.COMPILE_AUDIO_BITRATE = "audio bitrate"
static

Compile audio bitrate.

final String com.meicam.sdk.NvsStreamingContext.COMPILE_BITRATE = "bitrate"
static

Compile bitrate.

final int com.meicam.sdk.NvsStreamingContext.COMPILE_BITRATE_GRADE_HIGH = 2
static

High bitrate for video compiled.

final int com.meicam.sdk.NvsStreamingContext.COMPILE_BITRATE_GRADE_LOW = 0
static

Low bitrate for video compiled.

final int com.meicam.sdk.NvsStreamingContext.COMPILE_BITRATE_GRADE_MEDIUM = 1
static

Medium bitrate for video compiled.

final String com.meicam.sdk.NvsStreamingContext.COMPILE_GOP_SIZE = "gopsize"
static

Compile GOP size.

final String com.meicam.sdk.NvsStreamingContext.COMPILE_LOSSLESS_AUDIO = "lossless audio"
static

Whether to compile lossless audio.

final String com.meicam.sdk.NvsStreamingContext.COMPILE_OPTIMIZE_FOR_NETWORK_USE = "optimize-for-network-use"
static

Whether to prepose the index table.

final String com.meicam.sdk.NvsStreamingContext.COMPILE_SOFTWARE_ENCODER_CRF = "software encorder crf"
static

Preset crf parameters for software encoder.

final String com.meicam.sdk.NvsStreamingContext.COMPILE_SOFTWARE_ENCODER_CRF_BITRATE_MAX = "software encorder crf bitrate max"
static

Preset maximum bitrate for software encoder in crf mode.

final String com.meicam.sdk.NvsStreamingContext.COMPILE_SOFTWARE_ENCODER_MODE = "software encorder mode"
static

Software encoder mode.

final String com.meicam.sdk.NvsStreamingContext.COMPILE_SOFTWARE_ENCODER_PRESET = "software encorder preset"
static

Preset parameters for software encoder.

final String com.meicam.sdk.NvsStreamingContext.COMPILE_USE_OPERATING_RATE = "use operating rate"
static

使用operating rate

final String com.meicam.sdk.NvsStreamingContext.COMPILE_VIDEO_ENCODER_NAME = "video encoder name"
static

Assigned video encoding format, hevc(h.256) is supported.

final int com.meicam.sdk.NvsStreamingContext.COMPILE_VIDEO_RESOLUTION_GRADE_1080 = 3
static

Compiles the video with height 1080.

final int com.meicam.sdk.NvsStreamingContext.COMPILE_VIDEO_RESOLUTION_GRADE_2160 = 4
static

Compiles the video with height 2160.

final int com.meicam.sdk.NvsStreamingContext.COMPILE_VIDEO_RESOLUTION_GRADE_360 = 0
static

Compiles the video with height 360(the width of video is determined by height and the selected width when creating timeline, caculated by resolution ratio)

final int com.meicam.sdk.NvsStreamingContext.COMPILE_VIDEO_RESOLUTION_GRADE_480 = 1
static

Compiles the video with height 480.

final int com.meicam.sdk.NvsStreamingContext.COMPILE_VIDEO_RESOLUTION_GRADE_720 = 2
static

Compiles the video with height 720.

final int com.meicam.sdk.NvsStreamingContext.COMPILE_VIDEO_RESOLUTION_GRADE_CUSTOM = 256
static

Customizes the height of video compiled.

final int com.meicam.sdk.NvsStreamingContext.HUMAN_DETECTION_DATA_TYPE_FAKE_FACE = 0
static

Fake face data pack type

final int com.meicam.sdk.NvsStreamingContext.HUMAN_DETECTION_FEATURE_FACE_ACTION = 2
static

Actions of human face

final int com.meicam.sdk.NvsStreamingContext.HUMAN_DETECTION_FEATURE_FACE_LANDMARK = 1
static

Landmarks on human face.

final String com.meicam.sdk.NvsStreamingContext.RECORD_BITRATE = "bitrate"
static

Record bitrate.

final String com.meicam.sdk.NvsStreamingContext.RECORD_GOP_SIZE = "gopsize"
static

Record GOP size.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_CONTEXT_FLAG_ASYNC_ENGINE_STATE = 16
static

Switches engine states asynchronously to reduce main thread's jam.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_CONTEXT_FLAG_COMPACT_MEMORY_MODE = 2
static

Minimizes the memory occupation.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_CONTEXT_FLAG_NO_HARDWARE_VIDEO_READER = 8
static

Disable hardware decoding.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_CONTEXT_FLAG_SUPPORT_4K_EDIT = 1
static

Supports 4K video editting.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_CONTEXT_FLAG_SUPPORT_8K_EDIT = 4
static

Supports 8K edittingting(only for pictures)

final int com.meicam.sdk.NvsStreamingContext.STREAMING_CONTEXT_VIDEO_DECODER_WITHOUT_SURFACE_TEXTURE = 32
static

Decoding not using the SurfaceTexture

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_CAPTURE_FLAG_CAPTURE_BUDDY_HOST_VIDEO_FRAME = 32
static

Records buddy video frame.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_CAPTURE_FLAG_DONT_CAPTURE_AUDIO = 16
static

Does not record audio.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_CAPTURE_FLAG_DONT_USE_SYSTEM_RECORDER = 4
static

Not using the system built-in recorder to record.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_CAPTURE_FLAG_FACE_ACTION_WITH_PARTICLE = 256
static

Uses face action to control particle special effects.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_CAPTURE_FLAG_GRAB_CAPTURED_VIDEO_FRAME = 1
static

Grabs frame from captured video (turnning on this flag would affect performance, turn on only when neccessary)

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_CAPTURE_FLAG_LOW_PIPELINE_SIZE = 512
static

Decreases the size of pipeline when engine is capturing

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_CAPTURE_FLAG_STRICT_PREVIEW_VIDEO_SIZE = 8
static

Resticts the preview video's size to system's built-in preview video size.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_COMPILE_FLAG_DISABLE_HARDWARE_ENCODER = 1
static

Disables the hardware encoder.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_COMPILE_FLAG_DONT_USE_INPUT_SURFACE = 2
static

Not using input surface.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_COMPILE_FLAG_ONLY_AUDIO = 8
static

Generate file only with audio stream.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_COMPILE_FLAG_ONLY_VIDEO = 4
static

Generate file only with video stream.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_HARDWARE_ERROR_TYPE_VIDEO_DECODER_SETUP_ERROR = 2
static
final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_HARDWARE_ERROR_TYPE_VIDEO_DECODING_ERROR = 3
static
final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_HARDWARE_ERROR_TYPE_VIDEO_ENCODER_SETUP_ERROR = 0
static
final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_HARDWARE_ERROR_TYPE_VIDEO_ENCODING_ERROR = 1
static
final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_PLAYBACK_EXCEPTION_TYPE_MEDIA_FILE_ERROR = 0
static

Media file error.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_PLAYBACK_FLAG_DISABLE_FIXED_PREROLL_TIME = 16
static

Decreases the first frame lag of playback engine

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_PLAYBACK_FLAG_LOW_PIPELINE_SIZE = 8
static

Decreases the pipeline size of playback engine.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_RECORDING_FLAG_DISABLE_HARDWARE_ENCODER = 4
static

Records without hardware encoder.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_RECORDING_FLAG_DONT_USE_INPUT_SURFACE = 64
static

Does not use input surface

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_RECORDING_FLAG_IGNORE_VIDEO_ROTATION = 32
static

Video recorded is not rotated according to the capture device's orientation. (Note: only workds with STREAMING_ENGINE_CAPTURE_FLAG_DONT_USE_SYSTEM_RECORDER)

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_RECORDING_FLAG_ONLY_RECORD_VIDEO = 16
static

Only records video streams to file, all audio streams would not be recorded.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_RECORDING_FLAG_SOFTWARE_VIDEO_INTRA_FRAME_ONLY_FAST_STOP = 8
static

Fast stop when recording I-Frame-only video with software encoder, this could result in a discard of video frame.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_RECORDING_FLAG_VIDEO_INTRA_FRAME_ONLY = 2
static

Records files that only include I-Frame. (Note: only works when using with STREAMING_ENGINE_CAPTURE_FLAG_DONT_USE_SYSTEM_RECORDER)

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_SEEK_FLAG_SHOW_ANIMATED_STICKER_POSTER = 4
static

Shows the entire animated sticker effects.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_SEEK_FLAG_SHOW_CAPTION_POSTER = 2
static

Shows the entire caption effects.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_SEND_BUFFER_FLAG_ONLY_FOR_BUDDY = 2
static

Data only used for handeling buddy video captured's frame content

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_SEND_BUFFER_FLAG_ONLY_FOR_GRAB = 1
static
final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_STATE_CAPTUREPREVIEW = 1
static

Capture preview.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_STATE_CAPTURERECORDING = 2
static

Capture recording.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_STATE_COMPILE = 5
static

Compiling file.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_STATE_PLAYBACK = 3
static

Playback.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_STATE_SEEKING = 4
static

Seeking.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_STATE_STOPPED = 0
static

Engine stopped.

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_STOP_FLAG_ASYNC = 2
static

Stops the engine asynchronously to avoid blocking main thread

final int com.meicam.sdk.NvsStreamingContext.STREAMING_ENGINE_STOP_FLAG_FORCE_STOP_COMPILATION = 1
static

Forces stop of compilation, resulting compiled file incomplete.

final int com.meicam.sdk.NvsStreamingContext.VIDEO_CAPTURE_RESOLUTION_GRADE_HIGH = 2
static

High resolution for video capture.

final int com.meicam.sdk.NvsStreamingContext.VIDEO_CAPTURE_RESOLUTION_GRADE_LOW = 0
static

Low resolution for video capture.

final int com.meicam.sdk.NvsStreamingContext.VIDEO_CAPTURE_RESOLUTION_GRADE_MEDIUM = 1
static

Medium resolution for video capture.

final int com.meicam.sdk.NvsStreamingContext.VIDEO_CAPTURE_RESOLUTION_GRADE_SUPER_HIGH = 3
static

Super high resolution for video capture.

final int com.meicam.sdk.NvsStreamingContext.VIDEO_PREVIEW_SIZEMODE_FULLSIZE = 0
static

Full-screen preview mode.

final int com.meicam.sdk.NvsStreamingContext.VIDEO_PREVIEW_SIZEMODE_LIVEWINDOW_SIZE = 1
static

Livewindow size preview mode.

final int com.meicam.sdk.NvsStreamingContext.VIDEO_STABILIZATION_MODE_AUTO = 1
static

Sets on/off of the video stabilization mode to auto.

final int com.meicam.sdk.NvsStreamingContext.VIDEO_STABILIZATION_MODE_OFF = 0
static

Turns off the video anti-shake mode.

final int com.meicam.sdk.NvsStreamingContext.VIDEO_STABILIZATION_MODE_STANDARD = 2
static

Standard mode for video anti-shake mode.

final int com.meicam.sdk.NvsStreamingContext.VIDEO_STABILIZATION_MODE_SUPER = 3
static

Anti-shake movie mode


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