Add frontend pages, move static to www/, add resolution to tester

Frontend:
- index.html: probe device, navigate to standard/homekit by type
- standard.html: camera config, model search with multi-select
- create.html: stream URL list, custom URL input, create test session
- homekit.html: HomeKit device info, contact links, fallback to standard

Backend:
- Move static files to www/ package with embed (go2rtc pattern)
- Add initStatic() in api with FileServer
- Add width/height to test results from H264 SPS parsing
- Contribute links to gostrix.github.io with auto-filled params
This commit is contained in:
eduard256
2026-03-26 10:18:40 +00:00
parent 0ecf1eb75f
commit 74b4b61198
10 changed files with 2163 additions and 25 deletions
+2
View File
@@ -27,6 +27,8 @@ type Result struct {
Source string `json:"source"`
Screenshot string `json:"screenshot,omitempty"`
Codecs []string `json:"codecs,omitempty"`
Width uint16 `json:"width,omitempty"`
Height uint16 `json:"height,omitempty"`
LatencyMs int64 `json:"latency_ms,omitempty"`
Skipped bool `json:"skipped,omitempty"`
}
+14
View File
@@ -7,6 +7,7 @@ import (
"time"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/h264"
"github.com/AlexxIT/go2rtc/pkg/magic"
)
@@ -66,18 +67,31 @@ func testURL(s *Session, rawURL string) {
latency := time.Since(start).Milliseconds()
var codecs []string
var width, height uint16
for _, media := range prod.GetMedias() {
if media.Direction != core.DirectionRecvonly {
continue
}
for _, codec := range media.Codecs {
codecs = append(codecs, codec.Name)
// extract resolution from first video codec SPS
if width == 0 && codec.Name == core.CodecH264 {
if spsBytes, _ := h264.GetParameterSet(codec.FmtpLine); spsBytes != nil {
if sps := h264.DecodeSPS(spsBytes); sps != nil {
width, height = sps.Width(), sps.Height()
}
}
}
}
}
r := &Result{
Source: rawURL,
Codecs: codecs,
Width: width,
Height: height,
LatencyMs: latency,
}