command module
v0.0.0-...-1a959dd Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2019 License: MIT Imports: 1 Imported by: 0


GoDoc Build Status codecov Go Report Card

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.


The Go Gopher

There is no documentation for this package.


Path Synopsis
Package openshot is a Go SDK for the OpenShot Cloud API.
Package openshot is a Go SDK for the OpenShot Cloud API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL