Documentation ¶
Overview ¶
Package ffmpeg is a utility for calling ffmpeg as a command and piping images to it to render a video file.
Index ¶
- Constants
- type Framer
- type Pipeline
- type Proc
- type Settings
- func (s *Settings) Args() []string
- func (s *Settings) ByAspect(width int, aspect grid.Aspect) *Settings
- func (s *Settings) Framer(f Framer) (err error)
- func (s *Settings) NewProc() (*Proc, error)
- func (s *Settings) Run(fn func(*Proc) error) (err error)
- func (s *Settings) RunPipeline(fn func(*Pipeline) error) (err error)
- func (s *Settings) Set(width, height int) *Settings
- func (s *Settings) SetOut(out, err io.Writer) *Settings
- func (s *Settings) SetSize(size grid.Pt) *Settings
- type Sizer
Constants ¶
const ( Framerate = 24 ConstantRateFactor = 25 Name = "out" )
Default Settings values
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Framer ¶
type Framer interface { // Frame renders the frame at the given index. The img passed in allows for // recycling. If it is nil, a new image should be generated. Frame(idx int, img image.Image) (image.Image, error) // Frames returns the number of frames to render Frames() int }
Framer provides an interface for rendering frames to ffmpeg.
type Pipeline ¶
Pipeline allows the process of encoding and passing an image to the ffmpeg process to happen in parallel to the process of generating frames.
type Proc ¶
type Proc struct { Settings // contains filtered or unexported fields }
Proc is a running instance of ffmpeg.
type Settings ¶
type Settings struct { Framerate byte Name string ConstantRateFactor byte Size grid.Pt Stdout, Stderr io.Writer }
Settings for an ffmpeg process
func NewByAspect ¶
NewByAspect creates Settings with the provided aspect ratio.
func NewWidescreen ¶
NewWidescreen creates Settings with a Widescreen aspect ratio.
func (*Settings) ByAspect ¶
ByAspect update the width and height of the settings using the provided aspect ratio.
func (*Settings) Framer ¶
Framer will iterate through each frame of each framers. They are passed to the ffpeg process through a Pipeline.
func (*Settings) Run ¶
Run will start and close the ffmpeg Proc, passing the Proc into the provided func for use.
func (*Settings) RunPipeline ¶
RunPipeline creates a Pipeline from the Settings and passes it into the func provided.