Antares is monitoring system for HLS and MPEG-DASH. This program is written by golang.
Antares monitors any HLS/MPEG-DASH streams and outputs inspection reports. You can use prepared command or Go interfaces.
go install github.com/abema/antares/v2@latestantares \
-hls.noEndlist \
-hls.playlistType omitted \
-export \
-export.meta \
-segment.maxBandwidth 500000 \
"http://localhost/index.m3u8"antares -hYou can use core.Monitor to monitor your live stream as follows:
config := core.NewConfig("http://localhost/index.m3u8", core.StreamTypeHLS)
config.HLS.Inspectors = []core.HLSInspector{
hls.NewSpeedInspector(),
hls.NewVariantsSyncInspector(),
}
core.NewMonitor(config)manager.Manager manages multiple monitors and provides batch update interface.
manager := manager.NewManager(&manager.Config{})
for range time.Tick(time.Minute) {
configs := make(map[string]*core.Config)
for _, stream := range listMyCurrentStreams() {
config := core.NewConfig(stream.URL, stream.StreamType)
:
configs[stream.ID] = config
}
added, removed := manager.Batch(configs)
log.Println("added", added)
log.Println("removed:", removed)
}Inspector inspects manifest and segment files.
For example, SpeedInspector checks whether addition speed of segment is appropriate as compared to real time.
Some inspectors are implemented in inspectors/hls package and inspectors/dash package for each aims.
Implementing hls.Inspector or dash.Inspector interface, you can add your any inspectors to Monitor.
You can set handlers to handle downloaded files, inspection reports, and etc.
And adapters package has some useful handlers.
config.OnReport = core.MergeOnReportHandlers(
adapters.ReportLogger(&adapters.ReportLogConfig{JSON: true}, os.Stdout),
adapters.Alarm(&adapters.AlarmConfig{
OnAlarm : func(reports core.Reports) { /* start alarm */ },
OnRecover : func(reports core.Reports) { /* stop alarm */ },
Window : 10,
AlarmIfErrorGreaterThanEqual : 2,
RecoverIfInfoGreaterThanEqual: 10,
}),
func(reports core.Reports) { /* send metrics */ },
)- Live
- Event
- On-demand
- Byte range
- #EXT-X-MAP
- LHLS
- Decryption
- I-frame-only playlists
- Live
- Static
- SegmentTimeline
- Open-Ended SegmentTimeline (S@r = -1)
- SegmentBase
- SegmentList
- Only SegmentTemplate (Without SegmentTimeline/SegmentList)
- Multi-Period
- Location
- Decryption
Identifiers for URL templates:
- $$
-
$RepresentationID$ -
$Number$ -
$Bandwidth$ -
$Time$ -
$SubNumber$ - IEEE 1003.1 Format Tag