shotstack / shotstack-sdk-python

Python SDK for Shotstack, the cloud video editing API
https://shotstack.io/product/sdk/python/
22 stars 2 forks source link

Length of video #9

Closed Emerik-Tremblay closed 1 year ago

Emerik-Tremblay commented 1 year ago

I'm new to shotstack and I've been wanting to make the length of the Clip the same as the length of the VideoAsset. From what I see i need to give a float for the length. Is there a way to do this ?

Thank you!

video_clip = Clip( asset = video_asset, start = 0.0, length = #length of the video_asset )

jeffski commented 1 year ago

Just seen this. length needs to be a float so you need to know the duration of the video asset in advance. There are a couple of ways to do this:

We have a probe endpoint that lets you inspect a video, image or audio file, which returns metadata including duration. More details here in the docs: https://shotstack.io/docs/guide/architecting-an-application/inspect-assets.

You can also use our Ingest API, this lets you upload your assets to Shotstack before editing them and for each asset uploaded we save the duration and other metadata. You can then get the data from an API call. Documentation here: https://shotstack.io/docs/guide/ingesting-footage/ingest-api.

In the future we might add a feature that automatically determines the length from the clip but for now these are the two approaches available.