rocket-welder-sdk 0.0.0.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,497 @@
1
+ Metadata-Version: 2.4
2
+ Name: rocket-welder-sdk
3
+ Version: 0.0.0.dev0
4
+ Summary: High-performance video streaming SDK for RocketWelder services using ZeroBuffer IPC
5
+ Home-page: https://github.com/modelingevolution/rocket-welder-sdk
6
+ Author: ModelingEvolution
7
+ Author-email: ModelingEvolution <info@modelingevolution.com>
8
+ Maintainer-email: ModelingEvolution <info@modelingevolution.com>
9
+ License: MIT
10
+ Project-URL: Homepage, https://github.com/modelingevolution/rocket-welder-sdk
11
+ Project-URL: Repository, https://github.com/modelingevolution/rocket-welder-sdk.git
12
+ Project-URL: Issues, https://github.com/modelingevolution/rocket-welder-sdk/issues
13
+ Keywords: video,streaming,gstreamer,ipc,shared-memory,zerobuffer,computer-vision
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Multimedia :: Video
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Operating System :: OS Independent
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: >=3.8
27
+ Description-Content-Type: text/markdown
28
+ Requires-Dist: numpy>=1.20.0
29
+ Requires-Dist: opencv-python>=4.5.0
30
+ Requires-Dist: zerobuffer-ipc>=1.1.17
31
+ Requires-Dist: pydantic>=2.5.0
32
+ Provides-Extra: dev
33
+ Requires-Dist: pytest>=7.0; extra == "dev"
34
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
35
+ Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
36
+ Requires-Dist: black>=22.0; extra == "dev"
37
+ Requires-Dist: mypy>=1.0; extra == "dev"
38
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
39
+ Requires-Dist: types-setuptools; extra == "dev"
40
+ Dynamic: author
41
+ Dynamic: home-page
42
+ Dynamic: requires-python
43
+
44
+ # Rocket Welder SDK
45
+
46
+ [![NuGet](https://img.shields.io/nuget/v/RocketWelder.SDK.svg)](https://www.nuget.org/packages/RocketWelder.SDK/)
47
+ [![PyPI](https://img.shields.io/pypi/v/rocket-welder-sdk.svg)](https://pypi.org/project/rocket-welder-sdk/)
48
+ [![vcpkg](https://img.shields.io/badge/vcpkg-rocket--welder--sdk-blue)](https://github.com/modelingevolution/rocket-welder-sdk-vcpkg-registry)
49
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
50
+
51
+ Multi-language client libraries for interacting with RocketWelder video streaming services.
52
+
53
+ ## Overview
54
+
55
+ The Rocket Welder SDK provides high-performance video streaming capabilities for containerized applications. It offers native client libraries in C++, C#, and Python, enabling seamless integration with RocketWelder video streaming pipelines.
56
+
57
+ ## Features
58
+
59
+ - **High Performance**: Optimized for minimal latency and maximum throughput
60
+ - **Multi-Language Support**: Native libraries for C++, C#, and Python
61
+ - **Protocol Flexibility**: Support for multiple streaming protocols via connection strings
62
+ - **Container-Ready**: Designed for Docker/Kubernetes deployments
63
+ - **Simple Integration**: Easy-to-use API with minimal configuration
64
+
65
+ ## Client Libraries
66
+
67
+ | Language | Package Manager | Package Name |
68
+ |----------|----------------|--------------|
69
+ | C++ | vcpkg | rocket-welder-sdk |
70
+ | C# | NuGet | RocketWelder.SDK |
71
+ | Python | pip | rocket-welder-sdk |
72
+
73
+ ## Connection String Format
74
+
75
+ The SDK uses URI-style connection strings to specify data sources and protocols:
76
+
77
+ ```
78
+ protocol://[host[:port]]/[path][?param1=value1&param2=value2]
79
+ ```
80
+
81
+ ### Supported Protocols
82
+
83
+ #### Shared Memory (High-Performance Local)
84
+ ```
85
+ shm://<buffer_name>
86
+ shm://<buffer_name>?buffer_size=10MB&metadata_size=1024KB
87
+ shm://<buffer_name>?mode=duplex&buffer_size=10MB
88
+ ```
89
+
90
+ **Optional Parameters:**
91
+ - `mode`: Communication mode (`duplex` for bidirectional/mutable, `oneway` for one-way communication; default: `duplex`)
92
+ - `buffer_size`: Size of the data buffer (default: 20MB, supports units: B, KB, MB, GB)
93
+ - `metadata_size`: Size of the metadata buffer (default: 4KB, supports units: B, KB, MB)
94
+
95
+ #### MJPEG over HTTP
96
+ ```
97
+ mjpeg+http://192.168.1.100:8080
98
+ mjpeg+http://camera.local:8080
99
+ ```
100
+
101
+ #### MJPEG over TCP
102
+ ```
103
+ mjpeg+tcp://192.168.1.100:5000
104
+ mjpeg+tcp://camera.local:5000
105
+ ```
106
+
107
+ ### Environment Variable
108
+
109
+ When deployed in a Rocket Welder container, the connection string is provided via:
110
+ ```bash
111
+ CONNECTION_STRING=shm://camera_feed?buffer_size=20MB&metadata_size=4KB
112
+ ```
113
+
114
+ ## Installation
115
+
116
+ ### C++ with vcpkg
117
+
118
+ Configure the custom registry in your `vcpkg-configuration.json`:
119
+ ```json
120
+ {
121
+ "registries": [
122
+ {
123
+ "kind": "git",
124
+ "repository": "https://github.com/modelingevolution/rocket-welder-sdk-vcpkg-registry",
125
+ "baseline": "YOUR_BASELINE_HERE",
126
+ "packages": ["rocket-welder-sdk"]
127
+ }
128
+ ]
129
+ }
130
+ ```
131
+
132
+ Then install:
133
+ ```bash
134
+ # Install via vcpkg
135
+ vcpkg install rocket-welder-sdk
136
+
137
+ # Or integrate with CMake
138
+ find_package(rocket-welder-sdk CONFIG REQUIRED)
139
+ target_link_libraries(your_app PRIVATE rocket-welder-sdk::rocket-welder-sdk)
140
+ ```
141
+
142
+ ### C# with NuGet
143
+
144
+ [![NuGet Downloads](https://img.shields.io/nuget/dt/RocketWelder.SDK.svg)](https://www.nuget.org/packages/RocketWelder.SDK/)
145
+
146
+ ```bash
147
+ # Package Manager Console
148
+ Install-Package RocketWelder.SDK
149
+
150
+ # .NET CLI
151
+ dotnet add package RocketWelder.SDK
152
+
153
+ # PackageReference in .csproj
154
+ <PackageReference Include="RocketWelder.SDK" Version="1.0.*" />
155
+ ```
156
+
157
+ ### Python with pip
158
+
159
+ [![PyPI Downloads](https://img.shields.io/pypi/dm/rocket-welder-sdk.svg)](https://pypi.org/project/rocket-welder-sdk/)
160
+
161
+ ```bash
162
+ # Install from PyPI
163
+ pip install rocket-welder-sdk
164
+
165
+ # Install with optional dependencies
166
+ pip install rocket-welder-sdk[opencv] # Includes OpenCV
167
+ pip install rocket-welder-sdk[all] # All optional dependencies
168
+
169
+ # Install specific version
170
+ pip install rocket-welder-sdk==1.0.0
171
+ ```
172
+
173
+ ## Quick Start
174
+
175
+ ### C++ Quick Start
176
+ ```cpp
177
+ #include <rocket_welder/client.hpp>
178
+
179
+ auto client = rocket_welder::Client::from_connection_string("shm://my-buffer");
180
+ client.on_frame([](cv::Mat& frame) {
181
+ // Process frame
182
+ });
183
+ client.start();
184
+ ```
185
+
186
+ ### C# Quick Start
187
+ ```csharp
188
+ using RocketWelder.SDK;
189
+
190
+ var client = RocketWelderClient.FromConnectionString("shm://my-buffer");
191
+ client.Start(frame => {
192
+ // Process frame
193
+ });
194
+ ```
195
+
196
+ ### Python Quick Start
197
+ ```python
198
+ import rocket_welder_sdk as rw
199
+
200
+ client = rw.Client.from_connection_string("shm://my-buffer")
201
+
202
+ @client.on_frame
203
+ def process(frame):
204
+ # Process frame
205
+ pass
206
+
207
+ client.start()
208
+ ```
209
+
210
+ ## Usage Examples
211
+
212
+ ### C++
213
+
214
+ ```cpp
215
+ #include <rocket_welder/client.hpp>
216
+ #include <opencv2/opencv.hpp>
217
+
218
+ int main(int argc, char* argv[]) {
219
+ // Best practice: use from() which:
220
+ // 1. Checks environment variable (CONNECTION_STRING)
221
+ // 2. Overrides with command line args if provided
222
+ auto client = rocket_welder::Client::from(argc, argv);
223
+
224
+ // Or specify connection string directly
225
+ auto client = rocket_welder::Client::from_connection_string(
226
+ "shm://camera_feed?buffer_size=20MB&metadata_size=4KB"
227
+ );
228
+
229
+ // Process frames as OpenCV Mat (mutable by default)
230
+ client.on_frame([](cv::Mat& frame) {
231
+ // Add overlay text - zero copy!
232
+ cv::putText(frame, "Processing", cv::Point(10, 30),
233
+ cv::FONT_HERSHEY_SIMPLEX, 1.0, cv::Scalar(0, 255, 0), 2);
234
+
235
+ // Add timestamp overlay
236
+ auto now = std::chrono::system_clock::now();
237
+ auto time_t = std::chrono::system_clock::to_time_t(now);
238
+ cv::putText(frame, std::ctime(&time_t), cv::Point(10, 60),
239
+ cv::FONT_HERSHEY_SIMPLEX, 0.5, cv::Scalar(255, 255, 255), 1);
240
+ });
241
+
242
+ client.start();
243
+ return 0;
244
+ }
245
+ ```
246
+
247
+ ### C#
248
+
249
+ ```csharp
250
+ using RocketWelder.SDK;
251
+ using OpenCvSharp;
252
+
253
+ class Program
254
+ {
255
+ static void Main(string[] args)
256
+ {
257
+ // Best practice: use From() which:
258
+ // 1. Checks environment variable (CONNECTION_STRING)
259
+ // 2. Overrides with command line args if provided
260
+ var client = RocketWelderClient.From(args);
261
+
262
+ // Or specify connection string directly
263
+ var client = RocketWelderClient.FromConnectionString(
264
+ "shm://camera_feed?buffer_size=20MB&metadata_size=4KB"
265
+ );
266
+
267
+ int frameCount = 0;
268
+
269
+ // Process frames as OpenCV Mat
270
+ client.Start((Mat frame) =>
271
+ {
272
+ // Add overlay text
273
+ Cv2.PutText(frame, "Processing", new Point(10, 30),
274
+ HersheyFonts.HersheySimplex, 1.0, new Scalar(0, 255, 0), 2);
275
+
276
+ // Add frame counter overlay
277
+ Cv2.PutText(frame, $"Frame: {frameCount++}", new Point(10, 60),
278
+ HersheyFonts.HersheySimplex, 0.5, new Scalar(255, 255, 255), 1);
279
+ });
280
+ }
281
+ }
282
+ ```
283
+
284
+ ### Python
285
+
286
+ ```python
287
+ import rocket_welder_sdk as rw
288
+ import cv2
289
+ import sys
290
+
291
+ # Best practice: use from_args() which:
292
+ # 1. Checks environment variable (CONNECTION_STRING)
293
+ # 2. Overrides with command line args if provided
294
+ client = rw.Client.from_args(sys.argv)
295
+
296
+ # Or specify connection string directly
297
+ client = rw.Client.from_connection_string("shm://camera_feed?buffer_size=20MB&metadata_size=4KB")
298
+
299
+ # Process frames as numpy arrays (OpenCV compatible)
300
+ @client.on_frame
301
+ def process_frame(frame: np.ndarray):
302
+ # Add overlay text - zero copy!
303
+ cv2.putText(frame, "Processing", (10, 30),
304
+ cv2.FONT_HERSHEY_SIMPLEX, 1.0, (0, 255, 0), 2)
305
+
306
+ # Add timestamp overlay
307
+ from datetime import datetime
308
+ timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
309
+ cv2.putText(frame, timestamp, (10, 60),
310
+ cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 1)
311
+
312
+ client.start()
313
+
314
+ # Or use iterator pattern
315
+ for frame in client.frames():
316
+ # Each frame is a numpy array
317
+ print(f"Received frame: {frame.shape}")
318
+ ```
319
+
320
+ ## Docker Integration
321
+
322
+ ### C++ Dockerfile
323
+
324
+ ```dockerfile
325
+ FROM ubuntu:22.04 AS builder
326
+
327
+ # Install build tools and OpenCV
328
+ RUN apt-get update && apt-get install -y \
329
+ build-essential \
330
+ cmake \
331
+ libopencv-dev
332
+
333
+ # Install Rocket Welder SDK via vcpkg
334
+ RUN vcpkg install rocket-welder-sdk
335
+
336
+ # Build your application
337
+ WORKDIR /app
338
+ COPY . .
339
+ RUN cmake . && make
340
+
341
+ FROM ubuntu:22.04
342
+ RUN apt-get update && apt-get install -y libopencv-dev
343
+ COPY --from=builder /app/my_app /usr/local/bin/
344
+ CMD ["my_app"]
345
+ ```
346
+
347
+ ### C# Dockerfile
348
+
349
+ ```dockerfile
350
+ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder
351
+
352
+ WORKDIR /app
353
+ COPY *.csproj ./
354
+ RUN dotnet restore
355
+
356
+ COPY . ./
357
+ RUN dotnet publish -c Release -o out
358
+
359
+ FROM mcr.microsoft.com/dotnet/runtime:8.0
360
+ WORKDIR /app
361
+ COPY --from=builder /app/out .
362
+ CMD ["dotnet", "MyApp.dll"]
363
+ ```
364
+
365
+ ### Python Dockerfile
366
+
367
+ ```dockerfile
368
+ FROM python:3.11-slim
369
+
370
+ # Install OpenCV and other dependencies
371
+ RUN apt-get update && apt-get install -y \
372
+ python3-opencv \
373
+ && rm -rf /var/lib/apt/lists/*
374
+
375
+ # Install Rocket Welder SDK and ML frameworks
376
+ RUN pip install --no-cache-dir \
377
+ rocket-welder-sdk \
378
+ numpy \
379
+ ultralytics # Example: YOLO
380
+
381
+ WORKDIR /app
382
+ COPY . .
383
+
384
+ CMD ["python", "app.py"]
385
+ ```
386
+
387
+ ## Protocol Details
388
+
389
+ ### Shared Memory Protocol (shm://)
390
+
391
+ High-performance local data transfer between processes:
392
+
393
+ - **Performance**: Minimal latency, maximum throughput
394
+ - **Use Cases**: Local processing, multi-container applications on same host
395
+
396
+ ### MJPEG over HTTP (mjpeg+http://)
397
+
398
+ Motion JPEG streaming over HTTP:
399
+
400
+ - **Performance**: Good balance of quality and bandwidth
401
+ - **Advantages**: Wide compatibility, firewall-friendly, browser support
402
+ - **Use Cases**: Network streaming, web applications, remote monitoring
403
+
404
+ ### MJPEG over TCP (mjpeg+tcp://)
405
+
406
+ Motion JPEG streaming over raw TCP socket:
407
+
408
+ - **Performance**: Lower latency than HTTP, less protocol overhead
409
+ - **Advantages**: Direct socket connection, minimal overhead, suitable for local networks
410
+ - **Use Cases**: Low-latency streaming, embedded systems, industrial applications
411
+
412
+ ## Building from Source
413
+
414
+ ### Prerequisites
415
+
416
+ - CMake 3.20+
417
+ - C++20 compiler
418
+ - Python 3.8+ (for Python bindings)
419
+ - .NET 6.0+ SDK (for C# bindings)
420
+ - OpenCV 4.0+ (optional, for image processing)
421
+
422
+ ### Build Instructions
423
+
424
+ ```bash
425
+ git clone https://github.com/modelingevolution/rocket-welder-sdk.git
426
+ cd rocket-welder-sdk
427
+
428
+ # Build all libraries
429
+ mkdir build && cd build
430
+ cmake ..
431
+ make -j$(nproc)
432
+
433
+ # Run tests
434
+ ctest
435
+
436
+ # Install
437
+ sudo make install
438
+ ```
439
+
440
+ ## API Reference
441
+
442
+ Detailed API documentation for each language:
443
+
444
+ - [C++ API Reference](docs/cpp-api.md)
445
+ - [C# API Reference](docs/csharp-api.md)
446
+ - [Python API Reference](docs/python-api.md)
447
+
448
+ ## Examples
449
+
450
+ See the [examples](examples/) directory for complete working examples:
451
+
452
+ - [Simple Frame Reader](examples/simple-reader/)
453
+ - [Frame Processor](examples/frame-processor/)
454
+ - [Multi-Stream Handler](examples/multi-stream/)
455
+ - [Performance Benchmark](examples/benchmark/)
456
+
457
+ ## Contributing
458
+
459
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
460
+
461
+ ## License
462
+
463
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
464
+
465
+ ## Support
466
+
467
+ - **Issues**: [GitHub Issues](https://github.com/modelingevolution/rocket-welder-sdk/issues)
468
+ - **Discussions**: [GitHub Discussions](https://github.com/modelingevolution/rocket-welder-sdk/discussions)
469
+ - **Documentation**: [https://docs.rocket-welder.io](https://docs.rocket-welder.io)
470
+
471
+ ## Technical Details
472
+
473
+ ### GStreamer Integration
474
+
475
+ The SDK integrates with GStreamer pipelines through specialized elements:
476
+ - **zerosink**: Simple sink element for writing video frames
477
+ - **zerobuffer**: Processing element with bidirectional communication using DuplexChannel
478
+
479
+ ### Zero-Copy Buffer Technology
480
+
481
+ For shared memory protocol, the SDK uses:
482
+ - **C++**: Zero-Copy-Buffer (via vcpkg) - Returns cv::Mat with zero-copy access
483
+ - **C#**: ZeroBuffer (via NuGet) - Returns OpenCvSharp.Mat with zero-copy access
484
+ - **Python**: zero-buffer (via pip) - Returns numpy arrays compatible with OpenCV
485
+
486
+ The SDK leverages DuplexChannel for bidirectional communication, enabling:
487
+ - Zero-copy frame access as OpenCV Mat objects
488
+ - In-place frame processing without memory allocation
489
+ - Direct memory mapping between producer and consumer
490
+ - Efficient metadata passing alongside frame data
491
+
492
+ This technology enables direct memory access without data duplication, providing maximum performance for local processing scenarios.
493
+
494
+ ## Acknowledgments
495
+
496
+ - GStreamer Project for the multimedia framework
497
+ - ZeroBuffer contributors for the zero-copy buffer implementation
@@ -0,0 +1,11 @@
1
+ rocket_welder_sdk/__init__.py,sha256=hv0U_UsvIjyLhZLsumjGwKrBJs8vzb1kczUzANilHug,1789
2
+ rocket_welder_sdk/bytes_size.py,sha256=Myl29-wyWCIYdbMmgaxXebT8Dz8_Fwcr3fnfaNW81P0,7463
3
+ rocket_welder_sdk/connection_string.py,sha256=msDgHD7525UXvrNPqKGpYgQJJtmOfS_XEnX3JA8LIz0,7731
4
+ rocket_welder_sdk/controllers.py,sha256=IhPJfwVlk0pxOuTRPW_Xp_3H_BZG6AJXQfS7DCfBrhg,26177
5
+ rocket_welder_sdk/gst_metadata.py,sha256=jEQvZX4BdR6OR3lqp12PV-HEXZhcxfiS010diA2CbMM,14213
6
+ rocket_welder_sdk/py.typed,sha256=0cXFZXmes4Y-vnl4lO3HtyyyWaFNw85B7tJdFeCtHDc,67
7
+ rocket_welder_sdk/rocket_welder_client.py,sha256=uvaAtog-xVCY9YldisgkCnCkbEWMHEgrJUUWJA1J3hg,5237
8
+ rocket_welder_sdk-0.0.0.dev0.dist-info/METADATA,sha256=kJ43Dq0angZqNj0i5_3CY32m52R0moERxfFco1SUiSE,14366
9
+ rocket_welder_sdk-0.0.0.dev0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
+ rocket_welder_sdk-0.0.0.dev0.dist-info/top_level.txt,sha256=2iZvBjnwVCUW-uDE23-eJld5PZ9-mlPI69QiXM5IrTA,18
11
+ rocket_welder_sdk-0.0.0.dev0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ rocket_welder_sdk