服务端渲染合成 JSON 样例
本文提供服务端渲染合成中常用能力的完整 JSON 示例。请选择需要查看的功能分类;每个子页面均包含完整可解析的业务 JSON 和关键参数说明。
示例中的素材地址和资源包 ID 用于展示数据结构。接入业务时,请替换为目标合成环境可访问的素材和已安装的资源包。
功能分类
| 分类 | 内容 |
|---|---|
| 最小 JSON 样例 | 包含一个视频片段和一条组合字幕,可用于快速跑通合成流程。 |
| 视频转场 | 内建转场、资源包转场和转场时长。 |
| 普通字幕 | 字幕样式、描边、阴影、排版、位置和旋转。 |
| 花字字幕 | 花字资源、背景、描边、阴影、动画和字间距。 |
| 贴纸 | 普通贴纸、有声贴纸及贴纸动画。 |
| 组合字幕 | 组合字幕子项、局部样式和整体变换。 |
| 时间线特效 | 资源包特效、滤镜和强度设置。 |
| 粒子特效 | 全屏粒子参数和手绘粒子运动轨迹。 |
| 水印 | 自定义素材水印和多水印轨道。 |
公共工程字段
服务端渲染合成 JSON 使用以下公共工程字段。各能力示例将重点说明转场、字幕、贴纸、特效和水印自身参数。
时间线公共默认字段
| 字段路径 | 字段意义 | 类型/允许范围 | 示例值概况 |
|---|---|---|---|
output | 输出画幅 | string;string:非空画幅字符串 | 16:9 |
timelines[].compoundCaptionTracks[] | 兼容字段 | array;具体取值以服务版本为准 | 全部为空数组 |
timelines[].duration | 时间位置或时长,具体对象由路径确定 | integer;integer:微秒;通常 >= 0,结束时间应大于开始时间 | 固定值 49200000 |
timelines[].enableRenderOrderByZValue | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | true |
timelines[].fps | 输出帧率 | integer;integer:正整数,需由编码器支持 | 固定值 25 |
timelines[].isDefaultCaptionFade | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | false |
timelines[].outputEnd | 时间位置或时长,具体对象由路径确定 | integer;integer:微秒;通常 >= 0,结束时间应大于开始时间 | 固定值 -1 |
timelines[].outputStart | 时间位置或时长,具体对象由路径确定 | integer;integer:微秒;通常 >= 0,结束时间应大于开始时间 | 固定值 0 |
timelines[].outputType | 输出文件类型 | string;string:常见 mp4、mov、m4a、mp3、jpg、png | 全部为空字符串 |
timelines[].resHeight | 输出或参考图像尺寸 | integer;integer:像素,正整数 | 固定值 540 |
timelines[].resWidth | 输出或参考图像尺寸 | integer;integer:像素,正整数 | 固定值 960 |
timelines[].safeFrameSize | 排版、阴影、描边、背景或区域参数 | integer;number:有限数值,范围由渲染器或资源包确定 | 固定值 1 |
timelines[].sizeLevel | 输出清晰度级别 | integer;integer:常用 480、720、1080、2160 | 固定值 -1 |
timelines[].templateId | 工程模板 ID | string;string:未使用模板时可以为空 | 全部为空字符串 |
timelines[].timelineFlags | 时间线行为标志位 | integer;integer:具体位定义由目标服务版本确认 | 固定值 562 |
timelines[].videoSize | 输出画幅描述 | string;string:非空画幅字符串 | 16:9 |
timelines[].volume | 时间线、轨道、片段或贴纸音量 | integer;number:有限数值,服务端范围需确认 | 固定值 1 |
其他公共轨道、视频和基础特效字段
| 字段路径 | 字段意义 | 类型/允许范围 | 示例值概况 |
|---|---|---|---|
timelines[].audioTracks[].channelType | 编辑或渲染模式参数 | string;扩展 integer/string:目标服务版本确认 | stereo |
timelines[].audioTracks[].index | 同类对象索引 | integer;integer:通常 >= 0;扩展轨道可能使用特殊值 | 固定值 1 |
timelines[].audioTracks[].show | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | true |
timelines[].audioTracks[].volume | 时间线、轨道、片段或贴纸音量 | integer;number:有限数值,服务端范围需确认 | 固定值 1 |
timelines[].musicLyricsTracks[].index | 同类对象索引 | integer;integer:通常 >= 0;扩展轨道可能使用特殊值 | 固定值 0 |
timelines[].musicLyricsTracks[].show | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | true |
timelines[].videoTracks[].channelType | 编辑或渲染模式参数 | string;扩展 integer/string:目标服务版本确认 | stereo |
timelines[].videoTracks[].index | 同类对象索引 | integer;integer:通常 >= 0;扩展轨道可能使用特殊值 | 2 ~ 3 |
timelines[].videoTracks[].show | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | true |
timelines[].videoTracks[].videos[].aliasTag | 业务别名标签 | string;string:由业务方约定 | 全部为空字符串 |
timelines[].videoTracks[].videos[].blendingMode | 编辑或渲染模式参数 | integer;扩展 integer/string:目标服务版本确认 | 固定值 0 |
timelines[].videoTracks[].videos[].captions[] | 兼容字段 | array;具体取值以服务版本为准 | 全部为空数组 |
timelines[].videoTracks[].videos[].combination | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | false |
timelines[].videoTracks[].videos[].combinationOrder | 编辑或渲染模式参数 | integer;扩展 integer/string:目标服务版本确认 | 固定值 0 |
timelines[].videoTracks[].videos[].enableClipFreezeFrame | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | false |
timelines[].videoTracks[].videos[].enableRawSourceMode | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | false |
timelines[].videoTracks[].videos[].extraRotation | 编辑或渲染模式参数 | integer;扩展 integer/string:目标服务版本确认 | 固定值 0 |
timelines[].videoTracks[].videos[].fadeInDuration | 时间位置或时长,具体对象由路径确定 | integer;integer:微秒;通常 >= 0,结束时间应大于开始时间 | 固定值 0 |
timelines[].videoTracks[].videos[].fadeOutDuration | 时间位置或时长,具体对象由路径确定 | integer;integer:微秒;通常 >= 0,结束时间应大于开始时间 | 固定值 0 |
timelines[].videoTracks[].videos[].fillMode | 编辑或渲染模式参数 | integer;扩展 integer/string:目标服务版本确认 | 固定值 0 |
timelines[].videoTracks[].videos[].freezeFrameTrimPos | 时间位置或时长,具体对象由路径确定 | integer;integer:微秒;通常 >= 0,结束时间应大于开始时间 | 固定值 0 |
timelines[].videoTracks[].videos[].horizontalFlip | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | false |
timelines[].videoTracks[].videos[].id | 资源包、贴纸或业务对象 ID | integer;扩展 integer/string:目标服务确认 | 155953 ~ 156213 |
timelines[].videoTracks[].videos[].inPoint | 时间位置或时长,具体对象由路径确定 | integer;integer:微秒;通常 >= 0,结束时间应大于开始时间 | 520000 ~ 34480000 |
timelines[].videoTracks[].videos[].index | 同类对象索引 | integer;integer:通常 >= 0;扩展轨道可能使用特殊值 | 0 ~ 2 |
timelines[].videoTracks[].videos[].isTimelineClip | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | false |
timelines[].videoTracks[].videos[].keepAudioPitch | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | true |
timelines[].videoTracks[].videos[].m3u8Path | HLS 素材地址 | string;扩展 string:目标服务确认 | 非空字符串(3 种) |
timelines[].videoTracks[].videos[].noAudio | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | true、false |
timelines[].videoTracks[].videos[].outPoint | 时间位置或时长,具体对象由路径确定 | integer;integer:微秒;通常 >= 0,结束时间应大于开始时间 | 14440000 ~ 49200000 |
timelines[].videoTracks[].videos[].path | 合成服务读取的素材地址 | string;string:普通素材必须非空且可访问 | 非空字符串(3 种) |
timelines[].videoTracks[].videos[].rawFilterProcessesMode | 编辑或渲染模式参数 | integer;扩展 integer/string:目标服务版本确认 | 固定值 0 |
timelines[].videoTracks[].videos[].refImageHeight | 输出或参考图像尺寸 | integer;integer:像素,正整数 | 固定值 0 |
timelines[].videoTracks[].videos[].refImageWidth | 输出或参考图像尺寸 | integer;integer:像素,正整数 | 固定值 0 |
timelines[].videoTracks[].videos[].reverse | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | false |
timelines[].videoTracks[].videos[].reversePath | 合成服务读取的素材地址 | string;string:普通素材必须非空且可访问 | 全部为空字符串 |
timelines[].videoTracks[].videos[].separated | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | false |
timelines[].videoTracks[].videos[].speed | 媒体播放速度 | integer;number:> 0,并满足时间与裁剪关系 | 固定值 1 |
timelines[].videoTracks[].videos[].stickers[] | 兼容字段 | array;具体取值以服务版本为准 | 全部为空数组 |
timelines[].videoTracks[].videos[].trimIn | 时间位置或时长,具体对象由路径确定 | integer;integer:微秒;通常 >= 0,结束时间应大于开始时间 | 固定值 0 |
timelines[].videoTracks[].videos[].trimOut | 时间位置或时长,具体对象由路径确定 | integer;integer:微秒;通常 >= 0,结束时间应大于开始时间 | 13920000 ~ 20040000 |
timelines[].videoTracks[].videos[].verticalFlip | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | false |
timelines[].videoTracks[].videos[].videoFxs[].absoluteTimeUsed | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | true |
timelines[].videoTracks[].videos[].videoFxs[].duration | 时间位置或时长,具体对象由路径确定 | integer;integer:微秒;通常 >= 0,结束时间应大于开始时间 | 固定值 -1 |
timelines[].videoTracks[].videos[].videoFxs[].fxParams[].key | 特效参数名 | string;string:SDK 或资源包定义的非空键名 | 非空字符串(36 种) |
timelines[].videoTracks[].videos[].videoFxs[].fxParams[].type | 视频特效类型 | string;string:property、builtin 或 package | float、menu、color、bool |
timelines[].videoTracks[].videos[].videoFxs[].fxParams[].value | 特效参数标量值 | string;string:语义由 type/key 决定,逻辑数字或布尔值也保持 string | 非空字符串(7 种) |
timelines[].videoTracks[].videos[].videoFxs[].inPoint | 时间位置或时长,具体对象由路径确定 | integer;integer:微秒;通常 >= 0,结束时间应大于开始时间 | 固定值 0 |
timelines[].videoTracks[].videos[].videoFxs[].index | 同类对象索引 | integer;integer:通常 >= 0;扩展轨道可能使用特殊值 | 0 ~ 8 |
timelines[].videoTracks[].videos[].videoFxs[].intensity | 特效强度 | integer;number:[0, 1] | 固定值 1 |
timelines[].videoTracks[].videos[].videoFxs[].isIgnoreBackground | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | false |
timelines[].videoTracks[].videos[].videoFxs[].isInverseRegion | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | false |
timelines[].videoTracks[].videos[].videoFxs[].isRaw | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | false、true |
timelines[].videoTracks[].videos[].videoFxs[].isRegional | 布尔开关,行为由路径确定 | boolean;boolean:true 或 false | false |
timelines[].videoTracks[].videos[].videoFxs[].name | 内建特效或转场名称 | string;string:type=builtin 时非空 | 非空字符串(7 种) |
timelines[].videoTracks[].videos[].videoFxs[].regionalFeatherWidth | 排版、阴影、描边、背景或区域参数 | integer;number:有限数值,范围由渲染器或资源包确定 | 固定值 0 |
timelines[].videoTracks[].videos[].videoFxs[].shape | 兼容字段 | string;具体取值以服务版本为准 | 全部为空字符串 |
timelines[].videoTracks[].videos[].videoFxs[].type | 视频特效类型 | string;string:property、builtin 或 package | property、builtin |
timelines[].videoTracks[].videos[].volume | 时间线、轨道、片段或贴纸音量 | integer;number:有限数值,服务端范围需确认 | 0 ~ 1 |
timelines[].videoTracks[].volume | 时间线、轨道、片段或贴纸音量 | integer;number:有限数值,服务端范围需确认 | 固定值 1 |
参数规范汇总
对象路径速查
| 能力 | JSON 路径 |
|---|---|
| 视频转场 | timelines[].videoTracks[].transitions[] |
| 普通字幕与花字 | timelines[].captionTracks[].captions[] |
| 贴纸 | timelines[].stickerTracks[].stickers[] |
| 组合字幕 | timelines[].captionTracks[].compoundCaptions[] |
| 时间线特效 | timelines[].timelineVideoFxTracks[].timelineVideoFxs[] |
| 水印 | timelines[].watermarkTracks[].stickerTracks[].stickers[] |
参数规范速查
| 参数类型 | 规范 |
|---|---|
| 时间线时间 | inPoint、outPoint、trimIn、trimOut、普通 duration 使用微秒。 |
| 动画时间 | animationPeroid、inAnimationDuration、outAnimationDuration 使用毫秒。 |
| 曲线点时间 | curvePoint.timeSec 使用秒。 |
| 颜色 | 使用 #AARRGGBB,前两位为透明度。 |
| 特效强度 | intensity 范围为 [0, 1]。 |
| 内建效果 | type=builtin 时必须设置非空 name。 |
| 资源包效果 | type=package 时必须设置非空 id。 |
| 参数值 | fxParams[].value 和 keyFrames[].value 保持 string。 |
| 数组顺序 | 视频、转场、特效、关键帧和字幕子项均按数组顺序处理。 |
| 素材地址 | 普通视频、音频及自定义水印的 path 必须能被合成服务访问。 |