The /s3/store Robot

Our /s3/store Robot

Transloadit is happy to export to whatever storage solution suits you best.

The /s3/store Robot exports encoding results to Amazon S3.

The /s3/store Robot's Parameters

Name Type Default Description
bucket (required) String The name of the bucket to which the file is exported.
key (required) String Your Amazon access key ID
secret (required) String Your Amazon secret access Key
bucket_region String "us-east-1" The AWS region that your S3 bucket is in. If not provided, Transloadit will figure that out for you at some speed cost.
path String "${unique_prefix}/${file.url_name}" The path at which the file is to be stored. This may include any available Assembly variables.
url_prefix String "http://{bucket}.s3.amazonaws.com/" The URL prefix used for the returned URL, such as "http://my.cdn.com/some/path".
acl String "public-read" The permissions used for this file. This can be "public-read", "public", "private" or "bucket-default".
headers String { "Content-Type": file.mime } A JavaScript object containing a list of headers to be set for this file on S3, such as { FileURL: "${file.url_name}" }. This can also include any available Assembly variables. Here you can find a list of available headers.
host String "s3.amazonaws.com" The host of the storage service used. This only needs to be set when the storage service used is not Amazon S3, but has a compatible API (such as hosteurope.de).
no_vhost Boolean false Set to true if you use a custom host and run into access denied errors.
sign_urls_for Integer / Boolean(false) false If set to a number this parameter provides signed urls in the result JSON (in the signed_url and signed_ssl_url properties). The number that you set this parameter to is the url expiry time in seconds. If set to false no url signing is done.

Example use cases featuring the /s3/store 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"
    }
  }
}

Store uploaded files in your Amazon 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": {
    "store": {
      "use": ":original",
      "robot": "/s3/store",
      "key": "YOUR_AWS_KEY",
      "secret": "YOUR_AWS_SECRET",
      "bucket": "YOUR_S3_BUCKET"
    }
  }
}

Automatically extract uploaded archives

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": {
    "archives": {
      "use": ":original",
      "robot": "/file/filter",
      "accepts": [
        [
          "${file.mime}",
          "regex",
          "application/(rar|x-7z-compressed|x-cab|x-cpio|x-debian-package|x-gtar-compressed|x-gzip|x-lzh|x-redhat-package-manager|x-tar|zip)"
        ]
      ],
      "error_on_decline": false
    },
    "non-archives": {
      "use": ":original",
      "robot": "/file/filter",
      "declines": [
        [
          "${file.mime}",
          "regex",
          "application/(rar|x-7z-compressed|x-cab|x-cpio|x-debian-package|x-gtar-compressed|x-gzip|x-lzh|x-redhat-package-manager|x-tar|zip)"
        ]
      ],
      "error_on_decline": false
    },
    "extracted": {
      "use": "archives",
      "robot": "/file/decompress"
    },
    "encoded-ipad": {
      "use": [
        "non-archives",
        "extracted"
      ],
      "robot": "/video/encode",
      "preset": "ipad-high",
      "result": true
    },
    "encoded-webm": {
      "use": [
        "non-archives",
        "extracted"
      ],
      "robot": "/video/encode",
      "preset": "webm",
      "result": true
    },
    "exported": {
      "use": [
        ":original",
        "encoded-ipad",
        "encoded-webm"
      ],
      "robot": "/s3/store",
      "key": "YOUR_AWS_KEY",
      "secret": "YOUR_AWS_SECRET",
      "bucket": "YOUR_S3_BUCKET"
    }
  }
}

Only resize larger images when resizing files

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": {
    "large-files": {
      "use": ":original",
      "robot": "/file/filter",
      "accepts": [
        [
          "${file.meta.width}",
          ">",
          "2048"
        ],
        [
          "${file.meta.height}",
          ">",
          "2048"
        ]
      ],
      "condition_type": "or"
    },
    "smaller-files": {
      "use": ":original",
      "robot": "/file/filter",
      "accepts": [
        [
          "${file.meta.width}",
          "<=",
          "2048"
        ],
        [
          "${file.meta.height}",
          "<=",
          "2048"
        ]
      ],
      "condition_type": "or"
    },
    "large-resized": {
      "use": "large-files",
      "robot": "/image/resize",
      "resize_strategy": "fit",
      "width": 2048,
      "height": 2048
    },
    "smaller-resized": {
      "use": "smaller-files",
      "robot": "/image/resize",
      "resize_strategy": "fit",
      "width": "${file.meta.width}",
      "height": "${file.meta.height}"
    },
    "optimized": {
      "use": [
        "smaller-resized",
        "large-resized"
      ],
      "robot": "/image/optimize"
    },
    "exported": {
      "use": [
        "optimized",
        ":original"
      ],
      "robot": "/s3/store",
      "key": "YOUR_AWS_KEY",
      "secret": "YOUR_AWS_SECRET",
      "bucket": "YOUR_S3_BUCKET"
    }
  }
}

Automatically reject virus-infected files with an error

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": {
    "safe": {
      "use": ":original",
      "robot": "/file/virusscan",
      "error_on_decline": true
    },
    "store": {
      "robot": "/s3/store",
      "use": "safe",
      "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"
    }
  }
}

Encode video for Android, preserving the original quality

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": {
    "android-preserve-quality": {
      "use": ":original",
      "robot": "/video/encode",
      "preset": "android",
      "result": "true",
      "ffmpeg_stack": "v2.2.3",
      "width": "${file.meta.width}",
      "height": "${file.meta.height}",
      "ffmpeg": {
        "b:v": "${file.meta.video_bitrate}",
        "maxrate": "${file.meta.video_bitrate}",
        "bufsize": "${file.meta.video_bitrate}",
        "r": "${file.meta.framerate}",
        "ar": "${file.meta.audio_samplerate}",
        "b:a": "${file.meta.audio_bitrate}"
      }
    },
    "exported": {
      "use": [
        ":original",
        "android-preserve-quality"
      ],
      "robot": "/s3/store",
      "key": "YOUR_AWS_KEY",
      "secret": "YOUR_AWS_SECRET",
      "bucket": "YOUR_S3_BUCKET"
    }
  }
}

Implement HTTP Live Streaming (HLS)

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": {
    "low": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "hls_270p"
    },
    "mid": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "hls_360p"
    },
    "high": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "hls_540p"
    },
    "adaptive": {
      "robot": "/video/adaptive",
      "use": {
        "steps": [
          "low",
          "mid",
          "high"
        ],
        "bundle_steps": true
      },
      "technique": "hls",
      "playlist_name": "my_playlist.m3u8"
    },
    "store": {
      "robot": "/s3/store",
      "use": "adaptive",
      "path": "hlstest/${file.meta.relative_path}/${file.name}",
      "key": "YOUR_AWS_KEY",
      "secret": "YOUR_AWS_SECRET",
      "bucket": "YOUR_S3_BUCKET"
    }
  }
}

Implement MPEG-Dash using Transloadit

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": {
    "270p_video": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "dash_270p_video"
    },
    "360p_video": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "dash_360p_video"
    },
    "32k_audio": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "dash_32k_audio"
    },
    "64k_audio": {
      "robot": "/video/encode",
      "use": ":original",
      "ffmpeg_stack": "v2.2.3",
      "preset": "dash_64k_audio"
    },
    "adaptive": {
      "robot": "/video/adaptive",
      "use": {
        "steps": [
          "270p_video",
          "360p_video",
          "32k_audio",
          "64k_audio"
        ],
        "bundle_steps": true
      },
      "technique": "dash",
      "playlist_name": "my_playlist.mpd"
    },
    "store": {
      "robot": "/s3/store",
      "use": "adaptive",
      "path": "dashtest/${file.meta.relative_path}/${file.name}",
      "key": "YOUR_AWS_KEY",
      "secret": "YOUR_AWS_SECRET",
      "bucket": "YOUR_S3_BUCKET"
    }
  }
}

Blog posts for Our /s3/store robot

Over the years we wrote the following posts about Our /s3/store robot on our blog:



Did you know?

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

This is the power of Transloadit.