Documentation
¶
Overview ¶
Package frames serves a stream's access units over HTTP as length-prefixed records, for low-latency clients that feed a hardware decoder directly. No container or RTP; payloads are Annex B with parameter sets inline.
Record layout, big-endian, 20 bytes then payload:
0 "RF" magic 2 u8 version, 1 3 u8 kind: 1 keyframe, 2 inter frame, 3 AAC 4 u8 codec: 1 H264, 2 H265, 3 AAC 5 u8 reserved 6 u16 width, 0 if not yet known 8 u16 height, 0 if not yet known 10 u32 camera microseconds (wraps every 71.6 minutes) 14 u32 payload length 18 u16 server send time, milliseconds since the epoch mod 65536
New subscribers start at a keyframe. A subscriber that falls behind skips to the next keyframe. Nothing here blocks the camera goroutine.
Index ¶
Constants ¶
const ( HeaderLen = 20 Version = 1 KindKey = 1 KindInter = 2 KindAAC = 3 CodecH264 = 1 CodecH265 = 2 CodecAAC = 3 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server holds the feeds and serves them at "/<path>.frames".
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream is one camera stream's feed. It implements stream.FrameSink and stream.ConnectionSink.