video

package
v0.0.0-...-70b8bd4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeFrameToJPEG

func EncodeFrameToJPEG(yuv []byte, width, height int, quality int) ([]byte, error)

EncodeFrameToJPEG converts a YUV frame to JPEG format with the specified quality

Types

type OpenH264Decoder

type OpenH264Decoder struct{}

OpenH264Decoder stub when OpenH264 is not available at build time.

func NewOpenH264Decoder

func NewOpenH264Decoder() (*OpenH264Decoder, error)

func (*OpenH264Decoder) Close

func (d *OpenH264Decoder) Close()

func (*OpenH264Decoder) Decode

func (d *OpenH264Decoder) Decode(nalus [][]byte) ([]byte, int, int, error)

type VideoFrame

type VideoFrame struct {
	YUV    []byte
	Width  int
	Height int
}

VideoFrame represents a decoded video frame in YUV format with dimensions

type VideoMediaPipeline

type VideoMediaPipeline struct {
	*helpers.MediaPipeline
	// contains filtered or unexported fields
}

VideoMediaPipeline extends MediaPipeline with H.264-specific decoder support

func NewVideoMediaPipeline

func NewVideoMediaPipeline(rtspLogger logger.Logger, medias []*description.Media) (*VideoMediaPipeline, error)

NewVideoMediaPipeline creates a video-specific pipeline with H.264 decoder support

func (*VideoMediaPipeline) ProcessRTP

func (vmp *VideoMediaPipeline) ProcessRTP(pkt *rtp.Packet, forma format.Format) (any, error)

ProcessRTP_Internal handles H.264 video RTP packet processing with frame decoding. It is the internal implementation called by VideoProcessor.ProcessRTP.

type VideoProcessor

type VideoProcessor struct {
	*helpers.BaseMediaProcessor
	// contains filtered or unexported fields
}

VideoProcessor processes video data, holding the latest frame It extends BaseMediaProcessor with video-specific frame handling and JPEG encoding

func NewVideoProcessor

func NewVideoProcessor(chunkBytes, maxBytes, trimBytes int) *VideoProcessor

NewVideoProcessor creates a new video processor with specified buffer parameters

func (*VideoProcessor) ProcessRTP

func (vp *VideoProcessor) ProcessRTP(pkt *rtp.Packet, forma format.Format) (any, error)

ProcessRTP handles H.264 video RTP packet processing for VideoProcessor

func (*VideoProcessor) Push

func (vp *VideoProcessor) Push(data any)

Push stores the latest video frame for processing

func (*VideoProcessor) Start

func (vp *VideoProcessor) Start(interval time.Duration)

Start begins video processing with the specified interval

Jump to

Keyboard shortcuts

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