Skip to main content

Imagiz

Fast and none blocking live video streaming over network with OpenCV and (ZMQ or TCP).

Install

pip3 install imagiz

ZMQ 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

ZMQ Server

import imagiz
import cv2

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

TCP Client

import imagiz
import cv2

vid=cv2.VideoCapture(0)
client=imagiz.TCP_Client(server_port=9990,client_name="cc1")
encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), 90]


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

TCP Server

import imagiz
import cv2

server=imagiz.TCP_Server(9990)
server.start()
while True:
    message=server.receive()
    frame=cv2.imdecode(mmessage.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
time_between_retries On TCP client show time between retries

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

Metadata

Release files for imagiz 0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imagiz 0.5
File Size Uploaded
imagiz-0.5.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imagiz 0.5
File Interpreter ABI Platform
imagiz-0.5-py2-none-any.whl Python 2 none any Details

Total release size: 8.1 kB

Release files / imagiz-0.5.tar.gz

Download URL imagiz-0.5.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
797dca55bef4d674c04837b7ac0bcd5eb2c324270bdc0896ecc051b595614649
BLAKE2b-256 checksum
How to use checksums
5da51c12506481637f785568ee9981bdf3b5a4e6c87a347f91cc672f11932908
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.9

Release files / imagiz-0.5-py2-none-any.whl

Download URL imagiz-0.5-py2-none-any.whl
Size 4.1 kB
Tags Python 2
SHA-256 checksum
How to use checksums
a6d5d01beda48cbfbdf5f67eb0dc8408c641ef5c4d8ded3a31e9019b39c8d9f1
BLAKE2b-256 checksum
How to use checksums
eac3b61bb285f096af74fac7e5988cee3e56de3c66df208544d97df76dc46cd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.5 This release

2 release files

0.4

2 release files

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page