Skip to content

DocsGuides

Slideshows and image to video

Turn still images into a video, each held for a time, with a slow zoom or pan and music.

POST /v1/slideshow shows its images one after another as one video. One image makes an image to video.

The request#

bash
curl "$VIDEXO_API_URL/v1/slideshow" \
  -H "Authorization: Bearer $VIDEXO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "images": [
    "https://example.com/photo-1.jpg",
    "https://example.com/photo-2.jpg"
  ],
  "duration": 4,
  "motion": "zoom-in",
  "resize": {
    "width": 1280,
    "height": 720
  },
  "extra_inputs": {
    "music": "https://example.com/music.mp3"
  },
  "audio": {
    "input": "music"
  },
  "filename": "slideshow.mp4"
}'

slideshow.mp4: 8 seconds at 1280 by 720, each photo filling the frame and zooming in slowly, over the music, which ends with the picture.

duration is how long each image stays on screen, 3 seconds unless you say otherwise, from 0.1 to 300. motion is a slow move over that time: zoom-in, zoom-out, pan-left, pan-right, pan-up or pan-down. An image takes a JPEG, PNG, WebP or BMP file, or the first frame of a video or GIF.

The frame is 1920 by 1080 unless resize or a preset sets another, and a picture of another shape gets bars. With motion, or "fit": "cover", it fills the frame and its edges are cut.

Each image its own way#

An image can set its own duration and motion, and take up to 4 text layers, timed from the start of that image:

bash
curl "$VIDEXO_API_URL/v1/slideshow" \
  -H "Authorization: Bearer $VIDEXO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "images": [
    {
      "source": "https://example.com/cover.jpg",
      "duration": 2,
      "text": [
        {
          "text": "Spring collection",
          "size": 96
        }
      ]
    },
    "https://example.com/look-1.jpg",
    {
      "source": "https://example.com/look-2.jpg",
      "motion": "pan-right"
    }
  ],
  "duration": 4,
  "motion": "zoom-in",
  "resize": {
    "width": 1080,
    "height": 1080,
    "fit": "cover"
  },
  "filename": "spring.mp4"
}'

Transitions#

transition crosses each image into the next, so "transition": { "type": "fade", "duration": 1 } on four images of 4 seconds makes 13 seconds. An image may set its own; the first has nothing to cross from. Join files lists the types.

Sound#

A slideshow has no sound of its own. To add music, name it in extra_inputs and take it with audio.input. The video ends with its last image: the music is cut there, or padded with silence when it is shorter. fade fades the picture and the music together.

Images between clips#

On POST /v1/jobs, a concat part may be an image next to parts of videos. The image is silent while the clips keep their sound:

bash
curl "$VIDEXO_API_URL/v1/jobs" \
  -H "Authorization: Bearer $VIDEXO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "logo": "https://example.com/logo.png",
    "talk": "https://example.com/talk.mp4"
  },
  "outputs": [
    {
      "type": "video",
      "concat": [
        {
          "image": "logo",
          "duration": 3
        },
        "talk"
      ],
      "resize": {
        "width": 1920,
        "height": 1080,
        "fit": "pad"
      }
    }
  ]
}'