transcode

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var Debug bool

Debug type

Functions

This section is empty.

Types

type Demuxer

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

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

func (*Demuxer) Close

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

Close func

func (*Demuxer) ReadPacket

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

ReadPacket func

func (*Demuxer) Streams

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

Streams func

type Muxer

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

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

func (*Muxer) Close

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

Close func

func (*Muxer) WriteHeader

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

WriteHeader func

func (*Muxer) WritePacket

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

WritePacket func

type Options

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,
	)
}

Options struct

type Transcoder

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

Transcoder struct

func NewTranscoder

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

NewTranscoder func

func (*Transcoder) Close

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

Close transcoder, close related encoder and decoders.

func (*Transcoder) Do

func (instance *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

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

Streams Get CodecDatas after transcoding.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL