x264-go: github.com/gen2brain/x264-go Index | Files | Directories

package x264

import "github.com/gen2brain/x264-go"

Package x264 provides H.264/MPEG-4 AVC codec encoder based on [x264](https://www.videolan.org/developers/x264.html) library.


Package Files

encode.go ycbcr.go


const (
    LogNone int32 = iota - 1

Logging constants.

type Encoder Uses

type Encoder struct {
    // contains filtered or unexported fields

Encoder type.

func NewEncoder Uses

func NewEncoder(w io.Writer, opts *Options) (e *Encoder, err error)

NewEncoder returns new x264 encoder.

func (*Encoder) Close Uses

func (e *Encoder) Close() error

Close closes encoder.

func (*Encoder) Encode Uses

func (e *Encoder) Encode(im image.Image) (err error)

Encode encodes image.

func (*Encoder) Flush Uses

func (e *Encoder) Flush() (err error)

Flush flushes encoder.

type Options Uses

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
    // Log level.
    LogLevel int32

Options represent encoding options.

type YCbCr Uses

type YCbCr struct {

YCbCr is an in-memory image of Y'CbCr colors.

func NewYCbCr Uses

func NewYCbCr(r image.Rectangle) *YCbCr

NewYCbCr returns a new YCbCr image with the given bounds and subsample ratio.

func (*YCbCr) Set Uses

func (p *YCbCr) Set(x, y int, c color.Color)

Set sets pixel color.

func (*YCbCr) ToYCbCr Uses

func (p *YCbCr) ToYCbCr(src image.Image)

ToYCbCr converts image.Image to YCbCr.


x264cPackage x264c implements cgo bindings for [x264](https://www.videolan.org/developers/x264.html) library.

Package x264 imports 7 packages (graph). Updated 2018-03-08. Refresh now. Tools for package owners.