Skip to content
Go SDK for the OpenShot Cloud API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

GoDoc Build Status codecov Go Report Card License: MIT

OpenShot SDK for Go

Hello! This sdk provides an easy-to-use go interface for the OpenShot Cloud API.


go get

How to Use

Add import "" to your file.

Create a new OpenShot client: client := openshot.New(baseUrl, username, password)

Create a project: project := client.CreateProject(&openshot.Project{Name: "My Project"})

Start adding files, clips, animations, transitions and creating exports of your work!

Look at our GoDoc for a complete overview of the functionality available thus far.

Complete Example

This example shows how to create a project, add a video from an S3 bucket, create a clip with it, change it's x position, and create an export with a different aspect ratio than the input clips.

package main

import (

func main() {
	// Create an OpenShot client with the server location and credentials to login
	client := openshot.New(openshotURL, "username", "password")

	// Create a project with as many customized properties as desired
	// More information at:
	project, err := client.CreateProject(&openshot.Project{Name: "My Project"})
	if err != nil {
		// deal with error

	// Create a file using a video stored in s3 bucket "mybucket" located at "path/to/file/file_name.mp4" in the bucket
	// More information at:
	file, err := client.CreateFile(project, openshot.CreateFileStruct(openshot.CreateFileS3InfoStruct("file_name.mp4", "path/to/file/", "mybucket")))
	if err != nil {
		// deal with error

	// Create a clip using your new file as it's source
	// More information at:
	clip, err := client.CreateClip(project, openshot.CreateClipStruct(file, project))
	if err != nil {
		// deal with error

	// Modify clip's x location
	const frame = 120
	const xLocation = 0.5 // Read for properties and descriptions
	client.AddPropertyPoint(clip, "location_x", frame, xLocation)

	// Remember to call update since adding property points doesn't add them on the server
	// (for efficiency's sake, since many people want to add hundreds of property points!)
	clip, err = client.UpdateClip(clip)
	if err != nil {
		// deal with error

	// Create an export
	export := openshot.CreateDefaultExportStruct(project)
	export.JSON["width"] = 720 // Read for available properties
	export, err = client.CreateExport(project, export)
	if err != nil {
		// deal with error

	// Wait until export is ready, either by polling `client.GetExport` or by using a webhook to trigger a seperate handler.
	// More on that here:

	export, err = client.GetExport(export.ID)
	if err != nil {
		// deal with error

	// Exported video link available at export.Output

This sdk was purpose-built for this project, it's a great place to look for example usages. In particular, check out this package. The tests in this SDK are also quite thorough and can be used as examples.

You can’t perform that action at this time.