前往官网 PixoAI,创建API Key.
curl --location --request POST 'https://pixoclip.com/gateway/gl-controller' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"audio_tracks": null,
"output": {
"audio": true,
"audio_config": {
"sample_rate": 48000
},
"filename": "./out.mp4",
"muxer": true,
"video": true,
"video_config": {
"bps": 4000000,
"codec_name": "libx264",
"fps": 30,
"height": 1920,
"width": 1088
}
},
"video_tracks": [
{
"active": true,
"clips": [
{
"end_ts": 300,
"sources": [
{
"font_path": "https://oss.pixoclip.com/pixoclip/fonts/NotoSansSC-Regular.ttf",
"font_size": 50,
"path": "Text",
"stroke_width": 1,
"text_padding": 0,
"text_type": "text",
"type": "text"
}
],
"start_ts": 0,
"transition_duration_ts": 0,
"transitions": [
{
"config": {
"type": "position"
},
"end_ts": 9007199254740991,
"glsl_path": "https://oss.pixoclip.com/pixoclip/glsl/text/position_text.glsl",
"start_ts": 0,
"type": "text",
"uniform": {
"centerX": {
"type": "float",
"value": "(0, 0.5) (1, 0.5)"
},
"centerY": {
"type": "float",
"value": "(0, 0.5) (1, 0.5)"
},
"rotation": {
"type": "float",
"value": "(0, 0) (1, 0)"
},
"scaleX": {
"type": "float",
"value": "(0, 1) (1, 1)"
},
"scaleY": {
"type": "float",
"value": "(0, 1) (1, 1)"
},
"textBgColorA": {
"type": "float",
"value": "(0, 0) (1, 0)"
},
"textBgColorB": {
"type": "float",
"value": "(0, 0) (1, 0)"
},
"textBgColorG": {
"type": "float",
"value": "(0, 0) (1, 0)"
},
"textBgColorR": {
"type": "float",
"value": "(0, 0) (1, 0)"
},
"textColorA": {
"type": "float",
"value": "(0, 1) (1, 1)"
},
"textColorB": {
"type": "float",
"value": "(0, 1) (1, 1)"
},
"textColorG": {
"type": "float",
"value": "(0, 1) (1, 1)"
},
"textColorR": {
"type": "float",
"value": "(0, 1) (1, 1)"
},
"textStrokeColorA": {
"type": "float",
"value": "(0, 0) (1, 0)"
},
"textStrokeColorB": {
"type": "float",
"value": "(0, 0) (1, 0)"
},
"textStrokeColorG": {
"type": "float",
"value": "(0, 0) (1, 0)"
},
"textStrokeColorR": {
"type": "float",
"value": "(0, 0) (1, 0)"
}
}
}
],
"type": "text"
}
]
}
]
}'{
"status": "string",
"data": {
"state": true,
"task_id": "string"
}
}