Documentation
¶
Overview ¶
Package openshot is a Go SDK for the OpenShot Cloud API.
Index ¶
- Constants
- type Clip
- type Clips
- type Cord
- type Export
- type Exports
- type File
- type FileS3Info
- type FileUploadS3
- type Files
- type OpenShot
- func (o *OpenShot) AddPropertyPoint(clip *Clip, key string, frame int, value float64)
- func (o *OpenShot) ClearPropertyPoints(clip *Clip, key string)
- func (o *OpenShot) CreateClip(project *Project, clip *Clip) (*Clip, error)
- func (o *OpenShot) CreateExport(project *Project, input *Export) (*Export, error)
- func (o *OpenShot) CreateFile(project *Project, file *FileUploadS3) (*File, error)
- func (o *OpenShot) CreateProject(project *Project) (*Project, error)
- func (o *OpenShot) DeleteClip(clipID int) error
- func (o *OpenShot) DeleteExport(exportID int) error
- func (o *OpenShot) DeleteFile(fileID int) error
- func (o *OpenShot) DeleteProject(projectID int) error
- func (o *OpenShot) GetClip(clipID int) (*Clip, error)
- func (o *OpenShot) GetClips(projectID int) (*Clips, error)
- func (o *OpenShot) GetExport(exportID int) (*Export, error)
- func (o *OpenShot) GetExports(projectID int) (*Exports, error)
- func (o *OpenShot) GetFiles(project *Project) (*Files, error)
- func (o *OpenShot) GetProjects() (*Projects, error)
- func (o *OpenShot) GetProperty(clip *Clip, key string) *Property
- func (o *OpenShot) SetScale(clip *Clip, scale int)
- func (o *OpenShot) UpdateClip(clip *Clip) (*Clip, error)
- type Point
- type Project
- type Projects
- type Property
Constants ¶
const (
LocationX = "location_x"
)
Constants representing clip JSON property names More details at: http://cloud.openshot.org/doc/api_endpoints.html#clips
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clip ¶
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 ¶
CreateClipStruct creates a minimum Clip struct required for input to CreateClip
type Clips ¶
type Clips struct { Results []Clip `json:"results"` // contains filtered or unexported fields }
Clips is the response data for /projects/{projectID}/clips/
type Cord ¶
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 ¶
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 ¶
CreateDefaultExportStruct creates an Export struct with default settings
type Exports ¶
type Exports struct { Results []Export `json:"results"` // contains filtered or unexported fields }
Exports is the response data for /projects/{projectID}/exports/
type File ¶
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 ¶
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 ¶
func CreateFileS3InfoStruct(testFileName string, folder string, bucket string) *FileS3Info
CreateFileS3InfoStruct creates a minimum FileS3Info struct required for input to CreateFileStruct
type FileUploadS3 ¶
type FileUploadS3 struct { ProjectURL string `json:"project"` JSON FileS3Info `json:"json"` }
FileUploadS3 represents http://cloud.openshot.org/doc/api_endpoints.html#files
func CreateFileStruct ¶
func CreateFileStruct(fileS3Info *FileS3Info) *FileUploadS3
CreateFileStruct creates a minimum FileUploadS3 struct required for input to CreateFile
type Files ¶
type Files struct { Results []File `json:"results"` // contains filtered or unexported fields }
Files is the response data for /projects/{projectID}/files/
type OpenShot ¶
type OpenShot struct { BaseURL string // contains filtered or unexported fields }
OpenShot is the main entry point into the sdk
func (*OpenShot) AddPropertyPoint ¶
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 ¶
ClearPropertyPoints clears all property point entires from clip for the specified property key.
func (*OpenShot) CreateClip ¶
CreateClip creates a clip for the specified project
func (*OpenShot) CreateExport ¶
CreateExport triggers exporting the specified project with the given export settings on the OpenShot server
func (*OpenShot) CreateFile ¶
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 ¶
CreateProject creates the given project on the OpenShot server
func (*OpenShot) DeleteClip ¶
DeleteClip deletes the clip from openshot
func (*OpenShot) DeleteExport ¶
DeleteExport deletes the export from openshot
func (*OpenShot) DeleteFile ¶
DeleteFile deletes the file from openshot and associated storage
func (*OpenShot) DeleteProject ¶
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) GetExports ¶
GetExports returns a list of all exports created for a particular project
func (*OpenShot) GetProjects ¶
GetProjects returns a list of all projects created on the OpenShot server
func (*OpenShot) GetProperty ¶
GetProperty returns a json object type-asserted to an openshot.Property object
type Point ¶
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 ¶
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 ¶
type Projects struct { Results []Project `json:"results"` // contains filtered or unexported fields }
Projects is the response data for /projects/
type Property ¶
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