Documentation ¶
Index ¶
- Variables
- type Config
- type Encoder
- func (e *Encoder) Config() Config
- func (e *Encoder) GetVideo(input, title string) (string, io.ReadCloser, error)
- func (e *Encoder) SaveVideo(input, output, title string) (string, string, error)
- func (e *Encoder) SetAudio(audio string) bool
- func (e *Encoder) SetCRF(crf string) int
- func (e *Encoder) SetHeight(height string) int
- func (e *Encoder) SetLevel(level string) string
- func (e *Encoder) SetProfile(profile string) string
- func (e *Encoder) SetRate(rate string) int
- func (e *Encoder) SetSize(size string) int64
- func (e *Encoder) SetTime(seconds string) int
- func (e *Encoder) SetWidth(width string) int
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultFrameRate = 5 MinimumFrameRate = 1 MaximumFrameRate = 60 DefaultFrameHeight = 720 DefaultFrameWidth = 1280 MinimumFrameSize = 100 MaximumFrameSize = 5000 DefaultEncodeCRF = 21 MinimumEncodeCRF = 16 MaximumEncodeCRF = 30 DefaultCaptureTime = 15 MaximumCaptureTime = 1200 // 10 minute max. DefaultCaptureSize = int64(2500000) // 2.5MB default (roughly 5-10 seconds) MaximumCaptureSize = int64(104857600) // 100MB max. DefaultFFmpegPath = "/usr/local/bin/ffmpeg" DefaultProfile = "main" DefaultLevel = "3.0" ErrorInvalidOutput = errors.New("output path is not valid") ErrorInvalidInput = errors.New("input path is not valid") )
Default, Maximum and Minimum Values
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { FFMPEG string // "/usr/local/bin/ffmpeg" Level string // 3.0, 3.1 .. Width int // 1920 Height int // 1080 CRF int // 24 Time int // 15 (seconds) Audio bool // include audio? Rate int // framerate (5-20) Size int64 // max file size (always goes over). use 2000000 for 2.5MB Prof string // main, high, baseline Copy bool // Copy original stream, rather than transcode. }
Config defines how to ffmpeg shall transcode a stream.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder is the struct returned by this library. Contains all the bound methods.
func (*Encoder) GetVideo ¶
GetVideo retreives video from an input and returns a Reader to consume the output. The Reader contains output messages if output is a filepath. The Reader contains the video if the output is "-"
func (*Encoder) SetProfile ¶
SetProfile sets the h264 transcode profile.
Click to show internal directories.
Click to hide internal directories.