Skip to content

Instantly share code, notes, and snippets.

@Acconut
Last active February 8, 2016 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Acconut/c01d38405446c961a592 to your computer and use it in GitHub Desktop.
Save Acconut/c01d38405446c961a592 to your computer and use it in GitHub Desktop.
if! $ORIGINAL.size < 20971520 && $ORIGINAL.meta.duration < 300 {
$flash_video = /video/encode(
use: $ORIGINAL,
result: true,
preset: "flash",
width: …
)
$iphone_video = /video/encode(
use: $ORIGINAL,
result: true,
preset: "iphone",
)
$thumbnails = /video/thumbs(
use: $ORIGINAL,
)
$resized_thumbs = /image/resize(
use: $thumbnails,
widht: 130,
height: 130,
)
/s3/store(
use: $ORIGINAL | $flash_video | $iphone_video | $resized_thumbs,
key: $$AWS_KEY,
secret: $$AWS_SECRET,
bucket: $$AWS_BUCKET,
)
}
"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"
}
}
steps: {
files: {
use: ":original",
robot: "/file/filter",
declines: [
["${file.size}", ">", "20971520"],
["${file.meta.duration}", ">", "300"]
],
error_on_decline: true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment