Open source
Python video SDK
Easily build video experiences into your Python app with the FastPix Python video SDK.
Trusted by product teams shipping video at scale







What you get
Everything your Python app needs for video
Upload it, encode it, stream it, and see how it is doing. That is the whole job, and it all comes from one package you install like any other.
Getting video in is the easy part. Use a file you already host, or send one straight from your app. Nothing to store in between.
Your video plays on the web, on phones, on tablets and on TVs, and you never build a separate player for any of them.
Everyone watching gets a version that suits their screen, their browser and how fast their connection happens to be that day.
You can see how your video is actually doing, because the numbers come with it instead of being sold to you separately.
Install
Python SDK installation
Install the package with pip, uv or poetry, whichever your project already uses. You need Python 3.9.2 or newer. Everything the client can do is listed in the Python SDK docs.
Every endpoint underneath the SDK is listed in the API reference.
# Installs the client and its httpx and Pydantic dependencies
pip install fastpix-python
# The same package, resolved by uv or poetry instead
uv add fastpix-python
poetry add fastpix-pythonCredentials
Your access tokens
FastPix gives you two values, not one key. The access token is the username and the secret key is the password. Keep both on your server. Get them from the access-token page in your dashboard.
Generate both on the access-token page in your dashboard. A free account issues a working pair straight away.
import os
from fastpix_python import Fastpix, models
# Authenticates every request that follows, over HTTP Basic
fastpix = Fastpix(
security=models.Security(
username=os.getenv("FASTPIX_USERNAME"), # Your Access Token
password=os.getenv("FASTPIX_PASSWORD"), # Your Secret Key
),
)Open source
The Python SDK on GitHub
The code is public and Apache-2.0 licensed, so you can read exactly what it sends before you depend on it. Issues, pull requests and forks are welcome here and on every other package FastPix publishes.
Or browse All FastPix repos
On-demand video
Video upload and playback
Give FastPix a link to a file you already host, or upload one from your app. It comes back encoded for every screen and connection, with an ID your player uses. Video on Demand covers the rest.
# 1. Hand FastPix a video to fetch and encode
res = fastpix.input_video.create_media(
inputs=[{"type": "video", "url": "https://static.fastpix.com/fp-sample-video.mp4"}],
access_policy="public",
)
# 2. Issue the ID a player streams from
res = fastpix.playback.create_media_playback_id(
media_id="your-media-id", access_policy="public", resolution="1080p"
)Ask for more up front
Captions, chapters and In-Video AI metadata are requested while the video is added.
Public or signed
Decide per playback ID whether anyone can watch, or only a viewer holding your token.
Browser uploads
Pair with a client-side upload SDK for pause, resume and retry.
Encoding
Every video gets its own encode
Most platforms run every file through the same settings. FastPix looks at each video first and encodes it to suit, so the file comes out smaller and still looks the same.
A ladder shaped to the title
Rungs are chosen per video, not copied from a preset.
35% smaller, same picture
Measured against H.264, HEVC and AV1 at matched quality.
Video Data
Playback analytics, built in
You do not need another tool to see how your video is doing. Every play is recorded automatically in Video Data, and you read the numbers with the same client you used to upload.
# Averages the quality-of-experience score over the last 24 hours
res = fastpix.metrics.list_overall_values(
metric_id="quality_of_experience_score",
measurement="avg",
timespan="24:hours",
filterby="browser_name:Chrome",
)Ten fields are yours
Tag sessions with your own account, plan or lesson ID and slice by them later.
Down to one viewer
Drill from a summary number into a single session and the errors it hit.
Pull it into your warehouse
Views come back through the same API, so they land in BI or a warehouse.
Which QoE metrics actually deserve an alert is covered in this working reference.
How it works
What happens after you upload a video
You get a media ID back straight away, while the file is still being processed. FastPix encodes it, stores it and prepares it for delivery, then sends a webhook the moment it is ready to play.
Independent timings for encode and first frame are on the benchmark page, which also names the workloads where FastPix does not come first.
Live streaming from your Python app
Live uses the same client as on-demand. Ask for a stream key, point OBS, vMix, a phone or a hardware encoder at it, and FastPix takes care of the stream and the recording.
Questions developers ask
Python SDK questions, answered
How do I upload a video in Python?
Two ways. Give create_media a URL of a file you already host and FastPix fetches it. Or use direct_upload_video_media, which opens an upload slot and hands back a signed URL your code sends the file to. The first suits a backend job, the second a user-facing form.
Do I need FFmpeg to handle video in Python?
No. FFmpeg is what most Python tutorials reach for, and it means running transcoding on your own machines and maintaining presets. FastPix encodes on its side, so your Python code only makes API calls. You never install FFmpeg, size a worker box, or tune a rendition ladder yourself.
How do I convert a video to HLS in Python?
You do not convert it yourself. When you create a media entry, FastPix produces the HLS renditions and returns a playback ID. Point any HLS player at that ID and it streams adaptively. There is no ffmpeg command, no segmenting step and no manifest for you to write.
How do I stream video in a Django or Flask app?
The SDK is a plain client library with no framework coupling, so it works in Django views, Flask routes, FastAPI endpoints and Celery workers alike. Build one client at module load and reuse it. Store the playback ID against your model, then render it into a player in your template.
Documentation
Docs, references and guides
This page shows you the idea. When you need the exact parameter, the response or the error code, the docs have it, with an example you can run beside every operation.