Skip to content

组合字幕

公共工程字段和通用参数规则见 JSON 样例概述

组合字幕

创建包含多个文字子项的组合字幕。

完整 JSON

关键参数

字段路径作用类型与范围示例值
timelines[].captionTracks[].compoundCaptions[].captionItems[].color颜色string;#AARRGGBB#ffffffff
timelines[].captionTracks[].compoundCaptions[].captionItems[].font字体名称string;应与字体资源映射一致非空
timelines[].captionTracks[].compoundCaptions[].captionItems[].index对象索引integer;同类对象内唯一或有序0 ~ 1
timelines[].captionTracks[].compoundCaptions[].captionItems[].text字幕文字string;允许换行2 种非空值
timelines[].captionTracks[].compoundCaptions[].duration时间位置或时长integer,微秒;通常 >= 048680000
timelines[].captionTracks[].compoundCaptions[].inPoint时间位置或时长integer,微秒;通常 >= 0520000
timelines[].captionTracks[].compoundCaptions[].styleId资源包、样式或动画 IDstring;使用对应资源时非空非空

组合字幕局部样式

分别设置组合字幕子项的文字、字体和颜色。

完整 JSON

关键参数

字段路径作用类型与范围示例值
timelines[].captionTracks[].compoundCaptions[].captionItems[].color颜色string;#AARRGGBB#ffd0021b
timelines[].captionTracks[].compoundCaptions[].captionItems[].font字体名称string;应与字体资源映射一致2 种非空值
timelines[].captionTracks[].compoundCaptions[].captionItems[].index对象索引integer;同类对象内唯一或有序0 ~ 1
timelines[].captionTracks[].compoundCaptions[].captionItems[].text字幕文字string;允许换行2 种非空值

组合字幕旋转

整体旋转组合字幕,并保留各文字子项样式。

完整 JSON

关键参数

字段路径作用类型与范围示例值
timelines[].captionTracks[].compoundCaptions[].rotation旋转角度number;方向按引擎坐标系-90
timelines[].captionTracks[].compoundCaptions[].translationX位置或锚点number;有限数值-0.39221668243408203
timelines[].captionTracks[].compoundCaptions[].translationY位置或锚点number;有限数值0

多子项组合字幕

创建包含三个文字子项的组合字幕。

完整 JSON

关键参数

字段路径作用类型与范围示例值
timelines[].captionTracks[].compoundCaptions[].captionItems[].color颜色string;#AARRGGBB#ff535353、#fff0911d
timelines[].captionTracks[].compoundCaptions[].captionItems[].font字体名称string;应与字体资源映射一致非空
timelines[].captionTracks[].compoundCaptions[].captionItems[].index对象索引integer;同类对象内唯一或有序0 ~ 2
timelines[].captionTracks[].compoundCaptions[].captionItems[].text字幕文字string;允许换行3 种非空值
timelines[].captionTracks[].compoundCaptions[].styleId资源包、样式或动画 IDstring;使用对应资源时非空非空