shotstack / python-demos

Shotstack Python demos - Edit videos in the cloud with Python and the Shotstack Video Editing API
https://shotstack.io
9 stars 3 forks source link
api python video-edit-sdk video-editing video-editing-sdk video-editor video-processing

Shotstack Python Examples

Video examples

Image examples

Template examples

Polling example

Probe example

Asset management examples

Installation

Install the required dependencies including the Shotstack Python SDK

pip install -r requirements.txt

Set your API key

The demos use the staging endpoint by default so use your provided staging key:

export SHOTSTACK_KEY=your_key_here

Windows users (Command Prompt):

set SHOTSTACK_KEY=your_key_here

You can get an API key via the Shotstack web site.

Run an example

The examples directory includes a number of examples demonstrating the capabilities of the Shotstack API.

Rendering

To run a rendering/editing example run the examples at the root of the examples folder, e.g. to run the images video example:

python examples/images.py

Polling

To check the status of a render, similar to polling run the status.py example with the render ID, e.g.:

python examples/status.py 8b844085-779c-4c3a-b52f-d79deca2a960

Asset management

To look up assets hosted by Shotstack run the examples in the examples/serve-api directory.

Find assets by render ID:

python examples/serve-api/render_id.py 8b844085-779c-4c3a-b52f-d79deca2a960

or

Find an asset by asset ID:

python examples/serve-api/asset_id.py 3f446298-779c-8c8c-f253-900c1627b776