moonfire-nvr icon indicating copy to clipboard operation
moonfire-nvr copied to clipboard

event stream

Open scottlamb opened this issue 6 years ago • 1 comments

I'd like to have an API endpoint which streams events as they happen, such as:

  • segment of recording was deleted
  • segment of recording was created. (with an additional flag to indicate the next segment of recording for that stream is in progress, so you can assume it has video from then to approximately now.)
  • a signal was changed

With this, the frontend UI could update itself without requiring the user to hit refresh.

It could be a ~~multipart/mixed~~ WebSockets stream (like the live view) of JSON events that happened in the current "open", each with a sequence number.

Other API calls like /api/?days=true or /api/camera/<uuid>/<stream>/recordings would have a HTTP header showing the matching sequence number. The frontend could use those together to compute the contents at any later point.

scottlamb avatar Mar 09 '18 08:03 scottlamb

Streaming type APIs work best with a web socket approach.

On Mar 9, 2018, at 00:39, Scott Lamb <[email protected] mailto:[email protected]> wrote:

I'd like to have an API endpoint which streams events as they happen, such as:

segment of recording was deleted segment of recording was created. (with an additional flag to indicate the next segment of recording for that stream is in progress, so you can assume it has video from then to approximately now.) a signal was changed With this, the frontend UI could update itself without requiring the user to hit refresh.

It could be a multipart/mixed stream of JSON events that happened in the current "open", each with a sequence number. Other API calls like /api/?days=true or /api/camera///recordings would have a HTTP header showing the matching sequence number. The frontend could use those together to compute the contents at any later point.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/scottlamb/moonfire-nvr/issues/40, or mute the thread https://github.com/notifications/unsubscribe-auth/ABRU1QZ4ao0Bo9CWdnEVjDXWiZ-ECiuPks5tcj-rgaJpZM4Sj7Rv.

dolfs avatar Mar 09 '18 09:03 dolfs