screcorder

package
v1.3.6-beta1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExampleReadFrameAsJpeg added in v1.2.2

func ExampleReadFrameAsJpeg(inFileName string, frameNum int) (io.Reader, error)

func IsAvailable

func IsAvailable() (bool, error)

func VideoCoverBase64 added in v1.2.2

func VideoCoverBase64(fileName string) (imgBase64 string, err error)

func VideoDuration added in v1.2.2

func VideoDuration(path string) string

Types

type Config

type Config struct {
	Framerate           int // 1-3 is safe
	Height              int
	Width               int
	CoefficientPTSFloat float64 // 0.333*PTS
	MouseCapture        bool
	MouseClickCapture   bool
	// contains filtered or unexported fields
}

func NewDefaultConfig

func NewDefaultConfig() *Config

func (*Config) ToParams

func (c *Config) ToParams(input, output string) ([]string, error)

type ConfigOpt

type ConfigOpt func(config *Config)

func WithCoefficientPTS

func WithCoefficientPTS(i float64) ConfigOpt

func WithContext

func WithContext(ctx context.Context, cancel context.CancelFunc) ConfigOpt

func WithFramerate

func WithFramerate(i int) ConfigOpt

func WithMouseCapture

func WithMouseCapture(i bool) ConfigOpt

func WithResolutionSize

func WithResolutionSize(i string) ConfigOpt

type Recorder

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

func NewRecorder

func NewRecorder(opt ...ConfigOpt) *Recorder

func (*Recorder) IsRunning

func (r *Recorder) IsRunning() bool

func (*Recorder) OnFileAppended

func (r *Recorder) OnFileAppended(h func(i string))

func (*Recorder) OutputFiles

func (r *Recorder) OutputFiles() []string

func (*Recorder) Start

func (r *Recorder) Start(outputName string) error

func (*Recorder) Stop

func (r *Recorder) Stop()

type ScreenDevice

type ScreenDevice struct {
	DeviceName string
	// in darwin: "1" "2" "3" is ok
	// linux: ":0.1" ":0.2" ":0.3"
	FfmpegInputName string
}

func GetDarwinAvailableAVFoundationScreenDevices

func GetDarwinAvailableAVFoundationScreenDevices() []*ScreenDevice

Jump to

Keyboard shortcuts

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