Documentation ¶
Overview ¶
The RTMP server. This will put up a RTMP endpoint when starting up Swarm. To integrate with LPMS means your code will become the source / destination of the media server. This RTMP endpoint is mainly used for video upload. The expected url is rtmp://localhost:port/livepeer/stream
Index ¶
- Variables
- type LPMS
- func (l *LPMS) HandleHLSPlay(getMasterPlaylist func(url *url.URL) (*m3u8.MasterPlaylist, error), ...)
- func (l *LPMS) HandleRTMPPlay(getStream func(url *url.URL) (stream.RTMPVideoStream, error)) error
- func (l *LPMS) HandleRTMPPublish(makeStreamID func(url *url.URL) (strmID stream.AppData, err error), ...)
- func (l *LPMS) SegmentRTMPToHLS(ctx context.Context, rs stream.RTMPVideoStream, hs stream.HLSVideoStream, ...) error
- func (l *LPMS) Start(ctx context.Context) error
- type LPMSOpts
- type RTMPSegmenter
Constants ¶
This section is empty.
Variables ¶
var RetryCount = 3
var SegmenterRetryWait = 500 * time.Millisecond
Functions ¶
This section is empty.
Types ¶
type LPMS ¶
type LPMS struct {
// contains filtered or unexported fields
}
LPMS struct is the container of all the LPMS server related tools.
func New ¶
New creates a new LPMS server object. It really just brokers everything to the components.
func (*LPMS) HandleHLSPlay ¶
func (l *LPMS) HandleHLSPlay( getMasterPlaylist func(url *url.URL) (*m3u8.MasterPlaylist, error), getMediaPlaylist func(url *url.URL) (*m3u8.MediaPlaylist, error), getSegment func(url *url.URL) ([]byte, error))
HandleHLSPlay offload to the video player
func (*LPMS) HandleRTMPPlay ¶
HandleRTMPPlay offload to the video player
func (*LPMS) HandleRTMPPublish ¶
func (l *LPMS) HandleRTMPPublish( makeStreamID func(url *url.URL) (strmID stream.AppData, err error), gotStream func(url *url.URL, rtmpStrm stream.RTMPVideoStream) (err error), endStream func(url *url.URL, rtmpStrm stream.RTMPVideoStream) error)
HandleRTMPPublish offload to the video listener. To understand how it works, look at videoListener.HandleRTMPPublish.
func (*LPMS) SegmentRTMPToHLS ¶
func (l *LPMS) SegmentRTMPToHLS(ctx context.Context, rs stream.RTMPVideoStream, hs stream.HLSVideoStream, segOptions segmenter.SegmenterOptions) error
SegmentRTMPToHLS takes a rtmp stream and re-packages it into a HLS stream with the specified segmenter options
type LPMSOpts ¶
type LPMSOpts struct { RtmpAddr string RtmpDisabled bool HttpAddr string HttpDisabled bool VodPath string WorkDir string // Pass in a custom HTTP mux. // Useful if a non-default mux needs to be used. // The caller is responsible for setting up the listener // on the mux; LPMS won't initialize it. // If set, HttpPort and HttpDisabled are ignored. HttpMux *http.ServeMux }
type RTMPSegmenter ¶
type RTMPSegmenter interface {
SegmentRTMPToHLS(ctx context.Context, rs stream.RTMPVideoStream, hs stream.HLSVideoStream, segOptions segmenter.SegmenterOptions) error
}
RTMPSegmenter describes an interface for a segmenter