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) Bitrate Uses

func (v *Video) Bitrate() int

Get the set bitrate of the current video struct

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) Mute Uses

func (v *Video) Mute()

Mute mutes the video

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. This method won't return anything on stdout / stderr. If you need to read ffmpeg's outputs, use RenderWithStreams

func (*Video) RenderWithStreams Uses

func (v *Video) RenderWithStreams(output string, os io.Writer, es io.Writer) error

RenderWithStreams applies all operations to the Video and creates an output video file of the given name. By specifying an output stream and an error stream, you can read ffmpeg's stdout and stderr.

func (*Video) SetBitrate Uses

func (v *Video) SetBitrate(bitrate int)

SetBitrate sets the bitrate of the output video.

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 9 packages (graph) and is imported by 1 packages. Updated 2020-02-09. Refresh now. Tools for package owners.