Versions in this module Expand all Collapse all v0 v0.1.3 Jul 3, 2023 v0.1.2 Jun 30, 2023 v0.1.1 Jun 29, 2023 Changes in this version + const CaptureModeByFrame + const CaptureModeByInterval + const DefaultIOTimeout + const OutputTypeAudioSegment + const OutputTypeImage + var ErrConnectionTimeout = fmt.Errorf("CONNECTION_TIMEOUT") + var ErrInvalidData = fmt.Errorf("INVALID_DATA") + var ErrInvalidUrl = fmt.Errorf("INVALID_URL") + var ErrMediaServerError = fmt.Errorf("MEDIA_SERVER_ERROR") + var ErrNoStream = fmt.Errorf("NO_STREAM") + var ErrOOMKilled = fmt.Errorf("OOM_KILLED") + var ErrResolveHostFailed = fmt.Errorf("RESOLVE_HOST_FAILED") + var ErrStreamClosed = fmt.Errorf("STREAM_CLOSED") + var ErrUrlExpiredOrForbidden = fmt.Errorf("URL_EXPIRED_OR_FORBIDDEN") + var ErrUrlNotFound = fmt.Errorf("URL_NOT_FOUND") + var SEIRegex = regexp.Compile(`{".+([0-9]|}|]|")}`) + func ParseCaptureCommand(opt *CaptureOptions) string + func ParseCaptureOptions(opt *CaptureOptions) string + func ParseCommandWithoutArguments(opt *CommonOptions, command string) []string + func ParseCommonOptions(opt *CommonOptions, command string, withUri bool) string + func ParseProbeCommand(opt *ProbeOptions) string + func ParseSliceAndCaptureCommand(opt *SliceAndCaptureOptions) string + func ParseSliceCommand(opt *SliceOptions) string + func ParseSliceOptions(opt *SliceOptions) string + type CaptureOptions struct + Debug bool + Frame int + MaxFrames int + Mode int + Rate float32 + Size string + type Command struct + func NewCommand() *Command + func (c *Command) Capture(opt *CaptureOptions) error + func (c *Command) Close() error + func (c *Command) Error() error + func (c *Command) IsClosed() bool + func (c *Command) IsFinished() bool + func (c *Command) LastCaptureIndex() int64 + func (c *Command) LastIndex() int64 + func (c *Command) LastSliceIndex() int64 + func (c *Command) ProbeStreams(opt *ProbeOptions) (st *StreamInfo, err error) + func (c *Command) ReadOutput() (o *Output, err error, ok bool, finished bool) + func (c *Command) Slice(opt *SliceOptions) error + func (c *Command) SliceAndCapture(opt *SliceAndCaptureOptions) error + func (c *Command) Stats() OutputStats + type CommonOptions struct + DecodeSEI bool + DockerCommand string + IOTimeout int + IsFile bool + IsStream bool + LogLevel string + MediaId string + OutputDir string + PreserveOutput bool + Proxy string + SEIFragmentSuffix string + SEIOutputDir string + Suffix string + Uri string + func (opt *CommonOptions) GetIOTimeout() int + func (opt *CommonOptions) GetLogLevel() string + func (opt *CommonOptions) HttpProxy() string + type Format struct + BitRate string + Duration string + FileName string + FormatName string + ProbeScore int + Size string + StartTime string + func (f *Format) GetDuration() (float64, error) + func (f *Format) GetSize() (int64, error) + type Output struct + Content []byte + Index int64 + Last bool + LastCaptured bool + LastSliced bool + Position int64 + SEIInfo []string + Second float64 + Suffix string + Type int + type OutputModifier func(*Output) + type OutputStats struct + Bytes int64 + Duration int64 + End time.Time + Output int + Start time.Time + type ProbeOptions struct + DockerCommand string + IsFile bool + IsStream bool + LogLevel string + MaxRetry int + Proxy string + RetryInterval time.Duration + RetryStreamOnError bool + Uri string + func (opt *ProbeOptions) GetLogLevel() string + func (opt *ProbeOptions) HttpProxy() string + type SliceAndCaptureOptions struct + HasImageStream bool + HasSpeechStream bool + type SliceOptions struct + Channels int + Coding string + DisableVideo bool + Format string + FragmentDuration int + SamplingFrequency int + func NewDefaultSliceOptions() *SliceOptions + type Stream struct + AvgFrameRate string + CodecName string + CodecType string + DisplayAspectRatio string + Duration string + Frames string + Height int + Index int + SampleRate string + StartTime string + Width int + func (s *Stream) GetDuration() (float64, error) + func (s *Stream) GetFrameRate() (float64, error) + func (s *Stream) GetFrames() (int64, error) + func (s *Stream) GetStartTime() (float64, error) + type StreamInfo struct + Format Format + Streams []Stream + func (st *StreamInfo) GetAudioDuration() (float64, error) + func (st *StreamInfo) GetVideoDuration() (float64, error) + func (st *StreamInfo) HasAudioStream() (int, bool) + func (st *StreamInfo) HasVideoStream() (int, bool)