Documentation ¶
Index ¶
- type Video
- func (v *Video) Bitrate() int
- func (v *Video) CommandLine(output string) []string
- func (v *Video) Crop(x, y, width, height int)
- func (v *Video) Duration() time.Duration
- func (v *Video) End() time.Duration
- func (v *Video) FPS() int
- func (v *Video) Filepath() string
- func (v *Video) Height() int
- func (v *Video) Mute()
- func (v *Video) Render(output string) error
- func (v *Video) RenderWithStreams(output string, os io.Writer, es io.Writer) error
- func (v *Video) SetBitrate(bitrate int)
- func (v *Video) SetEnd(end time.Duration)
- func (v *Video) SetFPS(fps int)
- func (v *Video) SetSize(width int, height int)
- func (v *Video) SetStart(start time.Duration)
- func (v *Video) Start() time.Duration
- func (v *Video) Trim(start, end time.Duration)
- func (v *Video) Width() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Video ¶
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 ¶
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 ¶
CommandLine returns the command line that will be used to convert the Video if you were to call Render.
func (*Video) Crop ¶
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 ¶
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) Render ¶
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 ¶
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 ¶
SetBitrate sets the bitrate of the output video.
func (*Video) SetEnd ¶
SetEnd sets the end time of the output video. It is always relative to the original input video.
func (*Video) SetStart ¶
SetStart sets the start time of the output video. It is always relative to the original input video.