[关闭]
@chengxuyuan 2019-08-23T03:53:38.000000Z 字数 1095 阅读 357

图片和视频生成海报

橙旭园儿童编程


图片和视频生成海报

method and url structure

method methodresource url descriptions authentications required
post /server/job_management/show_work_poster/ yes

request data

  1. {
  2. "name": "poster-001",
  3. "image": "",
  4. "draw_data": [{
  5. "font_size": 30,
  6. "fill": "rgb(47,197,230)",
  7. "text": "文字",
  8. "annotate": "<125:550>"
  9. }],
  10. "video": "",
  11. "overlay": "<1190:413>",
  12. "scale": "600x450"
  13. }

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

  1. 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"}' | \
  2. curl -H "Content-Type: application/json" -X POST -d @- \
  3. http://localhost/server/job_management/show_work_poster/

json response

  1. {
  2. "status": 0,
  3. "message": "",
  4. "url": "https://static1.bcjiaoyu.com/poster-001-20190810-161934-4338dece53d364ea13cb574442f5b447.mp4"
  5. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注