abhiTronix / vidgear

A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features :fire:
https://abhitronix.github.io/vidgear
Apache License 2.0
3.35k stars 253 forks source link

Enhancement: Real-Time Video Frame Transferring over the network through Messaging #30

Closed abhiTronix closed 5 years ago

abhiTronix commented 5 years ago

Real-Time Video Frame Transferring over the network through Messaging

Messaging

PatternHierarchy

Messaging makes applications loosely coupled by communicating asynchronously, which also makes the communication more reliable because the two applications do not have to be running at the same time. Messaging makes the messaging system responsible for transferring data from one application to another, so the applications can focus on what data they need to share but not worry so much about how to share it.

Message Oriented protocols

Message Oriented protocols send data in distinct chunks or groups. The receiver of data can determine where one message ends and another begins. Message protocols are usually built over streams but there is one layer in between which takes care to separate each logical part from another. It parses input stream for you and gives you result only when the whole dataset arrives and not all states in between.

Available Resources

  1. MQTT - Mosquitto is a lightweight MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol broker messaging library. It works on top of the TCP/IP protocol. It is designed for connections with remote locations where a "small code footprint" is required or the network bandwidth is limited. The publish-subscribe messaging pattern requires a message broker.

  2. ZeroMQ (also spelled ØMQ, 0MQ or ZMQ) is a high-performance asynchronous brokerless messaging library, aimed at use in distributed or concurrent applications. It provides a message queue, but unlike message-oriented middleware, a ZeroMQ system can run without a dedicated message broker.

Since ZeroMQ outperformed MQTT in various tests and it's well-documented as well. I decided to go with ZeroMQ for messaging implementation in vidgear.

Goal

Our goal is to implement real-time video frames transferring over the network in vidgear by implementing a high-level wrapper around PyZmQ that contains Python bindings for ZeroMQ. This wrapper will provide both read and write functionality and read function will be multi-threaded for high-speed frame capturing with minimum latency and memory constraints.

TODO

abhiTronix commented 5 years ago

Successfully resolved in PR #31 and merged in commit 44b16de622b994e55599701e20734bc489699e69