Build video applications and workflows using a Python video editing library and the Shotstack API. Python video processing made easy.

Over 20,000 Businesses & Developers from 119 Countries Trust Shotstack
The Shotstack Python video SDK makes it easy to build sophisticated video applications and workflows using Python. Perfect for data scientists, machine learning engineers, and Python developers who need to integrate video editing into their projects.
The open-source Python video editing library connects directly to Shotstack's managed video editing API, eliminating the need to install FFmpeg, manage servers, or handle complex video processing infrastructure.
Access all of Shotstack's powerful video editing features including trimming, concatenation, transitions, filters, effects, and the ability to merge videos, images, text and audio—all using clean, Pythonic code.
Import the Shotstack SDK and required classes.
import shotstack_sdk as shotstack
from shotstack_sdk.api import edit_api
from shotstack_sdk.model.edit import EditSet the host and API key for your environment.
configuration = shotstack.Configuration(
host="https://api.shotstack.io/stage"
)
configuration.api_key['DeveloperKey'] = "YOUR_API_KEY"Define the video asset with source URL and trim settings.
video_asset = shotstack.VideoAsset(
src="https://shotstack-assets.s3.amazonaws.com/footage/skater.mp4",
trim=3
)Create clips, tracks, timeline and output configuration.
clip = shotstack.Clip(
asset=video_asset,
start=0,
length=8
)
track = shotstack.Track(clips=[clip])
timeline = shotstack.Timeline(tracks=[track])
output = shotstack.Output(
format="mp4",
resolution="sd"
)
edit = Edit(
timeline=timeline,
output=output
)Send the edit to the API for rendering.
with shotstack.ApiClient(configuration) as api_client:
api_instance = edit_api.EditApi(api_client)
try:
response = api_instance.post_render(edit)
render_id = response['response']['id']
print(f"Render ID: {render_id}")
except Exception as e:
print(f"Exception: {e}")The Python code above creates a JSON specification for trimming a video, sends it to the Shotstack API, and produces the edited video output.
This application is the perfect example of a well executed and documented API. In less than 10 mins, set up, web hook done, and first render!
There are a couple of other options out there that attempt to provide the same or similar solution, but none of them come close in terms of quality, ease of use, and speed.
Shotstack was EXACTLY what I was looking for, and incredibly easy to get started with. You guys are killing it.
Unlimited developer sandbox
No credit card required