Giter VIP home page Giter VIP logo

architecture-for-real-time-video-streaming-analytics's Introduction

Architecture-for-real-time-video-streaming-analytics

This is an architecture to process video in real time using Kafka as a messaging service and Spark to process frames in real time, the architecture can be summarized in the image below. img

Start Zookeeper and kafka

To simplify the tedious task of building a kafka server, we will use Docker with Kafka and Zookeeper out of the box: Go to the kafka-docker folder

$ cd kafka-docker 

Start Kafka and Zookeeper with Docker Compose

$ docker-compose -f docker-compose_local.yml up 

In the docker-compose_local.yml configuration file, the topics are defined, the url and the port through which our publisher and subscribers connected.

To stop Kafka uses

$ docker-compose stop 

for more information Apache Kafka: Docker Container refer to this post

Send frames in real time with Kafka:

We will create a subscriber that takes the webcam frames, transforms them into bytes and sends them to a topic named "distributed-video1"

python my_pub.py 

Get frames in real time with Kafka:

We create a subsriber that pulls the messages we store in the topic "distributed-video1". Spark Streaming is responsible for converting them into a DStream type that can be processed by Spark. As an example we will take the DStream (RDDs stacked over time), we will extract the frames, we will detect contained faces and we will identify the emotions of the face (check my_sub.py).

python my_sub.py 

If you have come this far you should be able to see something like this: alt text

finally we send the result to another kafka topic "final_result_topic" and we consume the result from another subscriber.

python my_sub_end.py 

References

architecture-for-real-time-video-streaming-analytics's People

Contributors

juan-csv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.