What Am I Building Next !? (Hint: Video Streaming + Cloud + ML + WebRtc Streaming)

Guard Dog AI

Github: https://github.com/hamdaankhalid/guard-dog

The source code is as usual available ;)


I spent the last few months working on a "hacky" implementation of Raft, and then writing a distributed hash-map with partitioning across nodes and rebalancing. Having completed those projects I ran into an "engineers-block", I didn't know what to build. That was until I had my lates product idea come to mind.

Every now and then I think about how cool it would be to have one of those smart security cameras for my house, something clicked and I realized that I already have devices lying around... why not write software that let's you turn any camera connected to the internet into a smart security camera, on-top of that let users run their own models on it for things like motion detection and object detection. All videos can be viewed later as well as viewed in real time too!



I listed the following requirements for my MVP and I began working on them:

  • User system (the regular, login, registration, logout, and authentication guards)
  • Camera Client -> Cloud storage (ability for the camera to send data and have it stored on the cloud , and Azure in particular considering I'm joining Microsoft :) .
  • Camera Client -> User Client (Peer to peer webrtc based live video and audio streaming)
  • Ability for user Users to add ML models they would like to run and have them run on top of the incoming video stream.



I decided the nature of the problem justified the use of Microservices! The design decision came from the following reasons:

  • Some languages are better for I/O tasks vs some are better for CPU intensive tasks, this meant that I could build services with languages that are best suited for the task in my opinion.
  • Some languages and frameworks do things better than other, this would again let me use prebuilt systems like Authentication systems I wrote before straight into my Microservice environment with a plug and play setting.
  • I could totally see services being scaled differently, as Video Processing services would take a lot more hits than the authentication service.

Independent scalability and flexibility of choosing the best tool for the job made this the right choice for me.



Tech Stack:

  • Inter-Service Communication: Rest API's for synchronous communication and Kafka for async communication.
  • Frontend: Angular + Typescript
  • Authentication System: Typescript + Express + mongoDb (Recycling this from a previous project I already built!)
  • Video Stream Processing & Storage: Java + Spring Boot + Postgres + Azure Blob Store
  • ML services: Python ? (Undecided might go with Golang for some of this!)
  • Infrastructure: Docker & Kubernetes


I already built out a good amount of the frontend, the authentication system, and just as of today (August 3rd) figured out how I can send streams in a batch for processing and storing on the cloud! I will be documenting the rest of the application as I build it out. My next update will be for finishing the Client -> Cloud video storage and processing.

Comments

Commenter: t

This looks super cool!!

Add a comment: