美摄SDK For iOS  3.10.1
构造函数 | 类方法 | 属性 | 所有成员列表
NvsStreamingContext类 参考

流媒体上下文 更多...

#import <NvsStreamingContext.h>

类 NvsStreamingContext 继承关系图:

构造函数

(BOOL) - preloadEffectResources
 预加载特技资源 更多...
 
(EAGLSharegroup *) - getEAGLSharegroup
 从流媒体上下文中获取引擎所用的EAGLSharegroup对象 更多...
 
(float) - detectEngineRenderFramePerSecond
 从流媒体上下文中获取引擎当前的渲染速度,只在startCapturePreview和playbackTimeline之后有效。 更多...
 
(NvsAVFileInfo *) - getAVFileInfo:
 获取文件的音视频信息,如果文件格式不支持,则返回null 更多...
 
(NvsAVFileInfo *) - getAVFileInfoExtra:extraFlag:
 获取文件的音视频信息,如果文件格式不支持,则返回null 更多...
 
(NvsAVFileInfo *) - getAVFileInfo:extraFlag:withError:
 获取音视频文件的详细信息 更多...
 
(int) - detectVideoFileKeyframeInterval:
 探测视频文件的I帧间距 更多...
 
(BOOL) - setDefaultThemeEndingLogoImageFilePath:
 设置默认主题logo图片路径 更多...
 
(NSString *) - getDefaultThemeEndingLogoImageFilePath
 获取默认主题logo图片路径 更多...
 
(BOOL) - setThemeEndingEnabled:
 设置主题结尾logo特效是否显示 更多...
 
(int) - getEngineHDRCaps
 获取引擎的HDR能力 更多...
 
(void) - setAudioVUMeterEnabled:
 设置是否输出音频输出的DB值 更多...
 
(void) - setEnableAudioSampleNotify:
 设置是否输出音频sample 更多...
 
(NSString *) - registerFontByFilePath:
 获取字体文件的fontFamily 更多...
 
(NSArray *) - getFontInfoByFilePath:
 获取字体文件中字体信息 更多...
 
(void) - setColorGainForSDRToHDR:
 设置在SDR向HDR转换时候色彩增益 更多...
 
(float) - getColorGainForSDRToHDR
 获取在SDR向HDR转换时候色彩增益 更多...
 
(BOOL) - exportTemplateInfo:timeline:requestedAspectRatio:
 输出模版包的信息 更多...
 
(BOOL) - generateTemplatePackage:innerAssetDir:templateOutputDir:
 生成模版包 更多...
 
(void) - setTemplate:customResourceDir:
 设置模版自定义资源所在文件夹 更多...
 
(BOOL) - exportProjectInfo:timeline:requestedAspectRatio:
 输出项目包的信息 更多...
 
(BOOL) - generateProjectPackage:innerAssetDir:projectOutputDir:
 生成项目包 更多...
 
(NvsTimeline *) - createTimeline:videoFps:audioEditRes:
 创建时间线 更多...
 
(NvsTimeline *) - createTimeline:videoFps:audioEditRes:flags:
 创建时间线 更多...
 
(NvsTimeline *) - createTimeline:videoFps:audioEditRes:bitDepth:flags:
 创建时间线 更多...
 
(NvsTimeline *) - createTimeline:templateFootages:
 用模板资源创建时间线 更多...
 
(NvsTimeline *) - createTimeline:templateFootages:flags:
 用模板资源创建时间线 更多...
 
(NvsTimeline *) - createTimeline:templateFootages:flags:videoFps:audioEditRes:
 用模板资源创建时间线 更多...
 
(NvsTimeline *) - loadProject:resourceDir:
 用项目资源创建时间线 更多...
 
(BOOL) - removeTimeline:
 移除时间线 更多...
 
(NvsStreamingEngineState- getStreamingEngineState
 获取引擎状态 更多...
 
(int64_t) - getTimelineCurrentPosition:
 取得时间线当前时间位置,单位为微秒 更多...
 
(BOOL) - compileTimeline:startTime:endTime:outputFilePath:videoResolutionGrade:videoBitrateGrade:flags:
 时间线生成视频文件 更多...
 
(BOOL) - compileTimeline:startTime:endTime:outputFilePath:videoResolutionGrade:videoBitrateGrade:compileConfigurations:flags:
 时间线生成视频文件 更多...
 
(BOOL) - compilePassthroughTimeline:outputFilePath:compileConfigurations:flags:
 将时间线中视频轨道0上的视频片段直通生成一个视频,不处理滤镜、多轨和嵌套时间线,如果有图片则失败 更多...
 
(BOOL) - pauseCompiling
 暂定生成时间线 更多...
 
(BOOL) - resumeCompiling
 恢复生成时间线 更多...
 
(BOOL) - isCompilingPaused
 检查生成时间线是否暂停了 更多...
 
(BOOL) - pausePlayback
 暂停播放时间线 更多...
 
(BOOL) - resumePlayback
 恢复播放时间线 更多...
 
(BOOL) - isPlaybackPaused
 检查播放时间线是否暂停了 更多...
 
(void) - setCustomCompileVideoHeight:
 设置自定义的生成视频高度。
在生成时视频时,设置生成视频的分辨率高度级别为NvsCompileVideoResolutionGradeCustom 就可以使用自定义的生成视频高度。但是请注意,为了保证视频生成成功,美摄SDK会对高度进行适当的对齐, 因此最终生成的视频高度不一定就是这里设置的高度! 更多...
 
(unsigned int) - getCustomCompileVideoHeight
 获取当前自定义的生成视频高度。 更多...
 
(BOOL) - connectTimeline:withLiveWindow:
 连接时间线和实时预览窗口 更多...
 
(BOOL) - connectTimeline:withVideoFrameReceiver:
 连接时间线和视频帧接收器 更多...
 
(BOOL) - seekTimeline:timestamp:videoSizeMode:flags:
 定位某一时间戳的图像 更多...
 
(BOOL) - seekTimeline:timestamp:proxyScale:flags:
 定位某一时间戳的图像 更多...
 
(UIImage *) - grabImageFromTimeline:timestamp:proxyScale:
 获取时间线某一时间戳的图像。详细情况参见视频帧图像提取专题 更多...
 
(UIImage *) - grabImageFromTimeline:timestamp:proxyScale:flags:
 获取时间线某一时间戳的图像。详细情况参见视频帧图像提取专题 更多...
 
(BOOL) - grabImageFromTimelineAsync:timestamp:proxyScale:flags:
 获取时间线某一时间戳的图像。详细情况参见视频帧图像提取专题 这个函数是内部异步调用,需要保证在获取到图像之前不会调用SeekTimeline(),如果在调用这个函数之后调用SeekTimeline的函数有可能收不到图像的回调,可以在这个函数之后调用Stop保证Grab image能执行成功 更多...
 
(BOOL) - playbackTimeline:startTime:endTime:videoSizeMode:preload:flags:
 播放时间线 更多...
 
(BOOL) - playbackTimeline:startTime:endTime:proxyScale:preload:flags:
 播放时间线 更多...
 
(void) - stop
 停止引擎 更多...
 
(void) - stop:
 停止引擎 更多...
 
(void) - clearCachedResources:
 清除缓存资源 更多...
 
(void) - clearCachedResources:flags:
 清除缓存资源 更多...
 
(unsigned int) - captureDeviceCount
 采集设备的数量 更多...
 
(BOOL) - isCaptureDeviceBackFacing:
 是否为后置采集设备 更多...
 
(NvsCaptureDeviceCapability *) - getCaptureDeviceCapability:
 获取采集设备的能力描述对象 更多...
 
(BOOL) - connectCapturePreviewWithLiveWindow:
 连接采集预览和实时预览窗口 更多...
 
(BOOL) - connectCapturePreviewWithVideoFrameReceiver:
 连接采集预览和视频帧接收器 更多...
 
(void) - setUserWatermarkForCapture:displayWidth:displayHeight:opacity:position:marginX:marginY:
 为视频采集添加用户水印 更多...
 
(void) - removeUserWatermarkForCapture
 移除为视频采集添加的用户水印。 更多...
 
(BOOL) - startCapturePreview:videoResGrade:flags:aspectRatio:
 启动采集设备预览 更多...
 
(BOOL) - startBufferCapturePreview:height:fps:rotation:flipHorizontally:
 启动输入buffer模式的采集设备预览 更多...
 
(BOOL) - sendBufferToCapturePreview:
 输入buffer给采集设备预览 更多...
 
(BOOL) - sendAudioSamplesToCapturePreview:
 输入buffer给采集设备预览 更多...
 
(NvsSize- getCapturePreviewVideoSize:
 获取采集预览视频分辨率 更多...
 
(NvsColor- sampleColorFromCapturedVideoFrame:
 对采集设备的视频帧内容进行采样 更多...
 
(void) - startAutoFocus:
 启动自动聚焦 更多...
 
(void) - cancelAutoFocus
 取消正在进行中的自动聚焦 更多...
 
(void) - startContinuousFocus
 启动连续聚焦 更多...
 
(void) - startAutoExposure:
 启动自动曝光调节 更多...
 
(void) - setZoomFactor:
 设置缩放因子 更多...
 
(float) - getZoomFactor
 获取缩放因子 更多...
 
(void) - toggleFlash:
 开/关换补光灯 更多...
 
(BOOL) - isFlashOn
 开/关换补光灯状态 更多...
 
(void) - toggleFlashMode:
 切换闪光灯模式 更多...
 
(NvsCameraFlashMode- getFlashMode
 获取当前闪光灯模式 更多...
 
(VideoStabilizationFlag- getVideoStabilization
 获取当前的视频防抖动标志 更多...
 
(void) - setVideoStabilization:
 设置视频防抖动 更多...
 
(void) - setExposureBias:
 设置曝光补偿 更多...
 
(float) - getExposureBias
 获取曝光补偿 更多...
 
(NvsCaptureVideoFx *) - appendBuiltinCaptureVideoFx:
 追加一个内建视频特效 更多...
 
(NvsCaptureVideoFx *) - insertBuiltinCaptureVideoFx:withInsertPosition:
 插入一个内建视频特效 更多...
 
(NvsCaptureVideoFx *) - appendPackagedCaptureVideoFx:
 追加一个包裹视频特效 更多...
 
(NvsCaptureVideoFx *) - insertPackagedCaptureVideoFx:withInsertPosition:
 插入一个包裹视频特效 更多...
 
(NvsCaptureVideoFx *) - appendCustomCaptureVideoFx:
 追加自定义采集视频特效 更多...
 
(NvsCaptureVideoFx *) - insertCustomCaptureVideoFx:withInsertPosition:
 插入自定义采集视频特效 更多...
 
(NvsCaptureVideoFx *) - appendBeautyCaptureVideoFx
 追加一个美颜视频特效 更多...
 
(NvsCaptureVideoFx *) - insertBeautyCaptureVideoFx:
 插入一个美颜视频特效 更多...
 
(BOOL) - removeCaptureVideoFx:
 对移除特定索引值的采集视频特效 更多...
 
(void) - removeAllCaptureVideoFx
 移除所有采集视频特效 更多...
 
(unsigned int) - getCaptureVideoFxCount
 获得采集视频特效的数量 更多...
 
(NvsCaptureVideoFx *) - getCaptureVideoFxByIndex:
 获得采集视频特效 更多...
 
(NvsCaptureAudioFx *) - appendBuiltinCaptureAudioFx:
 追加一个内建音频特效 更多...
 
(NvsCaptureAudioFx *) - insertBuiltinCaptureAudioFx:withInsertPosition:
 插入一个内建音频特效 更多...
 
(BOOL) - removeCaptureAudioFx:
 对移除特定索引值的采集音频特效 更多...
 
(void) - removeAllCaptureAudioFx
 移除所有采集视频特效 更多...
 
(unsigned int) - getCaptureAudioFxCount
 获得采集音频特效的数量 更多...
 
(NvsCaptureAudioFx *) - getCaptureAudioFxByIndex:
 获得采集音频特效 更多...
 
(NvsCaptureAnimatedSticker *) - appendCaptureAnimatedSticker:duration:animatedStickerPackageId:
 追加一个动画贴纸 更多...
 
(NvsCaptureAnimatedSticker *) - insertCaptureAnimatedSticker:duration:animatedStickerPackageId:insertPosition:
 追加一个动画贴纸 更多...
 
(NvsCaptureAnimatedSticker *) - addCustomCaptureAnimatedSticker:duration:animatedStickerPackageId:customImagePath:
 在拍摄上添加自定义动画贴纸 更多...
 
(NvsCaptureAnimatedSticker *) - insertCustomCaptureAnimatedSticker:duration:animatedStickerPackageId:customImagePath:insertPosition:
 插入一个动画贴纸 更多...
 
(BOOL) - removeCaptureAnimatedSticker:
 对移除特定索引值的采集动画贴纸 更多...
 
(void) - removeAllCaptureAnimatedSticker
 移除所有采集动画贴纸 更多...
 
(unsigned int) - getCaptureAnimatedStickerCount
 获得采集动画贴纸的数量 更多...
 
(NvsCaptureAnimatedSticker *) - getCaptureAnimatedStickerByIndex:
 获得采集动画贴纸 更多...
 
(NvsCaptureCompoundCaption *) - appendCaptureCompoundCaption:duration:compoundCaptionPackageId:
 追加一个复合字幕 更多...
 
(NvsCaptureCompoundCaption *) - insertCaptureCompoundCaption:duration:compoundCaptionPackageId:insertPosition:
 插入一个复合字幕 更多...
 
(BOOL) - removeCaptureCompoundCaption:
 对移除特定索引值的采集复合字幕 更多...
 
(void) - removeAllCaptureCompoundCaption
 移除所有采集复合字幕 更多...
 
(unsigned int) - getCaptureCompoundCaptionCount
 获得采集复合字幕的数量 更多...
 
(NvsCaptureCompoundCaption *) - getCaptureCompoundCaptionByIndex:
 获得采集复合字幕 更多...
 
(NvsCaptureCaption *) - appendCaptureCaption:offsetTime:duration:captionStylePackageId:
 追加一个字幕 更多...
 
(NvsCaptureCaption *) - insertCaptureCaption:offsetTime:duration:captionStylePackageId:insertPosition:
 插入一个字幕 更多...
 
(NvsCaptureCaption *) - appendCaptureModularCaption:offsetTime:duration:
 追加一个模块字幕 更多...
 
(NvsCaptureCaption *) - insertCaptureModularCaption:offsetTime:duration:insertPosition:
 插入一个模块字幕 更多...
 
(BOOL) - removeCaptureCaption:
 对移除特定索引值的采集字幕 更多...
 
(void) - removeAllCaptureCaption
 移除所有采集字幕 更多...
 
(unsigned int) - getCaptureCaptionCount
 获得采集字幕的数量 更多...
 
(NvsCaptureCaption *) - getCaptureCaptionByIndex:
 获得采集字幕 更多...
 
(BOOL) - applyCaptureScene:
 对采集设备应用拍摄场景资源包 更多...
 
(BOOL) - applyCaptureScene:captureSceneInfo:
 对采集设备应用拍摄场景资源包 更多...
 
(NSString *) - getCurrentCaptureSceneId
 取得当前拍摄场景资源包的ID 更多...
 
(void) - removeCurrentCaptureScene
 移除当前拍摄场景 更多...
 
(BOOL) - startRecording:
 启动录制采集设备信号。请参见视频录制方式 更多...
 
(BOOL) - startRecording:withFlags:
 启动录制采集设备信号。请参见视频录制方式 更多...
 
(BOOL) - startRecording:withFlags:withRecordConfigurations:
 启动录制采集设备信号。请参见视频录制方式 更多...
 
(BOOL) - startRecordingWithFx:
 启动采集设备的录制,录制的内容包含所有的特效处理效果。 更多...
 
(BOOL) - startRecordingWithFx:withFlags:
 启动采集设备的录制,录制的内容包含所有的特效处理效果。 更多...
 
(BOOL) - startRecordingWithFx:withFlags:withRecordConfigurations:
 启动录制采集设备信号。请参见视频录制方式 更多...
 
(void) - setAudioSampleInfoForCallback:
 设置需要回调的采集音频信息 更多...
 
(void) - stopRecording
 结束录制采集设备信号 更多...
 
(BOOL) - pauseRecording
 暂停录制采集信号。暂停录制之后再继续录制会录制到同一个媒体文件中。注意:只有不使用系统内置recorder时才能暂停录制! 更多...
 
(BOOL) - resumeRecording
 继续录制采集信号。继续录制会录制到暂停之前的同一个媒体文件中。 更多...
 
(BOOL) - isRecordingPaused
 检查录制是否已经暂停 更多...
 
(BOOL) - takePicture:
 以最接近预览比例的摄像头的最大分辨率拍摄一张照片 更多...
 
(NSArray *) - getAllBuiltinVideoFxNames
 获取全部内嵌视频特效名称 更多...
 
(NSArray *) - getAllBuiltinAudioFxNames
 获取全部内嵌音频特效名称 更多...
 
(NSArray *) - getAllBuiltinVideoTransitionNames
 获取全部内嵌视频转场名称 更多...
 
(NSArray *) - getAllBuiltinCaptureVideoFxNames
 获取全部内嵌采集视频特效名称 更多...
 
(NSString *) - getBeautyVideoFxName
 获得美颜的视频特效名称 更多...
 
(NSString *) - getDefaultVideoTransitionName
 获得默认视频转场名称 更多...
 
(void) - setDefaultAudioTransitionName:
 设置默认视频转场名称 更多...
 
(NvsFxDescription *) - getVideoFxDescription:
 获取视频特效描述 更多...
 
(NvsFxDescription *) - getAudioFxDescription:
 获取音频特效描述 更多...
 
(NvsVideoFrameRetriever *) - createVideoFrameRetriever:
 创建视频帧提取对象 更多...
 
(NvsStreamingContext *) - createAuxiliaryStreamingContext:
 创建辅助流媒体上下文对象 更多...
 
(void) - destoryAuxiliaryStreamingContext:
 销毁辅助流媒体上下文对象 更多...
 
(void) - setAudioOutputDeviceVolume:
 设置音频输出设备音量 更多...
 
(void) - setCaptureFps:
 设置采集帧率。 更多...
 
(void) - setImageReaderCount:
 设置image reader 最大个数。 更多...
 
(void) - setDefaultImageClipDuration:
 设置缺省图像片段持续时长 更多...
 
(long) - calcDurationAfterCurvesVariableSpeed:
 
(BOOL) - isBlackFrame:
 检测是否是纯黑色的图片。 更多...
 

类方法

(void) + getSdkVersion:minorVersion:revisionNumber:
 获取美摄SDK的版本信息 更多...
 
(void) + setDebugLevel:
 设置Debug的级别 更多...
 
(void) + setSaveDebugMessagesToFile:
 设置是否将SDK的调试信息写入到文件中,在/Library/Application Support/log/路径下每天会生成一个文件,例如:meishesdklog(2023-01-17).log,如果需要删除文件用户需要自己删除这个目录,美摄sdk不会主动删除. 更多...
 
(BOOL) + verifySdkLicenseFile:
 验证SDK授权文件。注意:授权文件接口必须在NvsStreamingContext初始化之前调用。 更多...
 
(NvsStreamingContext *) + sharedInstance
 获取流媒体上下文的唯一实例 更多...
 
(NvsStreamingContext *) + sharedInstanceWithFlags:
 获取流媒体上下文的唯一实例。详细了解参见4k视频编辑专题 更多...
 
(void) + destroyInstance
 销毁流媒体上下文实例。 更多...
 
(int) + hasARModule
 检测当前SDK是否含有AR模块 更多...
 
(BOOL) + initHumanDetection:licenseFilePath:features:
 初始化人体检测机制, 只初始化一次 更多...
 
(BOOL) + initHumanDetectionExt:licenseFilePath:features:
 初始化人体检测扩展机制,必须先调用initHumanDetection 更多...
 
(BOOL) + setupHumanDetectionData:dataFilePath:
 初始化人体检测数据包 更多...
 
(void) + closeHumanDetection
 关闭人体检测机制 更多...
 
(NSString *) + getLogFileDirectory
 获取日志文件所在路径 更多...
 
(BOOL) + functionalityAuthorised:
 验证某项功能是否可用。 更多...
 
(void) + setSpecialCameraDeviceType:
 设置特殊的Camera 的设备类型。 更多...
 
(void) + setMaxCafCacheMemorySize:
 设置caf的最大缓存。 更多...
 
(void) + setMaxImageReaderCount:
 设置max image reader 最大个数。 更多...
 
(void) + setFxPluginBundlePathList:
 设置特效插件路径。 更多...
 
(void) + setMaxAudioReaderCount:
 设置 audio reader 最大个数。 更多...
 
(void) + setMaxReaderCount:
 设置 file reader 最大个数。 更多...
 
(void) + setMaxSoftReaderCount:
 设置软件的 file reader 最大个数。 更多...
 
(void) + setMaxIconReaderCount:
 设置 icon reader 最大个数。 更多...
 
(void) + setStreamingPoolSizeInByte:
 设置max image reader 最大个数。 更多...
 
(void) + setMaxEditCaptionCachedContextCount:
 设置编辑时缓存的caption context 最大个数。 更多...
 
(void) + setMaxCompileCaptionCachedContextCount:
 设置导出时缓存的caption context 最大个数。 更多...
 

属性

id< NvsStreamingContextDelegatedelegate
 
NvsAssetPackageManagerassetPackageManager
 包管理器 更多...
 
float compileVideoBitrateMultiplier
 生成视频码率倍乘系数 更多...
 
float recordVideoBitrateMultiplier
 录制视频码率倍乘系数 更多...
 
BOOL defaultCaptionFade
 默认字幕是否为淡入淡出 更多...
 
id< NvsImageGrabberDelegateimageGrabberDelegate
 
NSMutableDictionary * compileConfigurations
 生成时间线配置,设置一次即一直生效。NSMutableDictionary中关键字的值请参见 生成时间线的配置 例如:NSMutableDictionary *config = [[NSMutableDictionary alloc] init]; [config setValue:[NSNumber numberWithInteger:15] forKey:NVS_COMPILE_GOP_SIZE]; // 设置为1即是生成全I帧视频 [config setValue:[NSNumber numberWithInteger:10000000] forKey:NVS_COMPILE_BITRATE]; // 10M bps [config setValue:[NSNumber numberWithInteger:256000] forKey:NVS_COMPILE_AUDIO_BITRATE]; // 设置音频码率为256Kbps [config setValue:[NSNumber numberWithBool:YES] forKey:NVS_COMPILE_LOSSLESS_AUDIO]; // 设置生成无损音频 [config setValue:[NSNumber numberWithBool:YES] forKey:NVS_COMPILE_OPTIMIZE_FOR_NETWORK_USE]; // 设置索引表前置 NvsRational videoFps = {12, 1}; [config setValue:[NSData dataWithBytes:&videoFps length:sizeof(NvsRational)] forKey:NVS_COMPILE_VIDEO_FPS]; // 设置帧速率FPS _streamingContext.compileConfigurations = config; 取消设置并恢复默认方式例如:[_streamingContext.compileConfigurations setValue:nil forKey:NVS_COMPILE_GOP_SIZE]; 更多...
 

详细描述

流媒体上下文

流媒体上下文类可视作整个SDK框架的入口。开发过程中,NvsStreamingContext类提供了静态sharedInstance()接口创建流上下文的唯一实例。 通过这个实例对象,我们可以开启采集设备录制视频,添加采集视频特效,设置拍摄时的各项参数,包括自动聚焦,自动曝光调节,开关换补光灯等。 同时,还能够创建时间线,并将时间线与实时预览窗口(Live Window)连接起来,实时预览播放已经拍摄完成的视频。整个视频制作完成后,要销毁流媒体上下文的对象实例。 带特效拍摄时,添加素材资源包(采集特效包,场景资源包等),都得先安装,安装成功后获取packageId才能使用,而内建采集特效(builtin)只需获取特效名称即可使用。
sdk接口中凡是需要传入资源、授权等文件路径时一定是全路径。

警告
NvsStreamingContext类中,所有public API除了getAVFileInfo,detectVideoFileKeyframeInterval,createVideoFrameRetriever可以跨线程使用,其他都在UI线程使用!!!

函数文档

◆ addCustomCaptureAnimatedSticker:duration:animatedStickerPackageId:customImagePath:

- (NvsCaptureAnimatedSticker *) addCustomCaptureAnimatedSticker: (int64_t)  inPoint
duration: (int64_t)  duration
animatedStickerPackageId: (NSString *)  animatedStickerPackageId
customImagePath: (NSString *)  customImagePath 

在拍摄上添加自定义动画贴纸

参数
inPoint自定义动画贴纸在时间线上的入点(单位微秒)
duration自定义动画贴纸的显示时长(单位微秒)
animatedStickerPackageId自定义动画贴纸包Id
customImagePath自定义动画贴纸图像路径(可以是jpg、png图像,或者美摄sdk内部支持的动态caf格式图像)
返回
返回拍摄自定义动画贴纸对象
以下情况会返回nil:
1.没有动画贴纸功能授权;
2.animatedStickerPackageId参数为空字符串或者nil;
3.该动画贴纸包没有安装成功;
4.如果inPoint小于0,或者duration不大于0。
注意:如果返回值非空,依旧看不到贴纸效果,需要检查customImagePath是否真实存在
参见
- removeCaptureAnimatedSticker:
自从
3.2.0

◆ appendBeautyCaptureVideoFx

- (NvsCaptureVideoFx *) appendBeautyCaptureVideoFx

追加一个美颜视频特效

返回
返回追加的美颜视频特效对象
参见
- insertBeautyCaptureVideoFx:

◆ appendBuiltinCaptureAudioFx:

- (NvsCaptureAudioFx *) appendBuiltinCaptureAudioFx: (NSString *)  audioFxName

追加一个内建音频特效

参数
audioFxName音频特效名。获取音频特效名称,请参见getAllBuiltinCaptureAudioFxNames()或内建特效名称列表
返回
返回追加的内建音频特效对象
参见
insertBuiltinCaptureVideoFx
自从
2.21.0

◆ appendBuiltinCaptureVideoFx:

- (NvsCaptureVideoFx *) appendBuiltinCaptureVideoFx: (NSString *)  videoFxName

追加一个内建视频特效

参数
videoFxName视频特效名。获取视频特效名称,请参见getAllBuiltinCaptureVideoFxNames()内建特效名称列表
返回
返回追加的内建视频特效对象
参见
- insertBuiltinCaptureVideoFx:withInsertPosition:

◆ appendCaptureAnimatedSticker:duration:animatedStickerPackageId:

- (NvsCaptureAnimatedSticker *) appendCaptureAnimatedSticker: (int64_t)  offsetTime
duration: (int64_t)  duration
animatedStickerPackageId: (NSString *)  animatedStickerPackageId 

追加一个动画贴纸

参数
offsetTime动画贴纸的偏移时间。
duration动画贴纸的持续时间。
animatedStickerPackageId动画贴纸包Id。
返回
返回采集动画贴纸对象
以下情况会返回null:
1.没有动画贴纸功能授权;
2.animatedStickerPackageId参数为空字符串或者null;
3.该动画贴纸包没有安装成功;
参见
insertCaptureAnimatedSticker
自从
2.21.0

◆ appendCaptureCaption:offsetTime:duration:captionStylePackageId:

- (NvsCaptureCaption *) appendCaptureCaption: (NSString *)  captionText
offsetTime: (int64_t)  offsetTime
duration: (int64_t)  duration
captionStylePackageId: (NSString *)  captionStylePackageId 

追加一个字幕

参数
captionText字幕的文字
offsetTime字幕的偏移时间。
duration字幕的持续时间。
captionStylePackageId字幕样式包Id,不存在的话,可以传空字符串或者null
返回
返回采集字幕对象
以下情况会返回null:
1.没有复合字幕功能授权;
参见
insertCaptureCompoundCaption
自从
2.21.0

◆ appendCaptureCompoundCaption:duration:compoundCaptionPackageId:

- (NvsCaptureCompoundCaption *) appendCaptureCompoundCaption: (int64_t)  offsetTime
duration: (int64_t)  duration
compoundCaptionPackageId: (NSString *)  compoundCaptionPackageId 

追加一个复合字幕

参数
offsetTime复合字幕的偏移时间。
duration复合字幕的持续时间。
compoundCaptionPackageId复合字幕包Id。
返回
返回采集复合字幕对象
以下情况会返回null:
1.没有复合字幕功能授权;
参见
insertCaptureCompoundCaption
自从
2.21.0

◆ appendCaptureModularCaption:offsetTime:duration:

- (NvsCaptureCaption *) appendCaptureModularCaption: (NSString *)  captionText
offsetTime: (int64_t)  offsetTime
duration: (int64_t)  duration 

追加一个模块字幕

参数
captionText字幕的文字
offsetTime字幕的偏移时间。
duration字幕的持续时间。
返回
返回采集字幕对象
以下情况会返回null:
1.没有复合字幕功能授权;
参见
insertCaptureCompoundCaption
自从
2.21.0

◆ appendCustomCaptureVideoFx:

- (NvsCaptureVideoFx *) appendCustomCaptureVideoFx: (id< NvsCustomVideoFxRenderer >)  customVideoFxRender

追加自定义采集视频特效

参数
customVideoFxRender用户实现的自定义视频特效渲染器接口
返回
返回追加的采集视频特效对象
警告
此接口会引发流媒体引擎状态跳转到引擎停止状态,具体情况请参见引擎变化专题
自从
1.7.0

◆ appendPackagedCaptureVideoFx:

- (NvsCaptureVideoFx *) appendPackagedCaptureVideoFx: (NSString *)  videoFxPackageId

追加一个包裹视频特效

参数
videoFxPackageId视频特效包裹ID
返回
返回追加的包裹视频特效对象
参见
- insertPackagedCaptureVideoFx:withInsertPosition:

◆ applyCaptureScene:

- (BOOL) applyCaptureScene: (NSString *)  captureSceneId

对采集设备应用拍摄场景资源包

参数
captureSceneId拍摄场景资源包的ID
返回
返回BOOL值。值为YES则应用成功,NO则失败。
自从
1.2.0
参见
- getCurrentCaptureSceneId
- removeCurrentCaptureScene

◆ applyCaptureScene:captureSceneInfo:

- (BOOL) applyCaptureScene: (NSString *)  captureSceneId
captureSceneInfo: (NvsCaptureSceneInfo *)  info 

对采集设备应用拍摄场景资源包

参数
captureSceneId拍摄场景资源包的ID
info待替换的资源信息
返回
返回BOOL值。值为YES则应用成功,NO则失败。
自从
3.2.0
参见
- getCurrentCaptureSceneId
- removeCurrentCaptureScene

◆ calcDurationAfterCurvesVariableSpeed:

- (long) calcDurationAfterCurvesVariableSpeed: (NSString *)  curvesString
自从
2.17.0

◆ cancelAutoFocus

- (void) cancelAutoFocus

取消正在进行中的自动聚焦

参见
- startAutoFocus:

◆ captureDeviceCount

- (unsigned int) captureDeviceCount

采集设备的数量

返回
返回采集设备数

◆ clearCachedResources:

- (void) clearCachedResources: (BOOL)  asynchronous

清除缓存资源

参数
asynchronous是否异步

◆ clearCachedResources:flags:

- (void) clearCachedResources: (BOOL)  asynchronous
flags: (int)  flags 

清除缓存资源

参数
asynchronous是否异步
flags清除缓存标志,如无特殊需求请填写0。请参见 NvsClearCacheFlag

◆ closeHumanDetection

+ (void) closeHumanDetection

关闭人体检测机制

自从
2.5.0
参见
initHumanDetection

◆ compilePassthroughTimeline:outputFilePath:compileConfigurations:flags:

- (BOOL) compilePassthroughTimeline: (NvsTimeline *)  timeline
outputFilePath: (NSString *)  outputFilePath
compileConfigurations: (NSMutableDictionary *)  configurations
flags: (int)  flags 

将时间线中视频轨道0上的视频片段直通生成一个视频,不处理滤镜、多轨和嵌套时间线,如果有图片则失败

参数
timeline时间线对象
outputFilePath生成输出的文件路径
configurations时间线配置,只支持添加NVS_COMPILE_CREATION_TIME、NVS_COMPILE_OPTIMIZE_FOR_NETWORK_USE、NVS_COMPILE_METADATADESCRIPTION
flags生成文件输出的特殊标志,如果没有特殊需求,请填写0。
返回
返回布尔值。注意:时间线生成文件是异步操作。返回true,则启动生成成功;false,则启动生成失败
警告
此接口会引发流媒体引擎状态跳转到引擎停止状态,具体情况请参见引擎变化专题
自从
3.4.0
参见
seekTimeline
playbackTimeline
compileTimeline

◆ compileTimeline:startTime:endTime:outputFilePath:videoResolutionGrade:videoBitrateGrade:compileConfigurations:flags:

- (BOOL) compileTimeline: (NvsTimeline *)  timeline
startTime: (int64_t)  startTime
endTime: (int64_t)  endTime
outputFilePath: (NSString *)  outputFilePath
videoResolutionGrade: (NvsCompileVideoResolutionGrade videoResolutionGrade
videoBitrateGrade: (NvsCompileVideoBitrateGrade videoBitrateGrade
compileConfigurations: (NSMutableDictionary *)  compileConfigurations
flags: (int)  flags 

时间线生成视频文件

参数
timeline时间线
startTime开始时间(单位微秒)。startTime取值范围在[0,timeline.duration - 1],传入其他值无效。
endTime结束时间(单位微秒)。endTime取值范围在(startTime,timeline.duration],同样传入其他值无效。
outputFilePath生成视频输出的文件路径。注意: 目前只支持输出.mov格式的文件
videoResolutionGrade生成视频输出的分辨率级别
videoBitrateGrade生成视频输出的码率。视频输出码率级别分为低码率,中等码率,高等码率。视频生成具体码率值跟生成视频的分辨率有关,这里以1280 * 720p为例,计算出不同码率级别对应的近似值, NvsCompileBitrateGradeLow级别值为2.2Mbps,NvsCompileBitrateGradeMedium级别值为3.3Mbps,NvsCompileBitrateGradeHigh级别值为6Mbps。
compileConfigurations时间线配置 NSMutableDictionary中关键字的值请参见 生成时间线的配置
flags生成视频输出的特殊标志。请参见 NvsStreamingEngineCompileFlag
返回
返回BOOL值。注意:时间线生成视频文件是异步操作。返回值为YES则启动时间线生成文件成功,NO则时间线生成文件启动失败。
警告
此接口会引发流媒体引擎状态跳转到引擎停止状态,具体情况请参见引擎变化专题
自从
3.1.0
参见
- seekTimeline:timestamp:videoSizeMode:flags:
- playbackTimeline:startTime:endTime:videoSizeMode:preload:flags:

◆ compileTimeline:startTime:endTime:outputFilePath:videoResolutionGrade:videoBitrateGrade:flags:

- (BOOL) compileTimeline: (NvsTimeline *)  timeline
startTime: (int64_t)  startTime
endTime: (int64_t)  endTime
outputFilePath: (NSString *)  outputFilePath
videoResolutionGrade: (NvsCompileVideoResolutionGrade videoResolutionGrade
videoBitrateGrade: (NvsCompileVideoBitrateGrade videoBitrateGrade
flags: (int)  flags 

时间线生成视频文件

参数
timeline时间线
startTime开始时间(单位微秒)。startTime取值范围在[0,timeline.duration - 1],传入其他值无效。
endTime结束时间(单位微秒)。endTime取值范围在(startTime,timeline.duration],同样传入其他值无效。
outputFilePath生成视频输出的文件路径。注意: 目前只支持输出.mov格式的文件
videoResolutionGrade生成视频输出的分辨率级别
videoBitrateGrade生成视频输出的码率。视频输出码率级别分为低码率,中等码率,高等码率。视频生成具体码率值跟生成视频的分辨率有关,这里以1280 * 720p为例,计算出不同码率级别对应的近似值, NvsCompileBitrateGradeLow级别值为2.2Mbps,NvsCompileBitrateGradeMedium级别值为3.3Mbps,NvsCompileBitrateGradeHigh级别值为6Mbps。
flags生成视频输出的特殊标志。请参见 NvsStreamingEngineCompileFlag
返回
返回BOOL值。注意:时间线生成视频文件是异步操作。返回值为YES则启动时间线生成文件成功,NO则时间线生成文件启动失败。
警告
此接口会引发流媒体引擎状态跳转到引擎停止状态,具体情况请参见引擎变化专题
参见
- seekTimeline:timestamp:videoSizeMode:flags:
- playbackTimeline:startTime:endTime:videoSizeMode:preload:flags:

◆ connectCapturePreviewWithLiveWindow:

- (BOOL) connectCapturePreviewWithLiveWindow: (NvsLiveWindow *)  liveWindow

连接采集预览和实时预览窗口

参数
liveWindow实时预览窗口
返回
返回BOOL值。返回YES则连接成功,NO则连接失败。
参见
- connectTimeline:withLiveWindow:

◆ connectCapturePreviewWithVideoFrameReceiver:

- (BOOL) connectCapturePreviewWithVideoFrameReceiver: (NvsVideoFrameReceiver *)  receiver

连接采集预览和视频帧接收器

参数
receiver视频帧接收器
返回
返回BOOL值。返回YES则连接成功,NO则连接失败。
自从
1.7.1

◆ connectTimeline:withLiveWindow:

- (BOOL) connectTimeline: (NvsTimeline *)  timeline
withLiveWindow: (NvsLiveWindow *)  liveWindow 

连接时间线和实时预览窗口

参数
timeline时间线
liveWindow实时预览窗口
返回
返回BOOL值。返回YES则连接成功,NO则连接失败。

◆ connectTimeline:withVideoFrameReceiver:

- (BOOL) connectTimeline: (NvsTimeline *)  timeline
withVideoFrameReceiver: (NvsVideoFrameReceiver *)  receiver 

连接时间线和视频帧接收器

参数
timeline时间线
receiver视频帧接收器
返回
返回BOOL值。返回YES则连接成功,NO则连接失败。

◆ createAuxiliaryStreamingContext:

- (NvsStreamingContext *) createAuxiliaryStreamingContext: (int)  flags

创建辅助流媒体上下文对象

参数
flags流媒体上下文创建标志
返回
返回NvsVideoFrameRetriever对象,表示辅助流媒体上下文对象
自从
2.12.0

◆ createTimeline:templateFootages:

- (NvsTimeline *) createTimeline: (NSString *)  templateId
templateFootages: (NSArray< NvsTemplateFootageInfo * > *)  templateFootages 

用模板资源创建时间线

参数
templateId模板资源uuid
templateFootages模板资源里footage的对应信息
返回
返回创建的时间线对象
参见
removeTimeline

◆ createTimeline:templateFootages:flags:

- (NvsTimeline *) createTimeline: (NSString *)  templateId
templateFootages: (NSArray< NvsTemplateFootageInfo * > *)  templateFootages
flags: (int)  flags 

用模板资源创建时间线

参数
templateId模板资源uuid
templateFootages模板资源里footage的对应信息
flags创建时间线的特殊标志,如果没有特殊需求,请填写0。请参见NvsCreateTimelineTypeFlag
返回
返回创建的时间线对象
自从
2.21.0
参见
removeTimeline

◆ createTimeline:templateFootages:flags:videoFps:audioEditRes:

- (NvsTimeline *) createTimeline: (NSString *)  templateId
templateFootages: (NSArray< NvsTemplateFootageInfo * > *)  templateFootages
flags: (int)  flags
videoFps: (NvsRational *)  videoFps
audioEditRes: (NvsAudioResolution *)  audioEditRes 

用模板资源创建时间线

参数
templateId模板资源uuid,必须先安装模板
templateFootages模板资源里footage的对应信息
flags创建时间线的特殊标志,如果没有特殊需求,请填写0。请参见创建时间线标志
videoFps视频帧率,最大60fps
audioEditRes音频解析度(指定采样率、采样格式及声道数)。对于音频编辑解析度,传入的采样率值支持两种:44100与48000。支持单声道和立体声
返回
返回创建的时间线对象
自从
3.5.0
参见
removeTimeline

◆ createTimeline:videoFps:audioEditRes:

- (NvsTimeline *) createTimeline: (NvsVideoResolution *)  videoEditRes
videoFps: (NvsRational *)  videoFps
audioEditRes: (NvsAudioResolution *)  audioEditRes 

创建时间线

参数
videoEditRes视频编辑解析度(指定视频宽高及像素比)。对于视频编辑解析度,在传入对应参数值时,目前要求传入的图像宽度值是4的倍数,高度值是2的倍数。注:如果创建NvsStreamingContext单例对象,支持4k视频编辑,则视频编辑解析度里的imageWidth * imageHeight不能高于3840*2160像素,否则视频编辑解析度里的imageWidth * imageHeight不能高于1920 * 1080像素。
videoFps视频帧率,最高60fps
audioEditRes音频编辑解析度(指定采样率、采样格式及声道数)。对于音频编辑解析度,传入的采样率值支持两种:44100与48000,支持单声道和双声道
返回
返回创建的时间线对象,如果参数不满足上述条件,则返回null
参见
- removeTimeline:

◆ createTimeline:videoFps:audioEditRes:bitDepth:flags:

- (NvsTimeline *) createTimeline: (NvsVideoResolution *)  videoEditRes
videoFps: (NvsRational *)  videoFps
audioEditRes: (NvsAudioResolution *)  audioEditRes
bitDepth: (NvsVideoResolutionBitDepth depth
flags: (int)  flags 

创建时间线

参数
videoEditRes视频编辑解析度(指定视频宽高及像素比)。对于视频编辑解析度,在传入对应参数值时,目前要求传入的图像宽度值是4的倍数,高度值是2的倍数。注:如果创建NvsStreamingContext单例对象,支持4k视频编辑,则视频编辑解析度里的imageWidth * imageHeight不能高于3840*2160像素,否则视频编辑解析度里的imageWidth * imageHeight不能高于1920 * 1080像素。
videoFps视频帧率,最高60fps
audioEditRes音频编辑解析度(指定采样率、采样格式及声道数)。对于音频编辑解析度,传入的采样率值支持两种:44100与48000,支持单声道和双声道
bitDepth时间线视频的位深度,目前支持8bit, 16bit float,和auto
flags创建时间线的特殊标志,如果没有特殊需求,请填写0。请参见NvsCreateTimelineTypeFlag
返回
返回创建的时间线对象,如果参数不满足上述条件,则返回null
自从
2.24.0
参见
- removeTimeline:

◆ createTimeline:videoFps:audioEditRes:flags:

- (NvsTimeline *) createTimeline: (NvsVideoResolution *)  videoEditRes
videoFps: (NvsRational *)  videoFps
audioEditRes: (NvsAudioResolution *)  audioEditRes
flags: (int)  flags 

创建时间线

参数
videoEditRes视频编辑解析度(指定视频宽高及像素比)。对于视频编辑解析度,在传入对应参数值时,目前要求传入的图像宽度值是4的倍数,高度值是2的倍数。注:如果创建NvsStreamingContext单例对象,支持4k视频编辑,则视频编辑解析度里的imageWidth * imageHeight不能高于3840*2160像素,否则视频编辑解析度里的imageWidth * imageHeight不能高于1920 * 1080像素。
videoFps视频帧率,最高60fps
audioEditRes音频编辑解析度(指定采样率、采样格式及声道数)。对于音频编辑解析度,传入的采样率值支持两种:44100与48000,支持单声道和双声道
flags创建时间线的特殊标志,如果没有特殊需求,请填写0。请参见NvsCreateTimelineTypeFlag
返回
返回创建的时间线对象,如果参数不满足上述条件,则返回null
自从
2.21.0
参见
- removeTimeline:

◆ createVideoFrameRetriever:

- (NvsVideoFrameRetriever *) createVideoFrameRetriever: (NSString *)  videoFilePath

创建视频帧提取对象

参数
videoFilePath原始视频文件路径
返回
返回NvsVideoFrameRetriever对象,表示视频帧提取对象
自从
1.2.0

◆ destoryAuxiliaryStreamingContext:

- (void) destoryAuxiliaryStreamingContext: (NvsStreamingContext *)  auxContext

销毁辅助流媒体上下文对象

参数
NvsStreamingContext被销毁的流媒体上下文对象
自从
2.12.0

◆ destroyInstance

+ (void) destroyInstance

销毁流媒体上下文实例。

参见
+ sharedInstance

◆ detectEngineRenderFramePerSecond

- (float) detectEngineRenderFramePerSecond

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

自从
2.8.0

◆ detectVideoFileKeyframeInterval:

- (int) detectVideoFileKeyframeInterval: (NSString *)  videoFilePath

探测视频文件的I帧间距

参数
videoFilePath视频文件的路径
返回
返回探测到的I帧间距,返回0表示探测失败
自从
1.6.0

◆ exportProjectInfo:timeline:requestedAspectRatio:

- (BOOL) exportProjectInfo: (NSString *)  projectUuid
timeline: (NvsTimeline *)  timeline
requestedAspectRatio: (int)  requestedAspectRatio 

输出项目包的信息

参数
projectUuid项目资源包ID
timeline时间线对象
requestedAspectRatio所需的项目画幅比例,一般和timeline的画幅比例一致.请参见资源包画幅比例
返回
返回是否成功

◆ exportTemplateInfo:timeline:requestedAspectRatio:

- (BOOL) exportTemplateInfo: (NSString *)  templateUuid
timeline: (NvsTimeline *)  timeline
requestedAspectRatio: (int)  requestedAspectRatio 

输出模版包的信息

参数
templateUuid模版资源包ID
timeline时间线对象
requestedAspectRatio所需的模版画幅比例,一般和timeline的画幅比例一致.请参见模板资源包画幅比例
返回
返回是否成功

◆ functionalityAuthorised:

+ (BOOL) functionalityAuthorised: (NSString *)  sdkFunctionName

验证某项功能是否可用。

参数
sdkFunctionNamesdk功能的名字
返回
返回BOOL值。YES表示授权验证成功,NO则验证失败。

◆ generateProjectPackage:innerAssetDir:projectOutputDir:

- (BOOL) generateProjectPackage: (NSString *)  projectUuid
innerAssetDir: (NSString *)  innerAssetDir
projectOutputDir: (NSString *)  projectOutputDir 

生成项目包

参数
projectUuid项目资源包ID
innerAssetDir项目内部资源文件夹路径
projectOutputDir项目资源包的输出路径
返回
返回是否成功

◆ generateTemplatePackage:innerAssetDir:templateOutputDir:

- (BOOL) generateTemplatePackage: (NSString *)  templateUuid
innerAssetDir: (NSString *)  innerAssetDir
templateOutputDir: (NSString *)  templateOutputDir 

生成模版包

参数
templateUuid模版资源包ID
innerAssetDir模版内部资源文件夹路径
templateOutputDir模版资源包的输出路径
返回
返回是否成功

◆ getAllBuiltinAudioFxNames

- (NSArray *) getAllBuiltinAudioFxNames

获取全部内嵌音频特效名称

返回
返回包含所有内嵌的音频特效名称的数组对象
参见
- getAllBuiltinVideoFxNames

◆ getAllBuiltinCaptureVideoFxNames

- (NSArray *) getAllBuiltinCaptureVideoFxNames

获取全部内嵌采集视频特效名称

返回
返回包含所有内嵌的采集视频特效名称的数组对象
参见
- getBeautyVideoFxName
- getAllBuiltinVideoFxNames

◆ getAllBuiltinVideoFxNames

- (NSArray *) getAllBuiltinVideoFxNames

获取全部内嵌视频特效名称

返回
返回包含所有内嵌的视频特效名称的数组对象
参见
- getAllBuiltinAudioFxNames

◆ getAllBuiltinVideoTransitionNames

- (NSArray *) getAllBuiltinVideoTransitionNames

获取全部内嵌视频转场名称

返回
返回包含所有内嵌的视频转场名称的数组对象
参见
- getAllBuiltinCaptureVideoFxNames
- getBeautyVideoFxName
- getDefaultVideoTransitionName

◆ getAudioFxDescription:

- (NvsFxDescription *) getAudioFxDescription: (NSString *)  fxName

获取音频特效描述

参数
fxName音频特效名称
返回
返回音频特效描述的对象
参见
- getVideoFxDescription:

◆ getAVFileInfo:

- (NvsAVFileInfo *) getAVFileInfo: (NSString *)  avFilePath

获取文件的音视频信息,如果文件格式不支持,则返回null

参数
avFilePath文件路径
返回
返回音视频文件信息的对象

◆ getAVFileInfo:extraFlag:withError:

- (NvsAVFileInfo *) getAVFileInfo: (NSString *)  avFilePath
extraFlag: (int)  extraFlag
withError: (NSMutableString *)  errString 

获取音视频文件的详细信息

参数
avFilePath音视频文件的路径
extraFlag获取音视频文件的详细信息的特殊标识。请参见获取音视频信息时的特殊标识
errString如果当前函数返回为null, 当前参数有意义, 返回具体的错误信息。
返回
返回获取的音视频信息对象,如果音视频文件格式不支持则返回null
自从
2.20.0

◆ getAVFileInfoExtra:extraFlag:

- (NvsAVFileInfo *) getAVFileInfoExtra: (NSString *)  avFilePath
extraFlag: (int)  extraFlag 

获取文件的音视频信息,如果文件格式不支持,则返回null

参数
avFilePath文件路径
extraFlag音视频信息特殊标识。请参见音视频信息flag
返回
返回音视频文件信息的对象

◆ getBeautyVideoFxName

- (NSString *) getBeautyVideoFxName

获得美颜的视频特效名称

返回
返回美颜视频特效名称
参见
- getAllBuiltinVideoFxNames
- getAllBuiltinCaptureVideoFxNames

◆ getCaptureAnimatedStickerByIndex:

- (NvsCaptureAnimatedSticker *) getCaptureAnimatedStickerByIndex: (unsigned int)  captureStikcerIndex

获得采集动画贴纸

参数
captureStikcerIndex动画贴纸索引
返回
返回动画贴纸对象
参见
removeCaptureAnimatedSticker
自从
2.21.0

◆ getCaptureAnimatedStickerCount

- (unsigned int) getCaptureAnimatedStickerCount

获得采集动画贴纸的数量

返回
返回动画贴纸数量
自从
2.21.0

◆ getCaptureAudioFxByIndex:

- (NvsCaptureAudioFx *) getCaptureAudioFxByIndex: (unsigned int)  captureAudioFxIndex

获得采集音频特效

参数
captureAudioFxIndex音频特效索引
返回
返回音频特效对象
参见
removeCaptureAudioFx
自从
2.21.0

◆ getCaptureAudioFxCount

- (unsigned int) getCaptureAudioFxCount

获得采集音频特效的数量

返回
返回音频特效数量
自从
2.21.0

◆ getCaptureCaptionByIndex:

- (NvsCaptureCaption *) getCaptureCaptionByIndex: (unsigned int)  captureCaptionIndex

获得采集字幕

参数
captureStikcerIndex字幕索引
返回
返回字幕对象
自从
2.21.0

◆ getCaptureCaptionCount

- (unsigned int) getCaptureCaptionCount

获得采集字幕的数量

返回
返回字幕数量
自从
2.21.0

◆ getCaptureCompoundCaptionByIndex:

- (NvsCaptureCompoundCaption *) getCaptureCompoundCaptionByIndex: (unsigned int)  captureCaptionIndex

获得采集复合字幕

参数
captureStikcerIndex复合字幕索引
返回
返回复合字幕对象
自从
2.21.0

◆ getCaptureCompoundCaptionCount

- (unsigned int) getCaptureCompoundCaptionCount

获得采集复合字幕的数量

返回
返回复合字幕数量
自从
2.21.0

◆ getCaptureDeviceCapability:

- (NvsCaptureDeviceCapability *) getCaptureDeviceCapability: (unsigned int)  catpureDeviceIndex

获取采集设备的能力描述对象

参数
catpureDeviceIndex采集设备索引
返回
返回采集设备能力描述对象

◆ getCapturePreviewVideoSize:

- (NvsSize) getCapturePreviewVideoSize: (unsigned int)  catpureDeviceIndex

获取采集预览视频分辨率

参数
catpureDeviceIndex采集设备索引
返回
获取采集预览视频分辨率
自从
1.7.1

◆ getCaptureVideoFxByIndex:

- (NvsCaptureVideoFx *) getCaptureVideoFxByIndex: (unsigned int)  captureVideoFxIndex

获得采集视频特效

参数
captureVideoFxIndex视频特效索引
返回
返回视频特效对象
参见
- removeCaptureVideoFx:

◆ getCaptureVideoFxCount

- (unsigned int) getCaptureVideoFxCount

获得采集视频特效的数量

返回
返回视频特效数量

◆ getColorGainForSDRToHDR

- (float) getColorGainForSDRToHDR

获取在SDR向HDR转换时候色彩增益

返回
返回色彩增益值 范围是【1.0,10.0】
自从
2.23.0
参见
setColorGainForSDRToHDR

◆ getCurrentCaptureSceneId

- (NSString *) getCurrentCaptureSceneId

取得当前拍摄场景资源包的ID

返回
当前拍摄场景资源包的ID字符串,返回nil表示当前没有拍摄场景资源包
自从
1.2.0
参见
- applyCaptureScene:
- removeCurrentCaptureScene

◆ getCustomCompileVideoHeight

- (unsigned int) getCustomCompileVideoHeight

获取当前自定义的生成视频高度。

返回
返回当前自定义的生成视频高度
自从
1.6.1

◆ getDefaultThemeEndingLogoImageFilePath

- (NSString *) getDefaultThemeEndingLogoImageFilePath

获取默认主题logo图片路径

返回
返回表示图片路径
参见
- setDefaultThemeEndingLogoImageFilePath:

◆ getDefaultVideoTransitionName

- (NSString *) getDefaultVideoTransitionName

获得默认视频转场名称

返回
返回表示默认转场名称的字符串
参见
- getAllBuiltinVideoTransitionNames

◆ getEAGLSharegroup

- (EAGLSharegroup *) getEAGLSharegroup

从流媒体上下文中获取引擎所用的EAGLSharegroup对象

自从
1.5.0

◆ getEngineHDRCaps

- (int) getEngineHDRCaps

获取引擎的HDR能力

返回
返回int值。请参见HDR能力标志

◆ getExposureBias

- (float) getExposureBias

获取曝光补偿

返回
返回曝光补偿值
参见
- setExposureBias:

◆ getFlashMode

- (NvsCameraFlashMode) getFlashMode

获取当前闪光灯模式

返回
闪光灯模式值。请参见闪光灯模式。
参见
toggleFlashMode

◆ getFontInfoByFilePath:

- (NSArray*) getFontInfoByFilePath: (NSString *)  fontFilePath

获取字体文件中字体信息

参数
fontFilePath字体文件路径
返回
返回文件中所有字体的信息

◆ getLogFileDirectory

+ (NSString *) getLogFileDirectory

获取日志文件所在路径

自从
2.14.0

◆ getSdkVersion:minorVersion:revisionNumber:

+ (void) getSdkVersion: (int *)  majorVersion
minorVersion: (int *)  minorVersion
revisionNumber: (int *)  revisionNumber 

获取美摄SDK的版本信息

参数
majorVersion主版本号
minorVersion次版本号
revisionNumber修订版本号
自从
1.4.1

◆ getStreamingEngineState

- (NvsStreamingEngineState) getStreamingEngineState

获取引擎状态

返回
返回引擎状态

◆ getTimelineCurrentPosition:

- (int64_t) getTimelineCurrentPosition: (NvsTimeline *)  timeline

取得时间线当前时间位置,单位为微秒

参数
timeline时间线
返回
返回时间线的当前位置值

◆ getVideoFxDescription:

- (NvsFxDescription *) getVideoFxDescription: (NSString *)  fxName

获取视频特效描述

参数
fxName视频特效名称
返回
返回视频特效描述的对象
参见
- getAudioFxDescription:

◆ getVideoStabilization

- (VideoStabilizationFlag) getVideoStabilization

获取当前的视频防抖动标志

返回
返回当前标志.
参见
- setVideoStabilization:

◆ getZoomFactor

- (float) getZoomFactor

获取缩放因子

返回
返回缩放因子值
参见
- setZoomFactor:

◆ grabImageFromTimeline:timestamp:proxyScale:

- (UIImage *) grabImageFromTimeline: (NvsTimeline *)  timeline
timestamp: (int64_t)  timestamp
proxyScale: (const NvsRational *)  proxyScale 

获取时间线某一时间戳的图像。详细情况参见视频帧图像提取专题

参数
timeline欲获取图像的时间线对象
timestamp欲获取图像的时间戳(单位是微秒)。timestamp取值范围在[0,timeline.duration - 1]。传入其他值无效,grabImageFromTimeline会返回nil。
proxyScale代理缩放比例,填写nil表示使用默认比例1:1
返回
返回该时间戳图像的UIImage对象,如果获取图像失败返回nil
自从
1.1.2

◆ grabImageFromTimeline:timestamp:proxyScale:flags:

- (UIImage *) grabImageFromTimeline: (NvsTimeline *)  timeline
timestamp: (int64_t)  timestamp
proxyScale: (const NvsRational *)  proxyScale
flags: (int)  flags 

获取时间线某一时间戳的图像。详细情况参见视频帧图像提取专题

参数
timeline欲获取图像的时间线对象
timestamp欲获取图像的时间戳(单位是微秒)。timestamp取值范围在[0,timeline.duration - 1]。传入其他值无效,grabImageFromTimeline会返回nil。
proxyScale代理缩放比例,填写nil表示使用默认比例1:1
flags引擎定位的特殊标志。请参见 NvsStreamingEngineSeekFlag
返回
返回该时间戳图像的UIImage对象,如果获取图像失败返回nil
自从
1.16.0

◆ grabImageFromTimelineAsync:timestamp:proxyScale:flags:

- (BOOL) grabImageFromTimelineAsync: (NvsTimeline *)  timeline
timestamp: (int64_t)  timestamp
proxyScale: (const NvsRational *)  proxyScale
flags: (int)  flags 

获取时间线某一时间戳的图像。详细情况参见视频帧图像提取专题 这个函数是内部异步调用,需要保证在获取到图像之前不会调用SeekTimeline(),如果在调用这个函数之后调用SeekTimeline的函数有可能收不到图像的回调,可以在这个函数之后调用Stop保证Grab image能执行成功

参数
timeline欲获取图像的时间线对象
timestamp欲获取图像的时间戳(单位微秒)。timestamp取值范围在[0,timeline.duration - 1]。传入其他值无效,grabImageFromTimeline会返回null。
proxyScale代理缩放比例
flags引擎定位的特殊标志。具体参见引擎定位标识
返回
返回布尔值,
自从
2.15.0

◆ hasARModule

+ (int) hasARModule

检测当前SDK是否含有AR模块

返回
返回值0表示不含有AR模块,大于0表示含有AR模块
自从
2.5.0

◆ initHumanDetection:licenseFilePath:features:

+ (BOOL) initHumanDetection: (NSString *)  modelFilePath
licenseFilePath: (NSString *)  licenseFilePath
features: (int)  features 

初始化人体检测机制, 只初始化一次

参数
modelFilePath模型文件路径
licenseFilePath授权文件路径
features人体检测特征标志字段。请参见人体检测特征标志
自从
2.5.0
参见
+ closeHumanDetection

◆ initHumanDetectionExt:licenseFilePath:features:

+ (BOOL) initHumanDetectionExt: (NSString *)  modelFilePath
licenseFilePath: (NSString *)  licenseFilePath
features: (int)  features 

初始化人体检测扩展机制,必须先调用initHumanDetection

参数
modelFilePath模型文件路径
licenseFilePath授权文件路径
features人体检测特征标志字段。请参见人体检测特征标志
自从
2.5.0

◆ insertBeautyCaptureVideoFx:

- (NvsCaptureVideoFx *) insertBeautyCaptureVideoFx: (unsigned int)  insertPosition

插入一个美颜视频特效

参数
insertPosition插入位置,是指特效的渲染顺序
返回
返回插入的美颜视频特效对象
参见
- appendBeautyCaptureVideoFx:

◆ insertBuiltinCaptureAudioFx:withInsertPosition:

- (NvsCaptureAudioFx *) insertBuiltinCaptureAudioFx: (NSString *)  audioFxName
withInsertPosition: (unsigned int)  insertPosition 

插入一个内建音频特效

参数
audioFxName音频特效名。获取音频特效名称,请参见getAllBuiltinCaptureAudioFxNames()或内建特效名称列表
insertPosition插入位置,是指特效的渲染顺序
返回
返回插入的内建音频特效对象
参见
appendBuiltinCaptureAudioFx
自从
2.21.0

◆ insertBuiltinCaptureVideoFx:withInsertPosition:

- (NvsCaptureVideoFx *) insertBuiltinCaptureVideoFx: (NSString *)  videoFxName
withInsertPosition: (unsigned int)  insertPosition 

插入一个内建视频特效

参数
videoFxName视频特效名。获取视频特效名称,请参见getAllBuiltinCaptureVideoFxNames()内建特效名称列表
insertPosition插入位置,是指特效的渲染顺序
返回
返回插入的内建视频特效对象
参见
- appendBuiltinCaptureVideoFx:

◆ insertCaptureAnimatedSticker:duration:animatedStickerPackageId:insertPosition:

- (NvsCaptureAnimatedSticker *) insertCaptureAnimatedSticker: (int64_t)  offsetTime
duration: (int64_t)  duration
animatedStickerPackageId: (NSString *)  animatedStickerPackageId
insertPosition: (unsigned int)  insertPosition 

追加一个动画贴纸

参数
offsetTime动画贴纸的偏移时间。
duration动画贴纸的持续时间。
animatedStickerPackageId动画贴纸包Id。
insertPosition插入位置.
返回
返回采集动画贴纸对象
以下情况会返回null:
1.没有动画贴纸功能授权;
2.animatedStickerPackageId参数为空字符串或者null;
3.该动画贴纸包没有安装成功;
参见
appendCaptureAnimatedSticker
自从
2.21.0

◆ insertCaptureCaption:offsetTime:duration:captionStylePackageId:insertPosition:

- (NvsCaptureCaption *) insertCaptureCaption: (NSString *)  captionText
offsetTime: (int64_t)  offsetTime
duration: (int64_t)  duration
captionStylePackageId: (NSString *)  captionStylePackageId
insertPosition: (unsigned int)  insertPosition 

插入一个字幕

参数
captionText字幕的文字
offsetTime字幕的偏移时间。
duration字幕的持续时间。
captionStylePackageId字幕样式包Id,不存在的话,可以传空字符串或者null
insertPosition插入位置.
返回
返回采集字幕对象
以下情况会返回null:
1.没有复合字幕功能授权;
参见
appendCaptureCompoundCaption
自从
2.21.0

◆ insertCaptureCompoundCaption:duration:compoundCaptionPackageId:insertPosition:

- (NvsCaptureCompoundCaption *) insertCaptureCompoundCaption: (int64_t)  offsetTime
duration: (int64_t)  duration
compoundCaptionPackageId: (NSString *)  compoundCaptionPackageId
insertPosition: (unsigned int)  insertPosition 

插入一个复合字幕

参数
offsetTime复合字幕的偏移时间。
duration复合字幕的持续时间。
compoundCaptionPackageId复合字幕包Id。
insertPosition插入位置.
返回
返回采集复合字幕对象
以下情况会返回null:
1.没有复合字幕功能授权;
参见
appendCaptureCompoundCaption
自从
2.21.0

◆ insertCaptureModularCaption:offsetTime:duration:insertPosition:

- (NvsCaptureCaption *) insertCaptureModularCaption: (NSString *)  captionText
offsetTime: (int64_t)  offsetTime
duration: (int64_t)  duration
insertPosition: (unsigned int)  insertPosition 

插入一个模块字幕

参数
captionText字幕的文字
offsetTime字幕的偏移时间。
duration字幕的持续时间。
insertPosition插入位置.
返回
返回采集字幕对象
以下情况会返回null:
1.没有复合字幕功能授权;
参见
appendCaptureCompoundCaption
自从
2.21.0

◆ insertCustomCaptureAnimatedSticker:duration:animatedStickerPackageId:customImagePath:insertPosition:

- (NvsCaptureAnimatedSticker *) insertCustomCaptureAnimatedSticker: (int64_t)  offsetTime
duration: (int64_t)  duration
animatedStickerPackageId: (NSString *)  animatedStickerPackageId
customImagePath: (NSString *)  customImagePath
insertPosition: (unsigned int)  insertPosition 

插入一个动画贴纸

参数
offsetTime动画贴纸的偏移时间。
duration动画贴纸的持续时间。
animatedStickerPackageId动画贴纸包Id。
customImagePath自定义动画贴纸图像路径(可以是jpg、png图像,或者美摄sdk内部支持的动态caf格式图像)
insertPosition插入位置.
返回
返回采集动画贴纸对象
以下情况会返回null:
1.没有动画贴纸功能授权;
2.animatedStickerPackageId参数为空字符串或者null;
3.该动画贴纸包没有安装成功;
参见
appendCaptureAnimatedSticker
自从
3.2.0

◆ insertCustomCaptureVideoFx:withInsertPosition:

- (NvsCaptureVideoFx *) insertCustomCaptureVideoFx: (id< NvsCustomVideoFxRenderer >)  customVideoFxRender
withInsertPosition: (int)  insertPosition 

插入自定义采集视频特效

参数
customVideoFxRender用户实现的自定义视频特效渲染器接口
insertPosition插入位置,是指特效的渲染顺序
返回
返回插入的采集视频特效对象
警告
此接口会引发流媒体引擎状态跳转到引擎停止状态,具体情况请参见引擎变化专题
自从
1.7.0

◆ insertPackagedCaptureVideoFx:withInsertPosition:

- (NvsCaptureVideoFx *) insertPackagedCaptureVideoFx: (NSString *)  videoFxPackageId
withInsertPosition: (unsigned int)  insertPosition 

插入一个包裹视频特效

参数
videoFxPackageId视频特效包裹ID
insertPosition插入位置,是指特效的渲染顺序
返回
返回插入的包裹视频特效对象
参见
- appendPackagedCaptureVideoFx:

◆ isBlackFrame:

- (BOOL) isBlackFrame: (UIImage *)  image

检测是否是纯黑色的图片。

参数
待检测的image

◆ isCaptureDeviceBackFacing:

- (BOOL) isCaptureDeviceBackFacing: (unsigned int)  catpureDeviceIndex

是否为后置采集设备

参数
catpureDeviceIndex采集设备索引
返回
返回BOOL值。返回YES则是后置采集设备,NO则不是。

◆ isCompilingPaused

- (BOOL) isCompilingPaused

检查生成时间线是否暂停了

返回
返回布尔值表示生成时间线是否暂停了
自从
2.9.0
参见
- pauseCompiling

◆ isFlashOn

- (BOOL) isFlashOn

开/关换补光灯状态

返回
返回BOOL值。返回YES则换补光灯是打开状态,NO则是关闭状态。
参见
- toggleFlash:

◆ isPlaybackPaused

- (BOOL) isPlaybackPaused

检查播放时间线是否暂停了

返回
返回布尔值表示播放时间线是否暂停了
自从
2.18.0
参见
- pauseCompiling

◆ isRecordingPaused

- (BOOL) isRecordingPaused

检查录制是否已经暂停

返回
返回布尔值。值为YES则录制已经暂停,NO为未暂停。
自从
1.17.0
参见
- pauseRecording
- resumeRecording

◆ loadProject:resourceDir:

- (NvsTimeline *) loadProject: (NSString *)  projectId
resourceDir: (NSString *)  resourceDir 

用项目资源创建时间线

参数
projectId项目uuid
resourceDir项目资源文件夹路径
返回
返回创建的时间线对象
参见
removeTimeline

◆ pauseCompiling

- (BOOL) pauseCompiling

暂定生成时间线

返回
返回布尔值表示暂停是否成功
自从
2.9.0
参见
- resumeCompiling

◆ pausePlayback

- (BOOL) pausePlayback

暂停播放时间线

返回
返回布尔值表示暂停是否成功
自从
2.18.0
参见
- resumeCompiling

◆ pauseRecording

- (BOOL) pauseRecording

暂停录制采集信号。暂停录制之后再继续录制会录制到同一个媒体文件中。注意:只有不使用系统内置recorder时才能暂停录制!

返回
返回布尔值。值为YES则暂停录制成功,NO则失败。
自从
1.17.0
参见
- resumeRecording

◆ playbackTimeline:startTime:endTime:proxyScale:preload:flags:

- (BOOL) playbackTimeline: (NvsTimeline *)  timeline
startTime: (int64_t)  startTime
endTime: (int64_t)  endTime
proxyScale: (const NvsRational *)  proxyScale
preload: (BOOL)  preload
flags: (int)  flags 

播放时间线

参数
timeline时间线
startTime开始时间(单位是微秒)。startTime取值范围在[0,timeline.duration - 1]。传入其他值无效,playbackTimeline会返回No导致无法开启播放。
endTime结束时间(单位是微秒)。如果endTime值传入是负值,则默认播放到视频末尾。
proxyScale代理缩放比例
preload是否预先加载
flags预览的特殊标志,如无特殊需求,请填写0。请参见 NvsStreamingEnginePlaybackFlag
返回
返回BOOL值。注意:播放时间线是异步操作。返回YES则可以开启播放时间线,NO则无法开启播放。
警告
此接口会引发流媒体引擎状态跳转到引擎停止状态,具体情况请参见引擎变化专题
参见
- playbackTimeline:startTime:endTime:videoSizeMode:preload:flags:
- seekTimeline:timestamp:proxyScale:flags:
- compileTimeline:startTime:endTime:outputFilePath:videoResolutionGrade:videoBitrateGrade:flags:

◆ playbackTimeline:startTime:endTime:videoSizeMode:preload:flags:

- (BOOL) playbackTimeline: (NvsTimeline *)  timeline
startTime: (int64_t)  startTime
endTime: (int64_t)  endTime
videoSizeMode: (NvsVideoPreviewSizeMode videoSizeMode
preload: (BOOL)  preload
flags: (int)  flags 

播放时间线

参数
timeline时间线
startTime开始时间(单位是微秒)。startTime取值范围在[0,timeline.duration - 1]。传入其他值无效,playbackTimeline会返回No导致无法开启播放。
endTime结束时间(单位是微秒)。如果endTime值传入是负值,则默认播放到视频末尾。
videoSizeMode图像预览模式
preload是否预先加载
flags预览的特殊标志,如无特殊需求,请填写0。请参见 NvsStreamingEnginePlaybackFlag
返回
返回BOOL值。注意:播放时间线是异步操作。返回YES则可以开启播放时间线,NO则无法开启播放。
警告
此接口会引发流媒体引擎状态跳转到引擎停止状态,具体情况请参见引擎变化专题
参见
- playbackTimeline:startTime:endTime:proxyScale:preload:flags:
- compileTimeline:startTime:endTime:outputFilePath:videoResolutionGrade:videoBitrateGrade:flags:
- seekTimeline:timestamp:videoSizeMode:flags:

◆ preloadEffectResources

- (BOOL) preloadEffectResources

预加载特技资源

自从
2.18.1

◆ registerFontByFilePath:

- (NSString*) registerFontByFilePath: (NSString *)  fontFilePath

获取字体文件的fontFamily

参数
fontFilePath字体文件路径
返回
返回字体的fontFamily

◆ removeAllCaptureAnimatedSticker

- (void) removeAllCaptureAnimatedSticker

移除所有采集动画贴纸

参见
removeCaptureAnimatedSticker
- getCaptureAnimatedStickerCount
自从
2.21.0

◆ removeAllCaptureAudioFx

- (void) removeAllCaptureAudioFx

移除所有采集视频特效

参见
removeCaptureAudioFx
- getCaptureAudioFxCount
自从
2.21.0

◆ removeAllCaptureCaption

- (void) removeAllCaptureCaption

移除所有采集字幕

自从
2.21.0

◆ removeAllCaptureCompoundCaption

- (void) removeAllCaptureCompoundCaption

移除所有采集复合字幕

自从
2.21.0

◆ removeAllCaptureVideoFx

- (void) removeAllCaptureVideoFx

移除所有采集视频特效

参见
- removeCaptureVideoFx:
- getCaptureVideoFxCount

◆ removeCaptureAnimatedSticker:

- (BOOL) removeCaptureAnimatedSticker: (unsigned int)  captureAnimagedStickerIndex

对移除特定索引值的采集动画贴纸

参数
captureVideoFxIndex动画贴纸索引
返回
返回boolean值。返回YES则移除成功,NO则失败
参见
appendCaptureAnimatedSticker
自从
2.21.0

◆ removeCaptureAudioFx:

- (BOOL) removeCaptureAudioFx: (unsigned int)  captureAudioFxIndex

对移除特定索引值的采集音频特效

参数
captureVideoFxIndex音频特效索引
返回
返回boolean值。返回YES则移除成功,NO则失败
参见
appendBuiltinCaptureAudioFx
自从
2.21.0

◆ removeCaptureCaption:

- (BOOL) removeCaptureCaption: (unsigned int)  captureCaptionIndex

对移除特定索引值的采集字幕

参数
captureCompoundCaptionIndex字幕贴纸索引
返回
返回boolean值。返回YES则移除成功,NO则失败
自从
2.21.0

◆ removeCaptureCompoundCaption:

- (BOOL) removeCaptureCompoundCaption: (unsigned int)  captureCompoundCaptionIndex

对移除特定索引值的采集复合字幕

参数
captureCompoundCaptionIndex复合字幕索引
返回
返回boolean值。返回YES则移除成功,NO则失败
自从
2.21.0

◆ removeCaptureVideoFx:

- (BOOL) removeCaptureVideoFx: (unsigned int)  captureVideoFxIndex

对移除特定索引值的采集视频特效

参数
captureVideoFxIndex视频特效索引
返回
返回BOOL值。返回YES则移除成功,NO则失败
参见
- appendBuiltinCaptureVideoFx:
- appendPackagedCaptureVideoFx:
- appendBeautyCaptureVideoFx

◆ removeCurrentCaptureScene

- (void) removeCurrentCaptureScene

移除当前拍摄场景

自从
1.2.0
参见
- applyCaptureScene:
- getCurrentCaptureSceneId

◆ removeTimeline:

- (BOOL) removeTimeline: (NvsTimeline *)  timeline

移除时间线

参数
timeline要移除的时间线
返回
返回BOOL值。YES 移除成功;NO 移除失败
警告
此接口会引发流媒体引擎状态跳转到引擎停止状态,具体情况请参见引擎变化专题
参见
- createTimeline:videoFps:audioEditRes:

◆ removeUserWatermarkForCapture

- (void) removeUserWatermarkForCapture

移除为视频采集添加的用户水印。

自从
2.0.1

◆ resumeCompiling

- (BOOL) resumeCompiling

恢复生成时间线

返回
返回布尔值表示恢复是否成功
自从
2.9.0
参见
- pauseCompiling

◆ resumePlayback

- (BOOL) resumePlayback

恢复播放时间线

返回
返回布尔值表示恢复是否成功
自从
2.18.0
参见
- pausePlayback

◆ resumeRecording

- (BOOL) resumeRecording

继续录制采集信号。继续录制会录制到暂停之前的同一个媒体文件中。

返回
返回布尔值。值为YES则继续录制成功,NO则失败。
自从
1.17.0
参见
- pauseRecording

◆ sampleColorFromCapturedVideoFrame:

- (NvsColor) sampleColorFromCapturedVideoFrame: (CGRect)  sampleRect

对采集设备的视频帧内容进行采样

参数
sampleRect采样的矩形区域,坐标为实时预览窗口的自身坐标系
返回
返回值为采样的颜色值,该颜色值是采样的矩形区域内所有像素颜色的平均值
自从
1.2.0

◆ seekTimeline:timestamp:proxyScale:flags:

- (BOOL) seekTimeline: (NvsTimeline *)  timeline
timestamp: (int64_t)  timestamp
proxyScale: (const NvsRational *)  proxyScale
flags: (int)  flags 

定位某一时间戳的图像

参数
timeline时间线
timestamp时间戳(单位是微秒)。timestamp取值范围在[0,timeline.duration - 1]。传入其他值无效,seekTimeline会返回No,导致无法开启定位。
proxyScale代理缩放比例
flags引擎定位的特殊标志。请参见 NvsStreamingEngineSeekFlag
返回
返回BOOL值。注意:定位某时间戳图像是异步操作。返回值为YES则成功开启定位,NO则无法开启定位。
警告
此接口会引发流媒体引擎状态跳转到引擎停止状态,具体情况请参见引擎变化专题
参见
- seekTimeline:timestamp:videoSizeMode:flags:
- playbackTimeline:startTime:endTime:videoSizeMode:preload:flags:
- compileTimeline:startTime:endTime:outputFilePath:videoResolutionGrade:videoBitrateGrade:flags:

◆ seekTimeline:timestamp:videoSizeMode:flags:

- (BOOL) seekTimeline: (NvsTimeline *)  timeline
timestamp: (int64_t)  timestamp
videoSizeMode: (NvsVideoPreviewSizeMode videoSizeMode
flags: (int)  flags 

定位某一时间戳的图像

参数
timeline时间线
timestamp时间戳(单位是微秒)。timestamp取值范围在[0,timeline.duration - 1]。传入其他值无效,seekTimeline会返回No,导致无法开启定位。
videoSizeMode图像预览模式
flags引擎定位的特殊标志。请参见 NvsStreamingEngineSeekFlag
返回
返回BOOL值。注意:定位某时间戳图像是异步操作。返回值为YES则成功开启定位,NO则无法开启定位。
警告
此接口会引发流媒体引擎状态跳转到引擎停止状态,具体情况请参见引擎变化专题
参见
- compileTimeline:startTime:endTime:outputFilePath:videoResolutionGrade:videoBitrateGrade:flags:
- playbackTimeline:startTime:endTime:proxyScale:preload:flags:
- seekTimeline:timestamp:proxyScale:flags:

◆ sendAudioSamplesToCapturePreview:

- (BOOL) sendAudioSamplesToCapturePreview: (CMSampleBufferRef)  data

输入buffer给采集设备预览

参数
data输入buffer的数据和相应信息。
返回
返回BOOL值。
参见
startBufferCapturePreview

◆ sendBufferToCapturePreview:

- (BOOL) sendBufferToCapturePreview: (const NvsVideoFrameInfo *)  data

输入buffer给采集设备预览

参数
data输入buffer的数据和相应信息。仅支持NV12格式的数据
返回
返回BOOL值。
参见
startBufferCapturePreview

◆ setAudioOutputDeviceVolume:

- (void) setAudioOutputDeviceVolume: (float)  volume

设置音频输出设备音量

参数
volume新的音量 取值范围[0,1]
自从
2.14.0

◆ setAudioSampleInfoForCallback:

- (void) setAudioSampleInfoForCallback: (NvsCapturedAudioSampleInfo *)  info

设置需要回调的采集音频信息

参数
info采集音频信息

◆ setAudioVUMeterEnabled:

- (void) setAudioVUMeterEnabled: (BOOL)  enable

设置是否输出音频输出的DB值

参数
enable是否输出
自从
2.20.0

◆ setCaptureFps:

- (void) setCaptureFps: (int)  fps

设置采集帧率。

参数
fps每秒钟的帧数量

◆ setColorGainForSDRToHDR:

- (void) setColorGainForSDRToHDR: (float)  gain

设置在SDR向HDR转换时候色彩增益

参数
gain为色彩增益 范围是【1.0,10.0】
自从
2.23.0
参见
- getColorGainForSDRToHDR

◆ setCustomCompileVideoHeight:

- (void) setCustomCompileVideoHeight: (unsigned int)  videoHeight

设置自定义的生成视频高度。
在生成时视频时,设置生成视频的分辨率高度级别为NvsCompileVideoResolutionGradeCustom 就可以使用自定义的生成视频高度。但是请注意,为了保证视频生成成功,美摄SDK会对高度进行适当的对齐, 因此最终生成的视频高度不一定就是这里设置的高度!

参数
videoHeight自定义的生成视频高度
自从
1.6.1
参见
compileTimeline

◆ setDebugLevel:

+ (void) setDebugLevel: (NvsDebugLevel debugLevel

设置Debug的级别

参数
debugLevel的级别
自从
3.6.0

◆ setDefaultAudioTransitionName:

- (void) setDefaultAudioTransitionName: (NSString *)  name

设置默认视频转场名称

参数
name音频转场的名字
参见
- getAllBuiltinVideoTransitionNames

◆ setDefaultImageClipDuration:

- (void) setDefaultImageClipDuration: (int64_t)  defaultImageClipDuration

设置缺省图像片段持续时长

参数
defaultImageClipDuration图像片段持续时长
自从
3.4.0

◆ setDefaultThemeEndingLogoImageFilePath:

- (BOOL) setDefaultThemeEndingLogoImageFilePath: (NSString *)  logoImageFilePath

设置默认主题logo图片路径

参数
logoImageFilePathlogo图片文件路径
返回
返回BOOL值。YES 设置成功;NO 设置失败
参见
- getDefaultThemeEndingLogoImageFilePath

◆ setEnableAudioSampleNotify:

- (void) setEnableAudioSampleNotify: (BOOL)  enable

设置是否输出音频sample

参数
enable是否输出
自从
3.2.0

◆ setExposureBias:

- (void) setExposureBias: (float)  exposureBias

设置曝光补偿

参数
exposureBias曝光补偿值,取值范围可从getCaptureDeviceCapability接口查询
参见
- getExposureBias

◆ setFxPluginBundlePathList:

+ (void) setFxPluginBundlePathList: (NSArray *)  list

设置特效插件路径。

参数
特效插件路径数组

◆ setImageReaderCount:

- (void) setImageReaderCount: ("Use +setMaxImageReaderCount:") 
(macos(10.3, 10.11)) 
(ios(7.0, 8.0))  API_DEPRECATED 

设置image reader 最大个数。

参数
imagereader 最大个数

◆ setMaxAudioReaderCount:

+ (void) setMaxAudioReaderCount: (int)  count

设置 audio reader 最大个数。

参数
audioreader 最大个数

◆ setMaxCafCacheMemorySize:

+ (void) setMaxCafCacheMemorySize: (int)  maxMemorySize

设置caf的最大缓存。

参数
maxMemorySize最大缓存

◆ setMaxCompileCaptionCachedContextCount:

+ (void) setMaxCompileCaptionCachedContextCount: (int)  count

设置导出时缓存的caption context 最大个数。

参数
缓存的captioncontext 最大个数

◆ setMaxEditCaptionCachedContextCount:

+ (void) setMaxEditCaptionCachedContextCount: (int)  count

设置编辑时缓存的caption context 最大个数。

参数
缓存的captioncontext 最大个数

◆ setMaxIconReaderCount:

+ (void) setMaxIconReaderCount: (int)  count

设置 icon reader 最大个数。

参数
iconreader 最大个数

◆ setMaxImageReaderCount:

+ (void) setMaxImageReaderCount: (int)  count

设置max image reader 最大个数。

参数
maximage reader 最大个数

◆ setMaxReaderCount:

+ (void) setMaxReaderCount: (int)  count

设置 file reader 最大个数。

参数
filereader 最大个数

◆ setMaxSoftReaderCount:

+ (void) setMaxSoftReaderCount: (int)  count

设置软件的 file reader 最大个数。

参数
softfile reader 最大个数

◆ setSaveDebugMessagesToFile:

+ (void) setSaveDebugMessagesToFile: (BOOL)  saveDebugMessagesToFile

设置是否将SDK的调试信息写入到文件中,在/Library/Application Support/log/路径下每天会生成一个文件,例如:meishesdklog(2023-01-17).log,如果需要删除文件用户需要自己删除这个目录,美摄sdk不会主动删除.

参数
saveDebugMessagesToFile是否将SDK的调试信息写入到文件中
自从
1.17.0

◆ setSpecialCameraDeviceType:

+ (void) setSpecialCameraDeviceType: (NSString *)  specialCameraType

设置特殊的Camera 的设备类型。

参数
specialCameraType特殊设备类型

◆ setStreamingPoolSizeInByte:

+ (void) setStreamingPoolSizeInByte: (int)  maxMemorySize

设置max image reader 最大个数。

参数
maximage reader 最大个数

◆ setTemplate:customResourceDir:

- (void) setTemplate: (NSString *)  templateUuid
customResourceDir: (NSString *)  customResourceDir 

设置模版自定义资源所在文件夹

参数
templateUuid模版资源包ID
customResourceDir模版资源文件夹路径

◆ setThemeEndingEnabled:

- (BOOL) setThemeEndingEnabled: (BOOL)  enable

设置主题结尾logo特效是否显示

返回
返回BOOL值。YES 设置成功;NO 设置失败
参见
- setDefaultThemeEndingLogoImageFilePath:

◆ setupHumanDetectionData:dataFilePath:

+ (BOOL) setupHumanDetectionData: (int)  dataType
dataFilePath: (NSString *)  dataFilePath 

初始化人体检测数据包

参数
dataType人体检测数据包类型。请参见人体检测数据包类型
dataFilePath数据文件路径
返回
返回值表示是否成功
自从
2.6.0

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

- (void) setUserWatermarkForCapture: (NSString *)  watermarkFilePath
displayWidth: (int)  displayWidth
displayHeight: (int)  displayHeight
opacity: (float)  opacity
position: (NvsTimelineWatermarkPosition position
marginX: (int)  marginX
marginY: (int)  marginY 

为视频采集添加用户水印

参数
watermarkFilePath水印文件的路径,须为PNG或JPG文件
displayWidth水印在视频预览画面中显示的宽度,为0则使用图片文件的宽度
displayHeight水印在视频预览画面中显示的高度,为0则使用图片文件的高度
opacity水印的不透明度, 取值范围 0~1
position水印的位置,请参见 NvsTimelineWatermarkPosition
marginX水印在X方向的边距
marginY水印在Y方向的边距
自从
2.0.1

◆ setVideoStabilization:

- (void) setVideoStabilization: (VideoStabilizationFlag flags

设置视频防抖动

参数
flags视频防抖动值
参见
- getVideoStabilization

◆ setZoomFactor:

- (void) setZoomFactor: (float)  zoomFactor

设置缩放因子

参数
zoomFactor缩放比例,取值范围可从getCaptureDeviceCapability接口查询
参见
- getZoomFactor

◆ sharedInstance

+ (NvsStreamingContext *) sharedInstance

获取流媒体上下文的唯一实例

返回
返回流媒体上下文的对象实例
参见
+ destroyInstance

◆ sharedInstanceWithFlags:

+ (NvsStreamingContext *) sharedInstanceWithFlags: (NvsStreamingContextFlag flags

获取流媒体上下文的唯一实例。详细了解参见4k视频编辑专题

参数
flags标志字段,如无特殊需求请填写0。
返回
返回流媒体上下文的对象实例
自从
1.5.0
参见
+ destroyInstance

◆ startAutoExposure:

- (void) startAutoExposure: (CGPoint)  pointOfInterest

启动自动曝光调节

参数
pointOfInterest曝光调节点

◆ startAutoFocus:

- (void) startAutoFocus: (CGPoint)  focusPointOfInterest

启动自动聚焦

参数
focusPointOfInterest自动聚焦的目标点,坐标为实时预览窗口的自身坐标系
参见
- cancelAutoFocus

◆ startBufferCapturePreview:height:fps:rotation:flipHorizontally:

- (BOOL) startBufferCapturePreview: (unsigned int)  width
height: (unsigned int)  height
fps: (const NvsRational *)  fps
rotation: (int)  rotation
flipHorizontally: (BOOL)  flipHorizontally 

启动输入buffer模式的采集设备预览

参数
width输入buffer的宽
height输入buffer的高
fps输入buffer的帧率
rotation输入buffer的图像旋转角度。请参见 输入buffer的图像旋转角度
flipHorizontally是否需要水平翻转
返回
返回BOOL值。返回YES则启动预览成功,NO则启动预览失败。
参见
sendBufferToCapturePreview

◆ startCapturePreview:videoResGrade:flags:aspectRatio:

- (BOOL) startCapturePreview: (unsigned int)  captureDeviceIndex
videoResGrade: (NvsVideoCaptureResolutionGrade videoResGrade
flags: (int)  flags
aspectRatio: (const NvsRational *)  aspectRatio 

启动采集设备预览

参数
captureDeviceIndex采集设备索引
videoResGrade视频采集分辨率级别。视频分辨率等级是指录制时所拍摄视频短边(即可能是宽度或者是高度)的分辨率值,根据视频横纵比aspectRatio(值为nil则由系统采集设备来决定横纵比)计算得到另一边(即可能是宽度或者是高度)的值。 其包括三种级别,分别是LOW,MEDIUM,HIGH,前置摄像头依次对应480p,540p,720p,后置摄像头依次对应540p,720p,1080p。如果有用户想自定义录制视频的等级, 例如540 * 960,则需要拍摄等横纵比的视频,通过创建宽高依次是540和960的时间线,编辑然后生成。生成时,生成分辨率高度等级里面没有960p的等级,因此需要在生成前调用 setCustomCompileVideoHeight()接口来自定义高度,然后调用生成接口compileTimeline(),生成高度级别设置为NvsCompileVideoResolutionGradeCustom即可。实例代码如下:
    NvsVideoResolution videoEditRes;
    videoEditRes.imageWidth = 540;
    videoEditRes.imageHeight = 960;
    videoEditRes.imagePAR = (NvsRational){1, 1};
    NvsRational videoFps = {25, 1};
    NvsAudioResolution audioEditRes;
    audioEditRes.sampleRate = 48000;
    audioEditRes.channelCount = 2;
    audioEditRes.sampleFormat = NvsAudSmpFmt_S16;
    self.timeline = [_context createTimeline:&videoEditRes videoFps:&videoFps audioEditRes:&audioEditRes];
    [_context setCustomCompileVideoHeight:960];
    [self.context compileTimeline:self.timeline startTime:0 endTime:self.timeline.duration outputFilePath:videoPath
    videoResolutionGrade:NvsCompileVideoResolutionGradeCustom videoBitrateGrade:NvsCompileBitrateGradeMedium flags:0];
flags标志字段,如无特殊需求请填写0。请参见 NvsStreamingEngineCaptureFlag。每个Flag应用场景如下:
NvsStreamingEngineCaptureFlag_GrabCapturedVideoFrame用于视频抠像;
NvsStreamingEngineCaptureFlag_StrictPreviewVideoSize与NvsStreamingEngineCaptureFlag_CaptureBuddyHostVideoFrame结合用于人脸检测;
NvsStreamingEngineCaptureFlag_DontCaptureAudio用于视频直播,不采集音频流,一般不常用。
aspectRatio预览视频横纵比,传入nil则由系统采集设备来决定横纵比
返回
返回BOOL值。返回YES则启动预览成功,NO则启动预览失败。

◆ startContinuousFocus

- (void) startContinuousFocus

启动连续聚焦

◆ startRecording:

- (BOOL) startRecording: (NSString *)  outputFilePath

启动录制采集设备信号。请参见视频录制方式

参数
outputFilePath录制文件的路径。注意: 我们建议输出.mov格式的文件
返回
返回BOOL值。返回YES则启动录制成功,NO则启动失败。
参见
- stopRecording

◆ startRecording:withFlags:

- (BOOL) startRecording: (NSString *)  outputFilePath
withFlags: (int)  flags 

启动录制采集设备信号。请参见视频录制方式

参数
outputFilePath录制文件的路径。注意: 我们建议输出.mov格式的文件
flags标志字段,如无特殊需求请填写0。请参见 NvsStreamingEngineRecordingFlag
返回
返回BOOL值。返回YES则启动录制成功,NO则启动失败。
自从
1.5.1
参见
- stopRecording

◆ startRecording:withFlags:withRecordConfigurations:

- (BOOL) startRecording: (NSString *)  outputFilePath
withFlags: (int)  flags
withRecordConfigurations: (NSMutableDictionary *)  withRecordConfigurations 

启动录制采集设备信号。请参见视频录制方式

参数
outputFilePath录制文件的路径。注意: 我们建议输出.mov格式的文件
flags标志字段,如无特殊需求请填写0。请参见 NvsStreamingEngineRecordingFlag
withRecordConfigurations录制视频配置。NSMutableDictionary中关键字的值请参见 录制视频配置
例如:NSMutableDictionary *config = [[NSMutableDictionary alloc] init]; [config setValue:[NSNumber numberWithInteger:15] forKey:NVS_RECORD_GOP_SIZE]; // 设置为1即是生成全I帧视频 [config setValue:[NSNumber numberWithInteger:10000000] forKey:NVS_RECORD_BITRATE]; // 10M bps
返回
返回BOOL值。返回YES则启动录制成功,NO则启动失败。
自从
1.16.0
参见
- stopRecording

◆ startRecordingWithFx:

- (BOOL) startRecordingWithFx: (NSString *)  outputFilePath

启动采集设备的录制,录制的内容包含所有的特效处理效果。

注意:如果特效处理过于复杂可能会导致录制的视频丢帧,所以使用这个方法一定要慎重,要确保特效的处理对于当前 手机是完全可以实时处理的。请参见视频录制方式

参数
outputFilePath录制文件的路径。我们建议输出.mov格式的文件
返回
返回BOOL值。返回YES则启动录制成功,NO则启动失败。
参见
- stopRecording

◆ startRecordingWithFx:withFlags:

- (BOOL) startRecordingWithFx: (NSString *)  outputFilePath
withFlags: (int)  flags 

启动采集设备的录制,录制的内容包含所有的特效处理效果。

注意:如果特效处理过于复杂可能会导致录制的视频丢帧,所以使用这个方法一定要慎重,要确保特效的处理对于当前 手机是完全可以实时处理的。请参见视频录制方式

参数
outputFilePath录制文件的路径。我们建议输出.mov格式的文件
flags标志字段,如无特殊需求请填写0。请参见 NvsStreamingEngineRecordingFlag
返回
返回BOOL值。返回YES则启动录制成功,NO则启动失败。
自从
1.5.1
参见
- stopRecording

◆ startRecordingWithFx:withFlags:withRecordConfigurations:

- (BOOL) startRecordingWithFx: (NSString *)  outputFilePath
withFlags: (int)  flags
withRecordConfigurations: (NSMutableDictionary *)  withRecordConfigurations 

启动录制采集设备信号。请参见视频录制方式

参数
outputFilePath录制文件的路径。注意: 我们建议输出.mov格式的文件
flags标志字段,如无特殊需求请填写0。请参见 NvsStreamingEngineRecordingFlag
withRecordConfigurations录制视频配置。NSMutableDictionary中关键字的值请参见 录制视频配置 例如:NSMutableDictionary *config = [[NSMutableDictionary alloc] init]; [config setValue:[NSNumber numberWithInteger:15] forKey:NVS_RECORD_GOP_SIZE]; // 设置为1即是生成全I帧视频 [config setValue:[NSNumber numberWithInteger:10000000] forKey:NVS_RECORD_BITRATE]; // 10M bps
返回
返回BOOL值。返回YES则启动录制成功,NO则启动失败。
自从
1.16.0
参见
- stopRecording

◆ stop

- (void) stop

停止引擎

◆ stop:

- (void) stop: (int)  flags

停止引擎

参数
flags停止引擎标志。请参见 NvsStreamingEngineStopFlag
自从
2.3.0

◆ stopRecording

- (void) stopRecording

结束录制采集设备信号

参见
- startRecording:

◆ takePicture:

- (BOOL) takePicture: (int)  flags

以最接近预览比例的摄像头的最大分辨率拍摄一张照片

参数
flags拍照的标志,目前没有使用, 值为0

◆ toggleFlash:

- (void) toggleFlash: (BOOL)  on

开/关换补光灯

参数
on闪光灯是否开或关
参见
- isFlashOn

◆ toggleFlashMode:

- (void) toggleFlashMode: (NvsCameraFlashMode mode

切换闪光灯模式

参数
mode闪光灯模式值。请参见闪光灯模式。
参见
- getFlashMode

◆ verifySdkLicenseFile:

+ (BOOL) verifySdkLicenseFile: (NSString *)  sdkLicenseFilePath

验证SDK授权文件。注意:授权文件接口必须在NvsStreamingContext初始化之前调用。

参数
sdkLicenseFilePathSDK授权文件路径
返回
返回BOOL值。YES表示授权验证成功,NO则验证失败。若验证失败,则后续的视频预览和生成视频会出现水印。

属性说明

◆ assetPackageManager

- (NvsAssetPackageManager*) assetPackageManager
readatomicassign

包管理器

◆ compileConfigurations

- (NSMutableDictionary*) compileConfigurations
readwritenonatomicassign

生成时间线配置,设置一次即一直生效。NSMutableDictionary中关键字的值请参见 生成时间线的配置 例如:NSMutableDictionary *config = [[NSMutableDictionary alloc] init]; [config setValue:[NSNumber numberWithInteger:15] forKey:NVS_COMPILE_GOP_SIZE]; // 设置为1即是生成全I帧视频 [config setValue:[NSNumber numberWithInteger:10000000] forKey:NVS_COMPILE_BITRATE]; // 10M bps [config setValue:[NSNumber numberWithInteger:256000] forKey:NVS_COMPILE_AUDIO_BITRATE]; // 设置音频码率为256Kbps [config setValue:[NSNumber numberWithBool:YES] forKey:NVS_COMPILE_LOSSLESS_AUDIO]; // 设置生成无损音频 [config setValue:[NSNumber numberWithBool:YES] forKey:NVS_COMPILE_OPTIMIZE_FOR_NETWORK_USE]; // 设置索引表前置 NvsRational videoFps = {12, 1}; [config setValue:[NSData dataWithBytes:&videoFps length:sizeof(NvsRational)] forKey:NVS_COMPILE_VIDEO_FPS]; // 设置帧速率FPS _streamingContext.compileConfigurations = config; 取消设置并恢复默认方式例如:[_streamingContext.compileConfigurations setValue:nil forKey:NVS_COMPILE_GOP_SIZE];

自从
1.8.0

◆ compileVideoBitrateMultiplier

- (float) compileVideoBitrateMultiplier
readwritenonatomicassign

生成视频码率倍乘系数

自从
1.5.0

◆ defaultCaptionFade

- (BOOL) defaultCaptionFade
readwritenonatomicassign

默认字幕是否为淡入淡出

自从
1.8.0

◆ delegate

- (id<NvsStreamingContextDelegate>) delegate
readwritenonatomicweak

◆ imageGrabberDelegate

- (id<NvsImageGrabberDelegate>) imageGrabberDelegate
readwritenonatomicweak

◆ recordVideoBitrateMultiplier

- (float) recordVideoBitrateMultiplier
readwritenonatomicassign

录制视频码率倍乘系数

自从
1.5.0

该类的文档由以下文件生成: