Die MSECM Video Judge Anwendung enthält eine integrierte REST API, die externen Zugriff auf Aufnahmen, Marker und Protokolle ermöglicht.
http://localhost:5080/api
Die automatisch generierte OpenAPI-Spezifikation ist verfügbar unter:
http://localhost:5080/openapi/v1.json
Verwaltet Videoaufnahmen (Snapshots).
GET /api/snapshots
Antwort:
[
{
"id": 1,
"timeStamp": "2026-03-15T14:30:00",
"event": "S",
"eventNr": 5,
"heatNr": 2,
"laneNr": null,
"lapNr": null,
"filePath": "C:\\Videos\\Ev05_Heat02_S_2026-03-15_14-30-00.avi",
"preBufferDuration": "00:00:10",
"postCaptureDuration": "00:00:10",
"createdAt": "2026-03-15T14:30:20",
"totalFrames": 600
}
]
GET /api/snapshots/{id}
| Parameter | Typ | Beschreibung |
|---|---|---|
| id | int | Snapshot-ID |
GET /api/snapshots/{id}/stream
Unterstützt HTTP Range Requests für Seeking.
Request Headers (optional):
Range: bytes=0-1048575
Response:
GET /api/snapshots/{id}/info
Antwort:
{
"snapshotId": 1,
"fileName": "Ev05_Heat02_S_2026-03-15_14-30-00.avi",
"fileSize": 52428800,
"contentType": "video/x-msvideo",
"totalFrames": 600,
"preBufferDuration": "00:00:10",
"postCaptureDuration": "00:00:10",
"event": "S",
"eventNr": 5,
"heatNr": 2,
"laneNr": null,
"lapNr": null,
"timeStamp": "2026-03-15T14:30:00",
"streamUrl": "/api/snapshots/1/stream"
}
GET /api/snapshots/list
Gibt eine kompakte Liste aller Snapshots mit Stream-URLs zurück.
GET /api/snapshots/event/{eventType}
| Parameter | Typ | Werte |
|---|---|---|
| eventType | char | S=Start, I=Intermediate, A=Finish, D=Reaction |
GET /api/snapshots/eventnr/{eventNr}
GET /api/snapshots/heat/{eventNr}/{heatNr}
GET /api/snapshots/lane/{eventNr}/{heatNr}/{laneNr}
GET /api/snapshots/range?from={from}&to={to}
| Parameter | Typ | Format |
|---|---|---|
| from | DateTime | ISO 8601 (z.B. 2026-03-15T00:00:00) |
| to | DateTime | ISO 8601 (z.B. 2026-03-15T23:59:59) |
GET /api/snapshots/recent/{count}
| Parameter | Typ | Standard |
|---|---|---|
| count | int | 100 |
GET /api/snapshots/count
Antwort:
42
Verwaltet Marker (Markierungen in Videos).
GET /api/markers
Antwort:
[
{
"id": 1,
"snapShotDataId": 1,
"frameNumber": 150,
"createdAt": "2026-03-15T14:35:00",
"name": "Wandberührung",
"note": "Schwimmer berührte bei Frame 150"
}
]
GET /api/markers/{id}
GET /api/markers/snapshot/{snapShotId}
GET /api/markers/search?name={name}
| Parameter | Typ | Beschreibung |
|---|---|---|
| name | string | Suchbegriff für Marker-Name |
GET /api/markers/range?from={from}&to={to}
GET /api/markers/recent/{count}
GET /api/markers/count
GET /api/markers/count/snapshot/{snapShotId}
POST /api/markers
Content-Type: application/json
Request Body:
{
"snapShotDataId": 1,
"frameNumber": 150,
"name": "Wandberührung",
"note": "Optionale Notiz"
}
Antwort: 201 Created
{
"id": 2,
"snapShotDataId": 1,
"frameNumber": 150,
"createdAt": "2026-03-15T14:40:00",
"name": "Wandberührung",
"note": "Optionale Notiz"
}
PUT /api/markers/{id}
Content-Type: application/json
Request Body:
{
"frameNumber": 155,
"name": "Wandberührung (korrigiert)",
"note": "Aktualisierte Notiz"
}
DELETE /api/markers/{id}
Antwort: 204 No Content
Zugriff auf Anwendungsprotokolle.
GET /api/logs
Antwort:
[
{
"id": 1,
"timestamp": "2026-03-15T14:30:00",
"type": "General",
"message": "Application started"
}
]
GET /api/logs/{id}
GET /api/logs/type/{type}
| Typ | Beschreibung |
|---|---|
| Serial | Serielle Verbindungsereignisse |
| SerialMessage | Empfangene Timing-Nachrichten |
| CAM | Kameraoperationen |
| General | Allgemeine Ereignisse |
| Error | Fehlermeldungen |
| DB | Datenbankoperationen |
GET /api/logs/range?from={from}&to={to}
GET /api/logs/recent/{count}
GET /api/logs/count
{
"error": "Snapshot not found"
}
{
"error": "Invalid request parameters"
}
{
"error": "Internal server error"
}
Snapshots auflisten:
curl http://localhost:5080/api/snapshots
Video herunterladen:
curl -o video.avi http://localhost:5080/api/snapshots/1/stream
Marker erstellen:
curl -X POST http://localhost:5080/api/markers \
-H "Content-Type: application/json" \
-d '{"snapShotDataId":1,"frameNumber":150,"name":"Zielankunft"}'
// Snapshots abrufen
const response = await fetch('http://localhost:5080/api/snapshots');
const snapshots = await response.json();
// Video im HTML5-Player abspielen
const video = document.getElementById('player');
video.src = 'http://localhost:5080/api/snapshots/1/stream';
video.play();
// Marker erstellen
await fetch('http://localhost:5080/api/markers', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
snapShotDataId: 1,
frameNumber: 150,
name: 'Wandberührung'
})
});
using var client = new HttpClient();
client.BaseAddress = new Uri("http://localhost:5080");
// Snapshots abrufen
var snapshots = await client.GetFromJsonAsync<List<SnapShotData>>("api/snapshots");
// Marker erstellen
var marker = new CreateMarkerDto
{
SnapShotDataId = 1,
FrameNumber = 150,
Name = "Wandberührung"
};
await client.PostAsJsonAsync("api/markers", marker);
Um die API im Netzwerk verfügbar zu machen:
Verwenden Sie die IP-Adresse des Computers anstelle von localhost:
http://192.168.1.100:5080/api/snapshots
IP-Adresse ermitteln:
ipconfig