openshot-sdk-go: github.com/Bimde/openshot-sdk-go/openshot Index | Files

package openshot

import "github.com/Bimde/openshot-sdk-go/openshot"

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

Index

Package Files

api.go clip_modification_service.go clips_service.go export_service.go files_service.go projects_service.go service.go

Constants

const (
    LocationX = "location_x"
)

Constants representing clip JSON property names More details at: http://cloud.openshot.org/doc/api_endpoints.html#clips

type Clip Uses

type Clip struct {
    URL        string                 `json:"url"`
    ID         int                    `json:"id"`
    JSON       map[string]interface{} `json:"json"`
    FileURL    string                 `json:"file"`
    Position   float32                `json:"position"`
    Start      float32                `json:"start"`
    End        float32                `json:"end"`
    Actions    []string               `json:"actions"`
    ProjectURL string                 `json:"project"`
}

Clip represents http://cloud.openshot.org/doc/api_endpoints.html#clips

func CreateClipStruct Uses

func CreateClipStruct(file *File, project *Project) *Clip

CreateClipStruct creates a minimum Clip struct required for input to CreateClip

type Clips Uses

type Clips struct {
    Results []Clip `json:"results"`
    // contains filtered or unexported fields
}

Clips is the response data for /projects/{projectID}/clips/

type Cord Uses

type Cord struct {
    X   int     `json:"X"` // frame number
    Y   float64 `json:"Y"` // value
}

Cord contains a frame number, X, and a value, Y. OpenShot will change the value of the parent Property to Y by frame X, either gradually / instantly (based on the interpolation mode).

type Export Uses

type Export struct {
    URL          string                 `json:"url"`
    ID           int                    `json:"id"`
    JSON         map[string]interface{} `json:"json"`
    Output       string                 `json:"output"`
    ExportType   string                 `json:"export_type"`
    VideoFormat  string                 `json:"video_format"`
    VideoCodec   string                 `json:"video_codec"`
    VideoBitrate int                    `json:"video_bitrate"`
    AudioCodec   string                 `json:"ac3"`
    AudioBitrate int                    `json:"audio_bitrate"`
    StartFrame   int                    `json:"start_frame"`
    EndFrame     int                    `json:"end_frame"`
    Actions      []string               `json:"actions"`
    ProjectURL   string                 `json:"project"`
    Webhook      string                 `json:"webhook"`
    Progress     float32                `json:"progress"`
    Status       string                 `json:"status"`
    DateCreated  string                 `json:"date_created"`
    DateUpdated  string                 `json:"date_updated"`
}

Export represents http://cloud.openshot.org/doc/api_endpoints.html#exports

func CreateDefaultExportStruct Uses

func CreateDefaultExportStruct(project *Project) *Export

CreateDefaultExportStruct creates an Export struct with default settings

type Exports Uses

type Exports struct {
    Results []Export `json:"results"`
    // contains filtered or unexported fields
}

Exports is the response data for /projects/{projectID}/exports/

type File Uses

type File struct {
    URL         string      `json:"url"`
    ID          int         `json:"id"`
    JSON        interface{} `json:"json"`
    Media       string      `json:"media"`
    Project     string      `json:"project"`
    Actions     []string    `json:"actions"`
    DateCreated string      `json:"date_created"`
    DateUpdated string      `json:"date_updated"`
}

File represents http://cloud.openshot.org/doc/api_endpoints.html#files

type FileS3Info Uses

type FileS3Info struct {
    URL    string `json:"url"`
    Bucket string `json:"bucket"`
    Name   string `json:"name"`
}

FileS3Info represents http://cloud.openshot.org/doc/api_endpoints.html#id20

func CreateFileS3InfoStruct Uses

func CreateFileS3InfoStruct(testFileName string, folder string, bucket string) *FileS3Info

CreateFileS3InfoStruct creates a minimum FileS3Info struct required for input to CreateFileStruct

type FileUploadS3 Uses

type FileUploadS3 struct {
    ProjectURL string     `json:"project"`
    JSON       FileS3Info `json:"json"`
}

FileUploadS3 represents http://cloud.openshot.org/doc/api_endpoints.html#files

func CreateFileStruct Uses

func CreateFileStruct(fileS3Info *FileS3Info) *FileUploadS3

CreateFileStruct creates a minimum FileUploadS3 struct required for input to CreateFile

type Files Uses

type Files struct {
    Results []File `json:"results"`
    // contains filtered or unexported fields
}

Files is the response data for /projects/{projectID}/files/

type OpenShot Uses

type OpenShot struct {
    BaseURL string
    // contains filtered or unexported fields
}

OpenShot is the main entry point into the sdk

func New Uses

func New(BaseURL string, Username string, Password string) *OpenShot

New creates a new instance of OpenShot with default settings

func (*OpenShot) AddPropertyPoint Uses

func (o *OpenShot) AddPropertyPoint(clip *Clip, key string, frame int, value float64)

AddPropertyPoint sets a JSON property of the provided clip object at the specified frame. DOES NOT set value on server, requires call to UpdateClip

func (*OpenShot) ClearPropertyPoints Uses

func (o *OpenShot) ClearPropertyPoints(clip *Clip, key string)

ClearPropertyPoints clears all property point entires from clip for the specified property key.

func (*OpenShot) CreateClip Uses

func (o *OpenShot) CreateClip(project *Project, clip *Clip) (*Clip, error)

CreateClip creates a clip for the specified project

func (*OpenShot) CreateExport Uses

func (o *OpenShot) CreateExport(project *Project, input *Export) (*Export, error)

CreateExport triggers exporting the specified project with the given export settings on the OpenShot server

func (*OpenShot) CreateFile Uses

func (o *OpenShot) CreateFile(project *Project, file *FileUploadS3) (*File, error)

CreateFile adds file to openshot from location on s3. The projectURL of the given file (if empty) is overridden with one matching the specified projectID. The URL (if empty) is overridden with "files/NAME"

func (*OpenShot) CreateProject Uses

func (o *OpenShot) CreateProject(project *Project) (*Project, error)

CreateProject creates the given project on the OpenShot server

func (*OpenShot) DeleteClip Uses

func (o *OpenShot) DeleteClip(clipID int) error

DeleteClip deletes the clip from openshot

func (*OpenShot) DeleteExport Uses

func (o *OpenShot) DeleteExport(exportID int) error

DeleteExport deletes the export from openshot

func (*OpenShot) DeleteFile Uses

func (o *OpenShot) DeleteFile(fileID int) error

DeleteFile deletes the file from openshot and associated storage

func (*OpenShot) DeleteProject Uses

func (o *OpenShot) DeleteProject(projectID int) error

DeleteProject deletes a project on the OpenShot server. Note that this deletion will trigger deletion of all associated files and clips. There is also no (easy) way to recover a deleted project so this method should only be exposed to trusted sources and through an "are you sure" or equivalent confirmation dialog.

func (*OpenShot) GetClip Uses

func (o *OpenShot) GetClip(clipID int) (*Clip, error)

GetClip gets the server version of the specified clip

func (*OpenShot) GetClips Uses

func (o *OpenShot) GetClips(projectID int) (*Clips, error)

GetClips returns a list of all clips created for a particular project

func (*OpenShot) GetExport Uses

func (o *OpenShot) GetExport(exportID int) (*Export, error)

GetExport gets the server version of the specified export

func (*OpenShot) GetExports Uses

func (o *OpenShot) GetExports(projectID int) (*Exports, error)

GetExports returns a list of all exports created for a particular project

func (*OpenShot) GetFiles Uses

func (o *OpenShot) GetFiles(project *Project) (*Files, error)

GetFiles returns a list of all files created for a particular project

func (*OpenShot) GetProjects Uses

func (o *OpenShot) GetProjects() (*Projects, error)

GetProjects returns a list of all projects created on the OpenShot server

func (*OpenShot) GetProperty Uses

func (o *OpenShot) GetProperty(clip *Clip, key string) *Property

GetProperty returns a json object type-asserted to an openshot.Property object

func (*OpenShot) SetScale Uses

func (o *OpenShot) SetScale(clip *Clip, scale int)

SetScale sets the scale of the provided clip object DOES NOT set value on server, requires call to UpdateClip

func (*OpenShot) UpdateClip Uses

func (o *OpenShot) UpdateClip(clip *Clip) (*Clip, error)

UpdateClip updates a clip on the OpenShot server

type Point Uses

type Point struct {
    Co            Cord `json:"co"`
    Interpolation int  `json:"interpolation"`
}

Point represents a single point in animation properties. It contains the value and interpolation mode. Interpolation can be set to: 0 - Bézier, 1 - Linear, or 2 - Constant Read more about interpolation at http://cloud.openshot.org/doc/animation.html#key-frames

type Project Uses

type Project struct {
    URL            string      `json:"url"`
    ID             int         `json:"id"`
    JSON           interface{} `json:"json"`
    Name           string      `json:"name"`
    Width          int         `json:"width"`
    Height         int         `json:"height"`
    FPSNumerator   int         `json:"fps_num"`
    FPSDenominator int         `json:"fps_den"`
    SampleRate     int         `json:"sample_rate"`
    Channels       int         `json:"channels"`
    ChannelLayout  int         `json:"channel_layout"`
    FileURLs       []string    `json:"files"`
    ClipURLs       []string    `json:"clips"`
    ExportURLs     []string    `json:"exports"`
    Actions        []string    `json:"actions"`
    DateCreated    string      `json:"date_created"`
    DateUpdated    string      `json:"date_updated"`
}

Project represents http://cloud.openshot.org/doc/api_endpoints.html#projects

type Projects Uses

type Projects struct {
    Results []Project `json:"results"`
    // contains filtered or unexported fields
}

Projects is the response data for /projects/

type Property Uses

type Property struct {
    Points []Point `json:"Points"`
}

Property represents the JSON structure of points in animations More details at http://cloud.openshot.org/doc/animation.html#json-structure

Package openshot imports 4 packages (graph) and is imported by 1 packages. Updated 2019-04-13. Refresh now. Tools for package owners.