Milestone IP Integration

Overview

During an internship at ASELSAN, I integrated Milestone’s Video Management System (VMS) into a custom security infrastructure. The official C# and C++ SDKs proved incompatible with the target environment, so I built a Python library from scratch using Milestone’s IP protocol documentation, using Wireshark to debug communication issues. The result is a modular library and PyQt5 GUI that handles authentication, camera discovery, and real-time video streaming over TCP without any dependency on the official SDK.


Technologies: Python (Zeep, requests, socket, threading), WSDL/SOAP, TCP/IP (port 7563), XML, OpenCV (cv2.imdecode), PyQt5, JPEG marker parsing, Wireshark.

  • Integration Method Selection:
    • Component integration with Milestone’s C# SDK failed due to hidden function bodies and Java incompatibility.
    • C++ SDK attempt was abandoned after unresolved dependency conflicts.
    • Chose IP protocol integration to gain full control by manually crafting messages.
  • Authentication & Configuration:
    • Parsed WSDL services (SOAP actions) to perform HTTP-Basic login and retrieve a 4-hour authentication token via Python Zeep.
    • Called LoginGetConfiguration to extract camera GUIDs for downstream TCP connections.
  • TCP Socket Communication:
    • Established a persistent TCP socket to Milestone’s Image Server on port 7563.
    • Constructed and sent <connect>, <live>, and <stop> XML messages by hand, adhering to Milestone’s IP protocol.
  • Real-Time Video Frame Extraction:
    • Streamed continuous data blobs, identified JPEG SOI (0xFFD8)/EOI (0xFFD9) markers to segment individual frames.
    • Decoded each frame using OpenCV’s imdecode for display.
GUI Design
Figure: JPEG Image Byte Array
  • Concurrency for Low Latency:
    • Used Python multithreading to separate network I/O, frame decoding, and GUI updates, preventing queue backlogs and ensuring smooth playback
  • GUI Development:
    • Built a PyQt5 interface to input server IP, authenticate, list cameras, and control live video (play/stop).
    • Addressed thread cleanup and backlog issues when toggling the live stream
GUI Design
Figure: Simple GUI design to Display Video and Manage HTTP Communication

Outcome: Delivered a modular Python library and user-friendly GUI capable of real-time IP-based video.