Add poster and preview images to video uploads

View Markdown

Generate eye-catching poster and preview thumbnails for your uploaded videos.

This workflow checks the input file is a video and then generates a poster image (for your player) and a preview image (for your thumbnail) in parallel.


Workflow

[
  {
    "kind": "conditions",
    "conditions": [
      {
        "prop": "kind",
        "value": "video"
      }
    ],
    "next": [
      {
        "kind": "image",
        "ref": "poster",
        "width": 1280,
        "format": "jpeg"
      },
      {
        "kind": "image",
        "ref": "preview",
        "width": 320,
        "format": "jpeg"
      }
    ]
  }
]

Create Task

const task = await ittybit.tasks.create({
  url: "https://ittyb.it/sample.mp4",
  kind: "workflow",
  workflow: [
    {
      kind: "conditions",
      conditions: [
        {
          prop: "kind",
          value: "video"
        }
      ],
      next: [
        {
          kind: "image",
          ref: "poster",
          width: 1280,
          format: "jpeg"
        },
        {
          kind: "image",
          ref: "preview",
          width: 320,
          format: "jpeg"
        }
      ]
    }
  ]
})

On this page