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







What you get
Everything your Go 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
Go SDK installation
Fetch the module with go get. The path is case-sensitive, capital F and capital P, which is the usual first thing to trip over. It needs Go 1.22 or newer. Everything the client can do is listed in the Go SDK docs.
Every endpoint underneath the SDK is listed in the API reference.
# Module path is case-sensitive: capital F, capital P
go get github.com/FastPix/fastpix-goCredentials
Your access tokens
FastPix gives you two values, not one key. Wrap them in a components.Security and pass it through WithSecurity when you build the client. Both travel as HTTP Basic on every request. Keep them 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 (
"context"
fastpixgo "github.com/FastPix/fastpix-go"
"github.com/FastPix/fastpix-go/models/components"
)
// Authenticates every request that follows, over HTTP Basic
s := fastpixgo.New(
fastpixgo.WithSecurity(components.Security{
Username: fastpixgo.Pointer("your-access-token"),
Password: fastpixgo.Pointer("your-secret-key"),
}),
)Open source
The Go 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
Pass a context and a request struct to create a media entry from a file you already host. It comes back encoded for every screen and connection, with an ID your player uses, and the context governs both calls. Video on Demand covers the rest.
// 1. Hand FastPix a video to fetch and encode
res, err := s.InputVideo.Create(ctx, components.CreateMediaRequest{
Inputs: []components.Input{
components.CreateInputPullVideoInput(
components.PullVideoInput{
URL: fastpixgo.Pointer("https://static.fastpix.com/fp-sample-video.mp4"),
},
),
},
})
// 2. Issue the ID a player streams from
pb, err := s.Playback.Create(ctx, "your-media-id",
&operations.CreateMediaPlaybackIDRequestBody{
AccessPolicy: components.AccessPolicyPublic,
})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, err := s.Metrics.ListOverallValues(ctx,
"quality_of_experience_score", // metricId
fastpixgo.Pointer("avg"), // measurement
fastpixgo.Pointer("24:hours"), // timespan
fastpixgo.Pointer("browser_name:Chrome"), // filterBy
)Ten fields are yours
Tag sessions with your own account, plan or lesson ID and slice by them later.
Positional, not a struct
ListOverallValues takes its filters positionally after the context.
Into your warehouse
Views come back through the same client, 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 Go 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
Go SDK questions, answered
How do I upload a video in Go?
Two ways. Give s.InputVideo.Create a URL of a file you already host, passed as a request struct after the context, and FastPix fetches it. Or open a direct upload, which returns a signed URL your own code sends the file to. The first suits a backend job, the second a user-facing form. Both hand back a media ID.
Do I need FFmpeg to handle video in Go?
No. Most Go answers point at an os/exec wrapper around the ffmpeg binary, which means shipping that binary and supervising the process. FastPix encodes on its side, so your Go code only makes API calls. You never install FFmpeg, size a worker box, or maintain a rendition ladder for every device you care about.
How do I convert a video to HLS in Go?
You do not convert it yourself. s.InputVideo.Create creates the media entry, FastPix produces the HLS renditions, and s.Playback.Create hands you the ID a player streams from. There is no ffmpeg command, no segmenting step and no manifest to write. Renditions are chosen per title rather than from a fixed preset, so a screen recording and an action scene do not get the same treatment.
Does the SDK work with Gin, Echo and net/http?
Yes. It is an ordinary package, so it works in net/http handlers, Gin, Echo and Chi alike. Construct the client once at startup and share it; it is safe to reuse. Pass the request context straight through, and a cancelled request cancels the FastPix call with it.
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.