cinema: github.com/jtguibas/cinema Index | Files | Directories

package cinema

import "github.com/jtguibas/cinema"

Index

Package Files

cinema.go

type Video Uses

type Video struct {
    // contains filtered or unexported fields
}

Video contains information about a video file and all the operations that need to be applied to it. Call Load to initialize a Video from file. Call the transformation functions to generate the desired output. Then call Render to generate the final output video file.

func Load Uses

func Load(path string) (*Video, error)

Load gives you a Video that can be operated on. Load does not open the file or load it into memory. Apply operations to the Video and call Render to generate the output video file.

func (*Video) CommandLine Uses

func (v *Video) CommandLine(output string) []string

CommandLine returns the command line that will be used to convert the Video if you were to call Render.

func (*Video) Crop Uses

func (v *Video) Crop(x, y, width, height int)

Crop makes the output video a sub-rectangle of the input video. (0,0) is the top-left of the video, x goes right, y goes down.

func (*Video) Duration Uses

func (v *Video) Duration() time.Duration

Duration returns the duration of the original input video. It does not account for any trim operation (Trim, SetStart, SetEnd). To get the current trimmed duration use

v.End() - v.Start()

func (*Video) End Uses

func (v *Video) End() time.Duration

End returns the end of the video.

func (*Video) FPS Uses

func (v *Video) FPS() int

Get the set fps of the current video struct

func (*Video) Filepath Uses

func (v *Video) Filepath() string

Filepath returns the path of the input video.

func (*Video) Height Uses

func (v *Video) Height() int

Height returns the width of the video in pixels.

func (*Video) Render Uses

func (v *Video) Render(output string) error

Render applies all operations to the Video and creates an output video file of the given name.

func (*Video) SetEnd Uses

func (v *Video) SetEnd(end time.Duration)

SetEnd sets the end time of the output video. It is always relative to the original input video.

func (*Video) SetFPS Uses

func (v *Video) SetFPS(fps int)

SetFPS sets the framerate (frames per second) of the output video.

func (*Video) SetSize Uses

func (v *Video) SetSize(width int, height int)

SetSize sets the width and height of the output video.

func (*Video) SetStart Uses

func (v *Video) SetStart(start time.Duration)

SetStart sets the start time of the output video. It is always relative to the original input video.

func (*Video) Start Uses

func (v *Video) Start() time.Duration

Start returns the start of the video .

func (*Video) Trim Uses

func (v *Video) Trim(start, end time.Duration)

Trim sets the start and end time of the output video. It is always relative to the original input video. start must be less than or equal to end or nothing will change.

func (*Video) Width Uses

func (v *Video) Width() int

Width returns the width of the video in pixels.

Directories

PathSynopsis
example

Package cinema imports 8 packages (graph) and is imported by 1 packages. Updated 2019-08-29. Refresh now. Tools for package owners.