The /video/thumbs Robot

Our /video/thumbs robot

Transloadit offers a variety of features to reduce video size while maintaining quality, as well as add effects like watermarks.

The /video/thumbs Robot extracts any number of images from videos for use as previews.

The /video/thumbs Robot's Parameters

Name Type Default Description
count Integer(1-999) 8 The number of thumbnails to be extracted. As some videos have incorrect durations, the actual number of thumbnails generated may be less in rare cases. The maximum number of thumbails we currently allow is 999.
offsets Array of Integers / Array of Strings [] An array of offsets representing seconds of the file duration, such as [ 2, 45, 120 ]. Offsets can also be percentage values such as [ "2%", "50%", "75%" ]. This option cannot be used with the count parameter, and takes precedence if both are specified. Out-of-range offsets are silently ignored.
format String "jpeg" The format of the extracted thumbnail. Supported values are "jpg", "jpeg" and "png". Even if you specify the format to be "jpeg" the resulting thumbnails will have a "jpg" file extension.
width Integer(1-1920) Width of the video The width of the thumbnail, in pixels.
height Integer(1-1080) Height of the video The height of the thumbnail, in pixels.
resize_strategy String "pad" One of the available resize strategies.
rotate Integer Auto Forces the video to be rotated by the specified degree integer. Currently, only multiples of 90 are supported. We automatically correct the orientation of many videos when the orientation is provided by the camera. This option is only useful for videos requiring rotation because it was not detected by the camera.
ffmpeg_stack String "v1.0.0" Selects the FFmpeg stack for the encoding. Valid values are "v1.0.0" , "v2.0.0", "v2.1.0" and "v2.2.3". These versions do not reflect any real FFmpeg versions, they reflect our own internal (non-semantic) versioning for our custom FFmpeg builds.

Example use cases featuring the /video/thumbs robot

See the robot in action with some live demos and code samples right here on our website:

Encode a video, extract 8 thumbnails and store everything in your S3 bucket

Here you can see a quick example of the Assembly Instructions required to create this encoding pipeline. More information is available in the Live demo

{
 "steps": {
    "flash_encoding": {
      "use": ":original",
      "robot": "/video/encode",
      "preset": "flash",
      "width": 640,
      "height": 480
    },
    "extracted_thumbs": {
      "use": "flash_encoding",
      "robot": "/video/thumbs",
      "result": true
    },
    "store": {
      "robot": "/s3/store",
      "use": [
        "flash_encoding",
        "extracted_thumbs"
      ],
      "key": "YOUR_AWS_KEY",
      "secret": "YOUR_AWS_SECRET",
      "bucket": "YOUR_S3_BUCKET"
    }
  }
}

Specify multiple encoding Steps for a single file

Here you can see a quick example of the Assembly Instructions required to create this encoding pipeline. More information is available in the Live demo

{
 "steps": {
    "flash_video": {
      "use": ":original",
      "robot": "/video/encode",
      "result": true,
      "preset": "flash",
      "width": 854,
      "height": 480
    },
    "iphone_video": {
      "use": ":original",
      "robot": "/video/encode",
      "result": true,
      "preset": "iphone"
    },
    "thumbnails": {
      "use": ":original",
      "robot": "/video/thumbs"
    },
    "resized_thumbs": {
      "robot": "/image/resize",
      "use": "thumbnails",
      "result": true,
      "width": 130,
      "height": 130
    },
    "export": {
      "robot": "/s3/store",
      "use": [
        ":original",
        "flash_video",
        "iphone_video",
        "resized_thumbs"
      ],
      "key": "YOUR_AWS_KEY",
      "secret": "YOUR_AWS_SECRET",
      "bucket": "YOUR_S3_BUCKET"
    }
  }
}

Automatically process multiple file types

Here you can see a quick example of the Assembly Instructions required to create this encoding pipeline. More information is available in the Live demo

{
 "steps": {
    "image_thumbs": {
      "use": ":original",
      "robot": "/image/resize",
      "result": true,
      "format": "png",
      "width": 320,
      "height": 240
    },
    "video_thumbs": {
      "use": ":original",
      "robot": "/video/thumbs",
      "result": true,
      "width": 320,
      "height": 240,
      "resize_strategy": "pad",
      "background": "#000000",
      "count": 4
    },
    "encode_video": {
      "use": ":original",
      "robot": "/video/encode",
      "result": true,
      "preset": "flash",
      "width": 640,
      "height": 480
    },
    "store": {
      "use": [
        "image_thumbs",
        "video_thumbs",
        "encode_video",
        ":original"
      ],
      "robot": "/s3/store",
      "bucket": "YOUR_S3_BUCKET",
      "key": "YOUR_AWS_KEY",
      "secret": "YOUR_AWS_SECRET"
    }
  }
}

Convert any video to animated GIF

Here you can see a quick example of the Assembly Instructions required to create this encoding pipeline. More information is available in the Live demo

{
 "steps": {
    "extracted_thumbs": {
      "use": ":original",
      "robot": "/video/thumbs",
      "result": false,
      "count": 50
    },
    "anigif": {
      "robot": "/video/merge",
      "use": {
        "steps": [
          {
            "name": "extracted_thumbs",
            "as": "image"
          }
        ]
      },
      "result": true,
      "duration": 7.8,
      "framerate": "10",
      "ffmpeg_stack": "v2.2.3",
      "ffmpeg": {
        "f": "gif",
        "pix_fmt": "rgb24"
      },
      "resize_strategy": "pad"
    },
    "exported": {
      "use": [
        ":original",
        "anigif"
      ],
      "robot": "/s3/store",
      "key": "YOUR_AWS_KEY",
      "secret": "YOUR_AWS_SECRET",
      "bucket": "YOUR_S3_BUCKET"
    }
  }
}

Extract 10 thumbnails and modify their size

Here you can see a quick example of the Assembly Instructions required to create this encoding pipeline. More information is available in the Live demo

{
 "steps": {
    "flash_encoding": {
      "use": ":original",
      "robot": "/video/encode",
      "ffmpeg_stack": "v2.2.3",
      "preset": "flash",
      "width": 640,
      "height": 480
    },
    "extracted_thumbs": {
      "use": "flash_encoding",
      "robot": "/video/thumbs",
      "count": 10
    },
    "small": {
      "use": "extracted_thumbs",
      "robot": "/image/resize",
      "result": true,
      "width": "30",
      "height": "30"
    },
    "thumb": {
      "use": "extracted_thumbs",
      "robot": "/image/resize",
      "result": true,
      "width": "75",
      "height": "75"
    },
    "big": {
      "use": "extracted_thumbs",
      "robot": "/image/resize",
      "result": true,
      "width": "120",
      "height": "120"
    }
  }
}


Did you know?

You can easily combine Robots to create powerful workflows, unique to your business.

This is the power of Transloadit.