Skip to main content

Receiving video stream from multiple cameras (usb/ip) for further processing

Project description

📝 About the project

A system for simultaneous viewing and processing of streams from multiple cameras (USB/IP) with the ability to integrate into computer vision.

🚀 Features

  • Support for USB and IP cameras (via RTSP)
  • Automatic reconnection in case of connection failure
  • Customizable camera parameters (resolution, FPS)
  • Multithreaded frame processing
  • Flexible callback system for video processing
  • Ready-to-use GUI for viewing streams
  • Configuration via constructor parameters

⚙️ Installation

pip install omniview

🛠️ Usage

🔌 Basic example for USB cameras

from omniview.managers import USBCameraManager


def frame_callback(camera_id, frame):
    # Your framing
    pass


if __name__ == "__main__":
    manager = USBCameraManager(
        show_gui=True,
        max_cameras=4,
        frame_callback=frame_callback
    )
    try:
        manager.start()
    except KeyboardInterrupt:
        manager.stop()

🌐 Basic example for IP cameras

from omniview.managers import IPCameraManager


def frame_callback(camera_id, frame):
    # Your framing
    pass


if __name__ == "__main__":
    manager = IPCameraManager(
        show_gui=True,
        rtsp_urls=[
            "rtsp://admin:12345@192.168.0.1:9090",
        ],
        max_cameras=4,
        frame_callback=frame_callback
    )
    try:
        manager.start()
    except KeyboardInterrupt:
        manager.stop()

📚 API

Main methods:

  • start() - starts the camera manager (blocking call)
  • stop() - stops all threads correctly

Class USBCameraManager

Designer Parameters:

Parameter Type Default Description
show_gui bool True Show video windows
show_camera_id bool False Adds a caption with the camera ID to the frame
max_cameras int 10 Max. number of cameras
frame_width int 640 frame width
frame_height int 480 frame height
fps int 30 target FPS
min_uptime float 5.0 Min. uptime (sec)
frame_callback function None Callback for frame processing
exit_keys tuple (ord('q'),27) exit keys
sequential_mode bool False Method to show the cameras one by one
switch_interval float 5.0 The time after which the cameras will change. Only works if sequential_mode is selected

Class IPCameraManager

Builder parameters (Same as USBCameraManager, but with an addition):

Parameter Type Default Description
rtsp_urls list[str] [] List of RTSP URLs

🤝 Project Development

Welcome:

  • Bug reports
  • Pull requests
  • Ideas for improvement
  • Usage examples

📄 License

The project is distributed under the GNU GPL v3 license. See the LICENSE file for details.

Project details


Download files

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

Source Distribution

omniview-1.1.0.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omniview-1.1.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file omniview-1.1.0.tar.gz.

File metadata

  • Download URL: omniview-1.1.0.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for omniview-1.1.0.tar.gz
Algorithm Hash digest
SHA256 2a74aec50b8161c5dc58961a83346033401dbdbddc68873de89b3ff0d15bd2a5
MD5 a713d5790f3a33b1c49629846389db00
BLAKE2b-256 ed0fe504a8ef2de6cfaf5be02b8fc6eb34bdd009f729b02be0f5682cf2a7f57f

See more details on using hashes here.

File details

Details for the file omniview-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: omniview-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for omniview-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0088ede0a83be35913a30dc9cb0a573131de3a78af7c93becc2d75b68f6f6e22
MD5 b5b24d1c82e8e8888a2be85dcf8e7b65
BLAKE2b-256 446f6c16948faf8911d883a1fff88589a1197bc8c079a87ddf4a40be4e8be63b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page