图片和视频生成海报
橙旭园儿童编程
图片和视频生成海报
method and url structure
| method |
methodresource url |
descriptions |
authentications required |
| post |
/server/job_management/show_work_poster/ |
yes |
|
request data
{ "name": "poster-001", "image": "", "draw_data": [{ "font_size": 30, "fill": "rgb(47,197,230)", "text": "文字", "annotate": "<125:550>" }], "video": "", "overlay": "<1190:413>", "scale": "600x450"}
request params
| name |
description |
required |
default |
| name |
海报名字 |
YES |
|
| image |
图片数据 base64 格式 |
YES |
|
| draw_data |
写在图片上的数据, 可以是多个 |
YES |
|
| font_size |
字体大小 |
YES |
|
| fill |
颜色 |
YES |
|
| text |
文字信息 |
YES |
|
| annotate |
位置 |
YES |
|
| video |
视频数据 base64格式 |
YES |
|
| picture |
图片数据 base64格式 |
YES |
|
| overlay |
视频在图片上的位置 |
YES |
|
| scale |
视频/图片大小(宽x高) |
YES |
|
| type |
video/picture |
YES |
video |
curl example
echo '{"name":"poster-001","image":"'"$(base64 bak1.png)"'","draw_data":[{"font_size":30,"fill":"red","text":"王小 明","annotate":"<125:550>"}],"video":"'"$(base64 test-video-1565346207459.webm)"'","overlay":"<1190:413>", "scale":"600x450", "type":"video"}' | \curl -H "Content-Type: application/json" -X POST -d @- \http://localhost/server/job_management/show_work_poster/
json response
{ "status": 0, "message": "", "url": "https://static1.bcjiaoyu.com/poster-001-20190810-161934-4338dece53d364ea13cb574442f5b447.mp4"}