Documentation
¶
Overview ¶
Package x264 provides H.264/MPEG-4 AVC codec encoder based on x264(https://www.videolan.org/developers/x264.html) library.
Index ¶
Constants ¶
const ( LogNone int32 = iota - 1 LogError LogWarning LogInfo LogDebug )
Logging constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder type.
func NewEncoder ¶
NewEncoder returns new x264 encoder.
type Options ¶
type Options struct {
// Frame width.
Width int
// Frame height.
Height int
// Frame rate.
FrameRate int
// Tunings: film, animation, grain, stillimage, psnr, ssim, fastdecode, zerolatency.
Tune string
// Presets: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo.
Preset string
// Profiles: baseline, main, high, high10, high422, high444.
Profile string
// KeyInt is the maximum interval between keyframes (GOP size) in frames. Defaults to FrameRate when zero.
KeyInt int
// IntraRefresh uses periodic intra refresh instead of IDR keyframes: lower latency, but no seekable keyframes. Off by default.
IntraRefresh bool
// RateControl: cqp, crf, abr.
RateControl string
// Quality target: quantizer for cqp, CRF value for crf.
RateConstant float32
// Upper bound: max quantizer for cqp, max CRF for crf, VBV max bitrate (kbit/s) for abr.
RateMax float32
// Target average bitrate (kbit/s). Required for abr.
Bitrate int
// VBV buffer size (kbit). Optional; bounds rate fluctuation when RateMax is set for abr.
VbvBufferSize int
// Log level.
LogLevel int32
}
Options represent encoding options.
type YCbCr ¶
YCbCr is an in-memory image of Y'CbCr colors.
func (*YCbCr) ToYCbCrColor ¶ added in v0.2.0
ToYCbCrColor converts image.Image to YCbCr.
func (*YCbCr) ToYCbCrDraw ¶
ToYCbCrDraw converts image.Image to YCbCr.