Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsMoqMINamespace ¶ added in v0.8.0
IsMoqMINamespace reports whether the given namespace tuple identifies a moq-mi (MoQ Media Interop) namespace, by convention on the first segment.
Types ¶
type CENC ¶
type CENC struct {
Key []byte
DecryptInfo map[string]mp4.DecryptInfo // keyed by track name
}
CENC holds decryption state for encrypted tracks.
type CmafMux ¶
type CmafMux struct {
// contains filtered or unexported fields
}
CmafMux multiplexes video and audio CMAF tracks into a single output.
func NewCmafMux ¶
NewCmafMux creates a new CMAF multiplexer writing to w.
type Handler ¶
type Handler struct {
Namespace []string
Outs map[string]io.Writer
Logfh io.Writer
VideoName string
AudioName string
SubsName string
UseFetch bool
AcceptAny bool // Accept any announced namespace
Discover bool // Discovery mode: list namespaces and exit
CatalogTrack string // Catalog track name (default "catalog")
// contains filtered or unexported fields
}
Handler handles MoQ subscriber sessions. It subscribes to a catalog, selects tracks, and reads media data.
func (*Handler) RunWithConn ¶
func (h *Handler) RunWithConn(ctx context.Context, conn moqtransport.Connection) error
RunWithConn sets up the mux (if Outs["mux"] is set) and runs the subscriber session on the given connection.
type LOCAACWriter ¶ added in v0.8.0
type LOCAACWriter struct {
W io.Writer
SampleRate int // from catalog samplerate field
ChannelConfig byte // from catalog channelConfig field
ObjectType byte // from codec string "mp4a.40.N" -> N (must be 2 / AAC-LC)
}
LOCAACWriter converts LOC AAC objects (raw AAC frames) to ADTS-framed AAC. The resulting output is playable with: ffplay file.aac
Only AAC-LC (mp4a.40.2) is supported — ADTS header construction via mp4ff/aac rejects other object types.
func NewLOCAACWriter ¶ added in v0.8.0
func NewLOCAACWriter(w io.Writer, codec string, sampleRate int, channelConfig string) (*LOCAACWriter, error)
NewLOCAACWriter creates a LOCAACWriter from catalog track fields. codec is e.g. "mp4a.40.2", sampleRate e.g. 44100, channelConfig e.g. "2". Returns an error if the codec is not AAC-LC.
func (*LOCAACWriter) Write ¶ added in v0.8.0
func (lw *LOCAACWriter) Write(payload []byte) error
Write prepends a 7-byte ADTS header to the raw AAC frame and writes it.
type LOCOpusWriter ¶ added in v0.8.0
LOCOpusWriter writes raw LOC Opus packets directly. Raw Opus packets without a container are not directly playable but useful for debugging.
func (*LOCOpusWriter) Write ¶ added in v0.8.0
func (lw *LOCOpusWriter) Write(payload []byte) error
Write writes the raw Opus payload.
type LOCVideoWriter ¶ added in v0.8.0
LOCVideoWriter converts LOC AVC video objects (length-prefixed NALUs) to AnnexB H.264 format by replacing 4-byte length prefixes with start codes. The resulting output is playable with: ffplay -f h264 file.h264
func (*LOCVideoWriter) Write ¶ added in v0.8.0
func (lw *LOCVideoWriter) Write(payload []byte) error
Write converts a LOC AVC payload to AnnexB format and writes it.