Skip to main content

Smart Clips

Smart Clips are designed to simplify video editing workflows by automating the timing settings of your clips, removing the need to manually set the start and length properties. This is particularly useful when handling a large number of clips or when precise timing is difficult to determine in advance.

Smart clips provide you with options to automatically set start and length properties based on the assets you are using.

Automated timing

By setting the start or length of a clip to auto, Shotstack automatically calculates and assigns the appropriate values based on the asset's duration and its position within the track.

This example will automatically set the start and length property:

{
"timeline": {
"tracks": [
{
"clips": [
{
"asset":{
"type": "video",
"src": "https://s3-ap-southeast-2.amazonaws.com/my-bucket/footage.mp4",
},
"start": "auto",
"length": "auto"
}
]
},
]
}
}

For multiple clips, the auto setting stitches clips sequentially according to their order in the track, maintaining their full length:

{
"timeline": {
"tracks": [
{
"clips": [
{
"asset":{
"type": "video",
"src": "https://s3-ap-southeast-2.amazonaws.com/my-bucket/footage.mp4",
},
"start": "auto",
"length": "auto"
},
{
"asset":{
"type": "video",
"src": "https://s3-ap-southeast-2.amazonaws.com/my-bucket/footage2.mp4",
},
"start": "auto",
"length": "auto"
}
]
},
]
}
}
Warning

When using the auto setting for image, title or text assets (or luma assets used in conjunction with these assets), the length will be automatically set to 3 seconds.

Persistent timing

To ensure a clip plays through to the end of your video timeline, set its length property to end. This configuration is useful for elements like watermarks or soundtracks that need to cover the entire video. If the clip's duration is shorter than the timeline's total duration, it will stop when the clip ends.

To add a watermark that appears throughout the entire duration of the video, you can configure the clip as follows:

{
"timeline": {
"tracks": [
{
"clips": [
{
"asset": {
"type": "image",
"src": "https://shotstack-assets.s3.amazonaws.com/assets/logo.png"
},
"start": "auto",
"length": "end"
}
]
},
{
"clips": [
{
"asset": {
"src": "https://s3-ap-southeast-2.amazonaws.com/my-bucket/footage.mp4",
"type": "video"
},
"start": "auto",
"length": "auto"
},
{
"asset": {
"src": "https://s3-ap-southeast-2.amazonaws.com/my-bucket/footage2.mp4",
"type": "video"
},
"start": "auto",
"length": "auto"
}
]
}
]
}
}