Skip to content

Video for Go with Mux

Easily build beautiful video experiences into your Go app.

Installation

Pull the package.

go get github.com/muxinc/mux-go

Usage

To start, you'll need a Mux access token. Once you've got that, you're off to the races!

package main import ( "fmt" "os" "github.com/muxinc/mux-go" ) func main() { // API Client Initialization client := muxgo.NewAPIClient( muxgo.NewConfiguration( muxgo.WithBasicAuth(os.Getenv("MUX_TOKEN_ID"), os.Getenv("MUX_TOKEN_SECRET")), )) // Create the Asset asset, err := client.AssetsApi.CreateAsset(muxgo.CreateAssetRequest{ Input: []muxgo.InputSettings{ muxgo.InputSettings{ Url: "https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4", }, }, PlaybackPolicy: []muxgo.PlaybackPolicy{muxgo.PUBLIC}, }) // Check everything was good, and output the playback URL if err == nil { fmt.Printf("Playback URL: https://stream.mux.com/%s.m3u8 \n", asset.Data.PlaybackIds[0].Id) } else { fmt.Printf("Oh no, there was an error: %s \n", err) } }

Video for your Go app that streams beautifully, everywhere

Upload

Getting started is fast and easy with direct uploads - this means no intermediate storage for you to manage.

Globe

Mux integrates with all major web and mobile video players.

Heart

Automatically deliver the best user experience for every combination of device, browser, location, bandwidth, etc.

Graph

Also includes helpers for Mux Data if you want to include performance metrics into your own dashboard client.

Flexible and future-proof

Ingest using almost any codec, including H.264, H.265, VP9, and Apple ProRes. Get multi-bitrate adaptive streaming with HLS delivery.

Adapt to new devices and codecs with no extra work. We'll automatically update codecs and renditions of the life of a video.

Scales automatically

Security for your video content

Use signed playback policies by easily creating signed URL tokens for your Mux assets when you want to control access to a piece of content.

Reach every viewer
Code

Fork it

We love issues, pull requests, forks, and compliments (constructive criticism counts too).

Behind the Scenes

Mux is made up of an advanced transcoding engine, streaming origin, and expertly configured CDNs which all work together to provide the best video experience for your users with the least amount of headache for you.

Behind the scenes

Advanced encoding for the most efficient streaming

Just-in-time transcoding

Get the fastest video publishing possible. Videos are encoded while the first viewers watch them so your users can publish instantly.

Optimizes video renditions

Not only is Mux fast, but we make sure that your video will look its best across every screen, on every network.

Need live streaming from your Go app? Yep, we do that, too.

Mux is made up of an advanced transcoding engine, streaming origin, and expertly configured CDNs which all work together to provide the best video experience for your users with the least amount of headache for you.

Learn more

Handle thousands of concurrent live streamers and millions of viewers without worrying about spinning up additional servers.

RTMP for ingest and HLS for delivery so your application can stream from a mobile app, broadcast software, or hardware encoder and broadcast to any device.

Transition seamlessly from live to VoD with recordings available immediately after the event with no waiting for additional processing.

No credit card required to start using Mux.