# 视频直播

# API 说明

用户调用平台全部API服务,皆需要访问服务接入点:aigc.softsugar.com,并在请求头中加上token信息。

# 创建视频直播的接管合成任务

# 接口描述

根据用户上传的指定内容调用算法能力进行接管视频合成,最终返回mp4/webm格式的视频文件供用户下载。PaaS平台支持7天在线存储,需要及时转存,7天后生成内容将无法下载。

# 请求地址

POST /api/2dvh/v1/material/video/takeover/create

# 请求头

Content-Type: application/json

# 请求参数

字段 类型 必填 描述
param String True 创建接管视频合成任务需要传入正确的param信息,其中包括视频合成参数(该参数为json转义后的字符串),视频合成参数定义参见视频合成任务json定义,其中人物,前景,背景只支持field id。
videoName String True 视频名称
thumbnailUrl String False 缩略图url

# 请求样例

{
  "videoName": "xxx",
  "param": "{\"version\":\"0.0.13\",\"video_format\":\"MP4\",\"resolution\":[1080,1920],\"bit_rate\":8,\"frame_rate\":25,\"watermark\":{\"show\":true,\"content\":\"内部测试\"},\"digital_role\":{\"id\":4051,\"face_feature_id\":\"\",\"name\":\"Nina\",\"url\":\"\",\"fileId\":\"12345\",\"position\":{\"x\":0,\"y\":0},\"scale\":1.0,\"z_position\":1,\"rotation\":0.0,\"start_frame_index\":123},\"tts_config\":{\"id\":\"xiaoyue\",\"name\":\"晓月\",\"vendor_id\":3,\"language\":\"zh-CN\",\"pitch_offset\":0.0,\"speed_ratio\":1,\"volume\":100},\"tts_query\":{\"content\":\"您好,尊贵的客户\",\"ssml\":false},\"audios\":[{\"url\":\"https://dhpoc.softsugar.com/adapter/static/9b158cc9-8e42-4d09-b928-49dd9941d922.mp3\"},{\"url\":\"https://dhpoc.softsugar.com/adapter/static/9b158cc9-8e42-4d09-b928-49dd9941d922.mp3\"}],\"backgrounds\":[{\"type\":0,\"name\":\"背景\",\"url\":\"\",\"fileId\":\"12345\",\"rect\":[0,0,1080,1920],\"cycle\":false,\"start\":0,\"play_offset\":123,\"duration\":-1}],\"foregrounds\":[{\"type\":0,\"name\":\"前景\",\"url\":\"\",\"fileId\":\"12345\",\"rect\":[0,0,1080,1920],\"rotation\":0.0,\"z_position\":0,\"cycle\":false,\"play_offset\":123,\"start\":0,\"duration\":-1}],\"foreground-texts\":[{\"text\":\"前景\",\"font_size\":20,\"font_family\":\"NotoSansSChineseBlack\",\"z_position\":10,\"stroke_width\":5.0,\"stroke_rgba\":[255,0,0,0],\"opacity\":0.5,\"position\":{\"x\":0,\"y\":0},\"background_rgba\":[0,255,0,200],\"rgba\":[100,200,100,100]}],\"title\":{\"text\":\"这是标题\",\"rgba\":[100,255,255,255],\"position\":{\"x\":540,\"y\":200},\"font_size\":50,\"font_family\":\"NotoSansSChineseBlack\",\"stroke_width\":5.0,\"stroke_rgba\":[255,0,0,0],\"scale\":1.0,\"opacity\":0.5,\"background_rgba\":[0,255,0,200]},\"effects\":{\"version\":\"1.0\",\"beautify\":{\"whitenStrength\":0.30,\"whiten_mode\":0,\"reddenStrength\":0.36,\"smoothStrength\":0.74,\"smooth_mode\":0,\"shrinkRatio\":0.11,\"enlargeRatio\":0.13,\"smallRatio\":0.10,\"narrowFace\":0.0,\"roundEyesRatio\":0.0,\"thinFaceShapeRatio\":0.0,\"chinLength\":0.0,\"hairlineHeightRatio\":0.0,\"appleMusle\":0.0,\"narrowNoseRatio\":0.0,\"noseLengthRatio\":0.0,\"profileRhinoplasty\":0.0,\"mouthSize\":0.0,\"philtrumLengthRatio\":0.0,\"eyeDistanceRatio\":0.0,\"eyeAngleRatio\":0.0,\"openCanthus\":0.0,\"brightEyeStrength\":0.0,\"removeDarkCircleStrength\":0.0,\"removeNasolabialFoldsStrength\":0.0,\"whiteTeeth\":0.0,\"shrinkCheekbone\":0.0,\"thinnerHead\":0.0,\"openExternalCanthus\":0.0,\"shrinkJawbone\":0.0,\"shrinkRoundFace\":0.0,\"shrinkLongFace\":0.0,\"shrinkGoddessFace\":0.0,\"shrinkNaturalFace\":0.0,\"shrinkWholeHead\":0.0,\"contrastStrength\":0.05,\"saturationStrength\":0.10,\"sharpen\":0.0,\"clear\":0.0,\"eyeHeight\":0.0,\"mouthCorner\":0.05,\"hairline\":0.10,\"bokehStrength\":0.0}}}"
}

# 响应元素

字段 类型 必填 描述
code Integer True 0 - 成功, 其他 - 异常
message String True 异常详细信息
data Integer False 任务id

# 响应样例

{

    "code": 0,

    "message": "success",

    "data": 1

}
# json参数说明

同视频合成任务参数,请参考视频合成任务json参数说明

# json示例
{
    "version": "0.0.13",
    "video_format": "MP4",
    "resolution": [1080, 1920],
    "bit_rate": 8,
    "frame_rate": 25,
    "watermark": {
        "show": true,
        "content": "内部测试"
    },
    "digital_role": {
        "id": 4051,
        "face_feature_id": "",
        "name": "Nina",
        "url": "",
        "fileId": "12345",
        "position": {
            "x": 0,
            "y": 0
        },
        "scale": 1.0,
        "z_position": 1,
        "rotation": 0.0,
        "start_frame_index":123
    },
    "tts_config": {
        "id": "xiaoyue",
        "name": "晓月",
        "vendor_id": 3,
        "language": "zh-CN",
        "pitch_offset": 0.0,
        "speed_ratio": 1,
        "volume": 100
    },
    "tts_query": {
        "content": "您好,尊贵的客户",
        "ssml": false
    },
    "audios": [{
        "url": "https://dhpoc.softsugar.com/adapter/static/9b158cc9-8e42-4d09-b928-49dd9941d922.mp3"
    }, {
        "url": "https://dhpoc.softsugar.com/adapter/static/9b158cc9-8e42-4d09-b928-49dd9941d922.mp3"
    }],
    "backgrounds": [{
        "type": 0,
        "name": "背景",
        "url": "",
        "fileId": "12345",
        "rect": [0, 0, 1080, 1920],
        "cycle": false,
        "start": 0,
        "play_offset": 123,
        "duration": -1
    }],
    "foregrounds": [{
        "type": 0,
        "name": "前景",
        "url": "",
        "fileId": "12345",
        "rect": [0, 0, 1080, 1920],
        "rotation": 0.0,
        "z_position": 0,
        "cycle": false,
        "play_offset": 123,
        "start": 0,
        "duration": -1
    }],
    "foreground-texts": [{
        "text": "前景",
        "font_size": 20,
        "font_family": "Noto Sans S Chinese Black",
        "z_position": 10,
        "stroke_width": 5.0,
        "stroke_rgba": [255, 0, 0, 0],
        "opacity": 0.5,
        "position": {
            "x": 0,
            "y": 0
        },
    "background_rgba": [0, 255, 0, 200],
        "rgba": [100, 200, 100, 100]
    }],
    "title": {
        "text": "这是标题",
        "rgba": [100, 255, 255, 255],
        "position": {
            "x": 540,
            "y": 200
        },
        "font_size": 50,
        "font_family": "Noto Sans S Chinese Black",
        "stroke_width": 5.0,
        "stroke_rgba": [255, 0, 0, 0],
        "scale": 1.0,
        "opacity": 0.5,
        "background_rgba": [0, 255, 0, 200]
    },
    "effects": {
        "version": "1.0",
        "beautify": {
            "whitenStrength": 0.30,
            "whiten_mode": 0,
            "reddenStrength": 0.36,
            "smoothStrength": 0.74,
            "smooth_mode": 0,
            "shrinkRatio": 0.11,
            "enlargeRatio": 0.13,
            "smallRatio": 0.10,
            "narrowFace": 0.0,
            "roundEyesRatio": 0.0,
            "thinFaceShapeRatio": 0.0,
            "chinLength": 0.0,
            "hairlineHeightRatio": 0.0,
            "appleMusle": 0.0,
            "narrowNoseRatio": 0.0,
            "noseLengthRatio": 0.0,
            "profileRhinoplasty": 0.0,
            "mouthSize": 0.0,
            "philtrumLengthRatio": 0.0,
            "eyeDistanceRatio": 0.0,
            "eyeAngleRatio": 0.0,
            "openCanthus": 0.0,
            "brightEyeStrength": 0.0,
            "removeDarkCircleStrength": 0.0,
            "removeNasolabialFoldsStrength": 0.0,
            "whiteTeeth": 0.0,
            "shrinkCheekbone": 0.0,
            "thinnerHead": 0.0,
            "openExternalCanthus": 0.0,
            "shrinkJawbone": 0.0,
            "shrinkRoundFace": 0.0,
            "shrinkLongFace": 0.0,
            "shrinkGoddessFace": 0.0,
            "shrinkNaturalFace": 0.0,
            "shrinkWholeHead": 0.0,
            "contrastStrength": 0.05,
            "saturationStrength": 0.10,
            "sharpen": 0.0,
            "clear": 0.0,
            "eyeHeight": 0.0,
            "mouthCorner": 0.05,
            "hairline": 0.10,
            "bokehStrength": 0.0
        }
    }
}

# 以上即为平台可以提供的全部算法能力。

最后更新: 2025/6/12 12:06:01