ivfwriter

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ivfwriter implements IVF media container writer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IVFWriter

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

IVFWriter is used to take RTP packets and write them to an IVF on disk.

func New

func New(fileName string, opts ...Option) (*IVFWriter, error)

New builds a new IVF writer.

func NewWith

func NewWith(out io.Writer, opts ...Option) (*IVFWriter, error)

NewWith initialize a new IVF writer with an io.Writer output.

func (*IVFWriter) Close

func (i *IVFWriter) Close() error

Close stops the recording.

func (*IVFWriter) WriteRTP

func (i *IVFWriter) WriteRTP(packet *rtp.Packet) error

WriteRTP adds a new packet and writes the appropriate headers for it.

type Option

type Option func(i *IVFWriter) error

An Option configures a SampleBuilder.

func WithCodec

func WithCodec(mimeType string) Option

WithCodec configures if IVFWriter is writing AV1 or VP8 packets to disk.

func WithDirectPTS

func WithDirectPTS() Option

WithDirectPTS enables direct use of RTP timestamps as PTS values without millisecond conversion.

When this option is used, RTP timestamps are written directly as PTS values, preserving full timestamp precision. Use WithFrameRate to set the appropriate timebase (e.g., WithFrameRate(1, 90000) for standard 90kHz RTP clock).

Example usage for standard RTP video (90kHz clock rate):

NewWith(file, WithFrameRate(1, 90000), WithDirectPTS())

func WithFrameRate

func WithFrameRate(numerator, denominator uint32) Option

func WithWidthAndHeight

func WithWidthAndHeight(width, height uint16) Option

Jump to

Keyboard shortcuts

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