美摄SDK For iOS
3.7.2
|
字幕 更多...
#import <NvsVideoEffectCaption.h>
属性 | |
BOOL | isPanoramic |
是否为全景图字幕 更多... | |
BOOL | isModular |
当前字幕是否为模块字幕 更多... | |
BOOL | clipAffinityEnabled |
是否开启与clip的亲和关系 更多... | |
int64_t | inPoint |
字幕在时间线上显示的入点(单位微秒) 更多... | |
int64_t | outPoint |
字幕在时间线显示上的出点(单位微秒) 更多... | |
NvsVideoEffectRoleInTheme | roleInTheme |
字幕在主题中的角色(通用、片头、片尾) 更多... | |
NvsVideoEffectCategory | category |
片段类型 更多... | |
NSString * | captionStylePackageId |
字幕样式包裹ID 更多... | |
NSString * | modularCaptionContextPackageId |
模块字幕环境样式包裹ID 更多... | |
NSString * | modularCaptionRendererPackageId |
模块字幕渲染样式包裹ID 更多... | |
NSString * | modularCaptionAnimationPackageId |
模块字幕循环动画样式包裹ID 更多... | |
NSString * | modularCaptionInAnimationPackageId |
模块字幕入动画样式包裹ID 更多... | |
NSString * | modularCaptionOutAnimationPackageId |
模块字幕出动画样式包裹ID 更多... | |
![]() | |
NvsEffectDescription * | description |
特效描述 更多... | |
字幕
字幕是视频上叠加的自定义文字。编辑视频时,可以创建和移除字幕,并对字幕位置进行调整处理。添加完字幕,还可以进行样式设置,包括字体大小,颜色,阴影,描边等。
- (bool) applyCaptionStyle: | (NSString *) | captionStylePackageId |
运用字幕样式
captionStylePackageId | 字幕样式资源包ID |
- (bool) applyCaptionStyleWithAssetDefaultParam: | (NSString *) | captionStylePackageId | |
isUseDefaultAssetParam: | (NvsVideoEffectAssetDefaultParam) | isUseDefaultAssetParam | |
运用字幕样式
captionStylePackageId | 字幕样式资源包ID |
isUseDefaultAssetParam | 是否使用默认素材参数 |
- (bool) applyModularCaptionAnimation: | (NSString *) | captionAnimationPackageId |
运用模块字幕循环动画样式包
captionAnimationPackageId | 字幕循环动画样式资源包ID |
- (bool) applyModularCaptionContext: | (NSString *) | captionContextPackageId |
运用模块字幕环境样式包
captionContextPackageId | 字幕环境样式资源包ID |
- (bool) applyModularCaptionInAnimation: | (NSString *) | captionInAnimationPackageId |
运用模块字幕入动画样式包。注意:如果已经应用了循环动画样式包,需要先把循环动画设置为null,否则不生效
captionInAnimationPackageId | 字幕入动画样式资源包ID |
- (bool) applyModularCaptionOutAnimation: | (NSString *) | captionOutAnimationPackageId |
运用模块字幕出动画样式包. 注意:如果已经应用了循环动画样式包,需要先把循环动画设置为null,否则不生效
captionOutAnimationPackageId | 字幕出动画样式资源包ID |
- (bool) applyModularCaptionRenderer: | (NSString *) | captionRendererPackageId |
运用模块字幕渲染样式包
captionRendererPackageId | 字幕渲染样式资源包ID |
- (int64_t) changeInPoint: | (int64_t) | newInPoint |
改变字幕在时间线上显示的入点
newInPoint | 字幕在时间线上的新的入点(单位微秒) |
- (int64_t) changeOutPoint: | (int64_t) | newOutPoint |
改变字幕在时间线上显示的出点
newOutPoint | 字幕在时间线上的新的出点(单位微秒) |
- (CGPoint) getAnchorPoint |
- (NvsEffectColor) getBackgroundColor |
- (float) getBackgroundRadius |
- (BOOL) getBold |
- (NSArray *) getCaptionBoundingVertices: | (NvsVideoEffectBoundingType) | boundingType |
获取字幕原始边框变换后的顶点位置
boundingType | 边框类型。请参见[边框类型] Bounding Type |
- (CGPoint) getCaptionTranslation |
- (float) getCenterAzimuthAngle |
获取字幕中心点的方位角。只对全景图字幕有效
- (float) getCenterPolarAngle |
获取字幕中心点的极角。只对全景图字幕有效
- (BOOL) getDrawOutline |
- (BOOL) getDrawShadow |
- (NSString *) getFontFamily |
获取字幕字体
- (NSString *) getFontFilePath |
- (float) getFontSize |
- (BOOL) getItalic |
- (float) getLetterSpacing |
获取字幕字间距
- (NvsVideoEffectLetterSpacingType) getLetterSpacingType |
获取字幕字间距类型
- (float) getLineSpacing |
获取字幕行间距
- (int) getModularCaptionAnimationPeroid |
获取模块字幕循环动画的周期
- (int) getModularCaptionInAnimationDuration |
获取模块字幕入动画的时长
- (int) getModularCaptionOutAnimationDuration |
获取模块字幕出动画的时长
- (float) getOpacity |
- (float) getOrthoAngleRange |
获取字幕与极角垂直的张角。只对全景图字幕有效
- (NvsEffectColor) getOutlineColor |
- (float) getOutlineWidth |
- (float) getPanoramicRotation |
获取字幕旋转角度。只对全景图字幕有效
- (float) getPanoramicScaleX |
获取字幕水平缩放系数。只对全景图字幕有效
- (float) getPanoramicScaleY |
获取字幕垂直缩放系数。只对全景图字幕有效
- (float) getPolarAngleRange |
获取字幕极角的张角。只对全景图字幕有效
- (float) getRotationZ |
- (float) getScaleX |
- (float) getScaleY |
- (NvsEffectColor) getSecondaryColor |
获取字幕字体的当前第二个颜色值
- (NvsEffectColor) getShadowColor |
- (float) getShadowFeather |
获取当前字幕阴影的羽化程度
- (CGPoint) getShadowOffset |
- (NSString *) getText |
- (NvsVideoEffectTextAlignment) getTextAlignment |
- (NvsEffectRect) getTextBoundingRect: | (BOOL) | actualBoundingRect |
获取字幕文本矩形框
- (float) getTextCenterAzimuthAngle |
获取字幕文本中心点的方位角。只对全景图字幕有效
- (float) getTextCenterPolarAngle |
获取字幕文本中心点的极角。只对全景图字幕有效
- (NvsEffectColor) getTextColor |
- (float) getTextOrthoAngleRange |
获取字幕文本与极角垂直的张角。只对全景图字幕有效
- (float) getTextPolarAngleRange |
获取字幕文本极角的张角。只对全景图字幕有效
- (NvsVideoEffectTextAlignment) getTextVerticalAlignment |
- (BOOL) getUnderline |
获取字幕下划线状态
- (BOOL) getVerticalLayout |
- (int) getWeight |
获取字幕权重值
- (float) getZValue |
- (BOOL) isFrameCaption |
获取字幕是否是边框字幕
- (void) movePosition: | (int64_t) | offset |
- (void) rotateCaption: | (float) | angle |
- (void) rotateCaption: | (float) | angle | |
anchor: | (CGPoint) | anchor | |
- (void) scaleCaption: | (float) | scaleFactor | |
anchor: | (CGPoint) | anchor | |
缩放字幕
scaleFactor | 字幕缩放的因子 |
anchor | 字幕缩放的锚点 |
- (void) setAnchorPoint: | (CGPoint) | anchor |
- (void) setBackgroundColor: | (const NvsEffectColor *) | backgroundColor |
- (void) setBackgroundRadius: | (float) | radius |
- (void) setBold: | (BOOL) | bold |
- (void) setCaptionTranslation: | (CGPoint) | translation |
- (void) setCenterAzimuthAngle: | (float) | centerAzimuthAngle |
对字幕设置中心点的方位角。只对全景图字幕有效
centerAzimuthAngle | 中心点的方位角,单位为角度 |
- (void) setCenterPolarAngle: | (float) | centerPolarAngle |
对字幕设置中心点的极角。只对全景图字幕有效
centerPolarAngle | 中心点的极角,单位为角度 |
- (void) setCurrentKeyFrameTime: | (int64_t) | time |
设置字幕的关键帧时间
- (void) setDrawOutline: | (BOOL) | drawOutline |
- (void) setDrawShadow: | (BOOL) | drawShadow |
- (void) setFontFamily: | (NSString *) | family |
- (void) setFontSize: | (float) | fontSize |
- (void) setFontWithFilePath: | (NSString *) | filePath |
- (void) setFrameCaptionMaxFontSize: | (float) | maxFontSize |
设置边框字幕最大字体大小,只对边框型字幕有效果
- (void) setItalic: | (BOOL) | italic |
- (void) setLetterSpacing: | (float) | letterSpacing |
设置字幕字间距
letterSpacing | 字间距,类型默认百分比。(LETTER_SPACING_TYPE) |
- (void) setLetterSpacingType: | (NvsVideoEffectLetterSpacingType) | letterSpacingType |
- (void) setLineSpacing: | (float) | lineSpacing |
- (void) setModularCaptionAnimationPeroid: | (int) | periodInMS |
- (void) setModularCaptionInAnimationDuration: | (int) | inAnimationDurationInMS |
设置模块字幕入动画的时长
inAnimationDurationInMS | 入动画的时长,注意:单位是毫秒 |
- (void) setModularCaptionOutAnimationDuration: | (int) | outAnimationDurationInMS |
设置模块字幕出动画的时长
outAnimationDurationInMS | 出动画的时长,注意:单位是毫秒 |
- (void) setOpacity: | (float) | opacity |
- (void) setOutlineColor: | (const NvsEffectColor *) | outlineColor |
- (void) setOutlineWidth: | (float) | outlineWidth |
- (void) setPanoramicRotation: | (float) | rotationAngle |
对字幕设置旋转角度。只对全景图字幕有效
rotationAngle | 旋转角度 |
- (void) setPanoramicScaleX: | (float) | scaleX |
对字幕设置水平缩放系数。只对全景图字幕有效
scaleX | 水平缩放系数 |
- (void) setPanoramicScaleY: | (float) | scaleY |
对字幕设置垂直缩放系数。只对全景图字幕有效
scaleY | 垂直缩放系数 |
- (void) setPolarAngleRange: | (float) | polarAngleRange |
对字幕设置极角的张角。只对全景图字幕有效
polarAngleRange | 极角的张角,单位为角度 |
- (void) setRecordingUserOperation: | (BOOL) | recordingUserOperation |
设置字幕是否记录用户的操作
recordingUserOperation | 字幕是否记录用户操作 |
- (void) setRotationZ: | (float) | angle |
- (void) setScaleX: | (float) | scale |
- (void) setScaleY: | (float) | scale |
- (void) setSecondaryColor: | (const NvsEffectColor *) | color |
- (void) setShadowColor: | (const NvsEffectColor *) | shadowColor |
- (void) setShadowFeather: | (float) | feather |
- (void) setShadowOffset: | (CGPoint) | shadowOffset |
- (void) setText: | (NSString *) | text |
- (void) setTextAlignment: | (NvsVideoEffectTextAlignment) | textAlign |
- (void) setTextColor: | (const NvsEffectColor *) | textColor |
- (void) setTextFrameOriginRect: | (NvsEffectRect) | rc |
设置边框字幕的原始边框大小,如果当前字幕不是边框字幕,该函数没有效果. 可以通过getCaptionBoundingVertices中的BOUNDING_TYPE_TEXT_ORIGIN_FRAME获取原始边框大小
rc | 新的边框大小 |
- (void) setTextVerticalAlignment: | (NvsVideoEffectTextAlignment) | textVerticalAlign |
- (void) setUnderline: | (BOOL) | underline |
- (void) setVerticalLayout: | (BOOL) | verticalLayout |
- (void) setVideoResolution: | (NvsEffectVideoResolution) | resolution |
设置字幕渲染的画幅解析度
resolution | 画幅解析度 |
- (void) setWeight: | (int) | weight |
- (void) setZValue: | (float) | value |
- (void) translateCaption: | (CGPoint) | translationOffset |
|
readatomicassign |
字幕样式包裹ID
|
readatomicassign |
片段类型
|
readwritenonatomicassign |
是否开启与clip的亲和关系
|
readatomicassign |
字幕在时间线上显示的入点(单位微秒)
|
readatomicassign |
当前字幕是否为模块字幕
|
readatomicassign |
是否为全景图字幕
|
readatomicassign |
模块字幕循环动画样式包裹ID
|
readatomicassign |
模块字幕环境样式包裹ID
|
readatomicassign |
模块字幕入动画样式包裹ID
|
readatomicassign |
模块字幕出动画样式包裹ID
|
readatomicassign |
模块字幕渲染样式包裹ID
|
readatomicassign |
字幕在时间线显示上的出点(单位微秒)
|
readatomicassign |
字幕在主题中的角色(通用、片头、片尾)