Skip to main content

Live video streaming over network with OpenCV and ZMQ

Project description

imagiz

Fast and none blocking live video streaming over network with OpenCV and ZMQ

Install

pip3 install imagiz

Client

import imagiz
import cv2


client=imagiz.Client("cc1",server_ip="localhost")
vid=cv2.VideoCapture(0)
encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), 90]

while True:
    r,frame=vid.read()
    if r:
        r, image = cv2.imencode('.jpg', frame, encode_param)
        client.send(image)
    else:
        break

Server

import imagiz

server=imagiz.Server()
while True:
    message=server.recive()
    frame=cv2.imdecode(message.image,1)
    cv2.imshow("",frame)
    cv2.waitKey(1)

Client Options

Name Description
client_name Name of client
server_ip Ip of server default value is localhost
server_port Port of server default value is 5555
request_timeout how many milliseconds wait to resend image again
request_retries how many time retries to send an image before client exit
generate_image_id image_id is unique and ordered id that you can use for save data on disk or db also it is show time of image sended by client

Server Options

Name Description
Port Port of server
listener Number of listening threads.default value is 10

Message Class

Name Description
image Byte of image
client_name Name of client
image_id If disable generate_image_id it will be 0

Project details


Release history Release notifications

This version

0.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for imagiz, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size imagiz-0.2-py3-none-any.whl (3.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size imagiz-0.2.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page