w3c / wot-charter-drafts

Latest WoT Charter 2023 Draft
https://w3c.github.io/wot-charter-drafts/wot-wg-2023-draft.html
0 stars 6 forks source link

Streaming #60

Closed mmccool closed 1 year ago

mmccool commented 1 year ago
benfrancis commented 1 year ago

For the record, WebThings has a VideoProperty schema which exposes a video stream as a Property of a Thing.

For example, the ONVIF adapter for WebThings Gateway transcodes live video streams from IP cameras (using RTSP) into HLS and DASH video streams which can be rendered by web browsers and exposes them as a property which looks something like this in a Thing Description...

"properties": {
  "stream": {
    "type": null,
    "@type": "VideoProperty",
    "forms": [
      {
        "href": "/media/onvif/onvif-00626E925C7F/index.mpd",
        "contentType": "application/dash+xml"
      }
      {
        "href": "/media/onvif/onvif-00626E925C7F/master.m3u8",
        "contentType": "application/vnd.apple.mpegurl"
      }
    ]
  }
}

Server-Sent Events is arguably a streaming protocol over HTTP (using the text/event-stream content type), which we use for property and event affordances, e.g.

  "events": {
    "overheated": {
      "title": "Overheated",
      "@type": "OverheatedEvent",
      "data": {
        "type": "number",
        "unit": "degree celsius"
      },
      "description": "The lamp has exceeded its safe operating temperature",
      "forms": [{
        "href": "events/overheated",
        "subprotocol": "sse"
      }]
    }
  }

The ONVIF adapter also supports PTZ control of cameras and the Chromecast adapter supports remote control of TVs.

My point is that a lot may already be possible without necessarily needing to add new affordance or operation types.

Caveat: WebThings achieves a lot of this by bridging to web native protocols rather than attempting to directly describe non-web protocols. There may be additional requirements for describing certain protocols directly using protocol binding templates.

mmccool commented 1 year ago

I think this does not have to go into the charter it can go into the "details" document under new protocols. But it MAY also need some new TD features, e.g. a subprotocol.