joy4: github.com/nareix/joy4/av/transcode Index | Files

package transcode

import "github.com/nareix/joy4/av/transcode"

Package transcoder implements Transcoder based on Muxer/Demuxer and AudioEncoder/AudioDecoder interface.

Index

Package Files

transcode.go

Variables

var Debug bool

type Demuxer Uses

type Demuxer struct {
    av.Demuxer
    Options
    // contains filtered or unexported fields
}

Wrap transcoder and origin Demuxer into new Demuxer. Read this Demuxer will do transcoding automatically.

func (*Demuxer) Close Uses

func (self *Demuxer) Close() (err error)

func (*Demuxer) ReadPacket Uses

func (self *Demuxer) ReadPacket() (pkt av.Packet, err error)

func (*Demuxer) Streams Uses

func (self *Demuxer) Streams() (streams []av.CodecData, err error)

type Muxer Uses

type Muxer struct {
    av.Muxer // origin Muxer
    Options  // transcode options
    // contains filtered or unexported fields
}

Wrap transcoder and origin Muxer into new Muxer. Write to new Muxer will do transcoding automatically.

func (*Muxer) Close Uses

func (self *Muxer) Close() (err error)

func (*Muxer) WriteHeader Uses

func (self *Muxer) WriteHeader(streams []av.CodecData) (err error)

func (*Muxer) WritePacket Uses

func (self *Muxer) WritePacket(pkt av.Packet) (err error)

type Options Uses

type Options struct {
    // check if transcode is needed, and create the AudioDecoder and AudioEncoder.
    FindAudioDecoderEncoder func(codec av.AudioCodecData, i int) (
        need bool, dec av.AudioDecoder, enc av.AudioEncoder, err error,
    )
}

type Transcoder Uses

type Transcoder struct {
    // contains filtered or unexported fields
}

func NewTranscoder Uses

func NewTranscoder(streams []av.CodecData, options Options) (_self *Transcoder, err error)

func (*Transcoder) Close Uses

func (self *Transcoder) Close() (err error)

Close transcoder, close related encoder and decoders.

func (*Transcoder) Do Uses

func (self *Transcoder) Do(pkt av.Packet) (out []av.Packet, err error)

Do the transcode.

In audio transcoding one Packet may transcode into many Packets packet time will be adjusted automatically.

func (*Transcoder) Streams Uses

func (self *Transcoder) Streams() (streams []av.CodecData, err error)

Get CodecDatas after transcoding.

Package transcode imports 4 packages (graph) and is imported by 5 packages. Updated 2019-03-10. Refresh now. Tools for package owners.