revmischa / cloudcam

IP camera surveillance management system using AWS IoT with support for Axis cameras.
Other
74 stars 15 forks source link

Investigate recording options #11

Open revmischa opened 6 years ago

revmischa commented 6 years ago

Goal: come up with a plan of how we will implement video and event recording, archiving, and playback.

Some people may want to stream the cams to the cloud 24/7 (maybe at very low bitrate unless someone's viewing), but some will want to buffer locally and some won't have enough bandwidth.

I believe Axis cameras can do two encoded streams at once with different bitrates, so in some setups maybe a camera is always streaming to the recording server (Janus or ?) at a very low bitrate, whereas the higher-bitrate encoder could be used when someone is viewing live.

A way to estimate how much storage and bandwidth a recording will use will be very important; storage of continuous video recordings is considerable.

An option to record only when motion is detected will be key. I believe Axis cams support this built-in. Not sure if we want to handle that on the server side, most likely no.

Consider use cases of people with one camera vs many camera, upstream bandwidth, local vs cloud recording server, Janus support, Axis support, local buffering, space/quality long term storage tradeoffs, AWS Glacier for long-term archiving, "events" (see Axis docs), auto-start/stop based on motion, how playback will work.

exp commented 6 years ago

I wonder if you could piggyback on HLS' mechanism. It has multiple quality levels, seeking and loves its little chunks of video which you can store anywhere.

My .264 IP cameras have capture and idle framerates but not bitrates, they are otherwise CBR. Do you have a test set of hardware? I have a fairly high end Samsung IP cam now which is hilariously bad, but has unsigned firmware of course.

revmischa commented 6 years ago

I have cameras and I'm going to get @someone--else one. Specs are available online for Axis cams, I am pretty sure they have a "target bitrate" option for both encoders. HLS is currently not involved or supported anywhere in the current architecture

exp commented 6 years ago

How do you plan to playback non-live video? Seeking to that on the server side and using WebRTC etc seems a little superfluous.

someone--else commented 6 years ago

Another consideration: packet loss between camera and Janus gateways.

Current setup assumes RTP over UDP for camera -> Janus link and RTP doesn't, in its original form, support re-transmission of lost packets (there are extensions what do, however the existence of software support for this both on camera and Janus side is unclear).

Packet losses like that, especially if augmented by Janus being able ask the camera to issue a new key-frame immediately, are fine for low-latency live streaming, however for recording (which is not latency-sensitive) it would be preferable to always have a complete stream where all lost packets were re-transmitted eventually