rtsp

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 7 Imported by: 0

README

FFmpeg rtsp implementation

need FFmpeg lib

Documentation

Overview

Package go-rtsp is a Golang audio/video library based on FFmpeg. go-rtsp is powerful library to help convert streams/files to jpeg/wav.

+build linux

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CErr2Str added in v0.1.2

func CErr2Str(code C.int) string

Types

type Audio

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

func (*Audio) BitRate

func (audio *Audio) BitRate() int

BitRate if audio or 0 if image

func (*Audio) Channels

func (audio *Audio) Channels() int

Channels if audio or 0 if image

func (*Audio) SampleRate

func (audio *Audio) SampleRate() int

SampleRate if audio or 0 if image

type ErrTimeout added in v0.1.2

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

func (ErrTimeout) Error added in v0.1.2

func (e ErrTimeout) Error() string

type Image

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

func (*Image) Height

func (image *Image) Height() int

Height if image or 0 if audio

func (*Image) Width

func (image *Image) Width() int

Width if image or 0 if audio

type Packet

type Packet struct {
	Image
	Audio
	// contains filtered or unexported fields
}

func (*Packet) Data

func (packet *Packet) Data() []byte

Data encoded jpeg if image or wav if audio

func (*Packet) IsAudio

func (packet *Packet) IsAudio() bool

IsAudio packet

func (*Packet) IsVideo

func (packet *Packet) IsVideo() bool

IsVideo packet

type Stream

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

func New

func New(uri string) (stream *Stream)

New stream

func Open

func Open(uri string) (*Stream, error)

Open rtsp stream or file

func (*Stream) ReadPacket

func (stream *Stream) ReadPacket() (pkt *Packet, err error)

func (*Stream) Setup

func (stream *Stream) Setup(t Type) (err error)

Setup transport (tcp or udp)

type Type

type Type int
const (
	Auto Type = iota
	Tcp
	Udp
)

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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