rocket-welder-sdk 1.1.27__py3-none-any.whl → 1.1.28__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rocket-welder-sdk
3
- Version: 1.1.27
3
+ Version: 1.1.28
4
4
  Summary: High-performance video streaming SDK for RocketWelder services using ZeroBuffer IPC
5
5
  Home-page: https://github.com/modelingevolution/rocket-welder-sdk
6
6
  Author: ModelingEvolution
@@ -17,6 +17,7 @@ Classifier: Topic :: Multimedia :: Video
17
17
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
18
  Classifier: License :: OSI Approved :: MIT License
19
19
  Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.8
20
21
  Classifier: Programming Language :: Python :: 3.9
21
22
  Classifier: Programming Language :: Python :: 3.10
22
23
  Classifier: Programming Language :: Python :: 3.11
@@ -93,6 +94,18 @@ shm://<buffer_name>?mode=duplex&buffer_size=10MB
93
94
  - `buffer_size`: Size of the data buffer (default: 20MB, supports units: B, KB, MB, GB)
94
95
  - `metadata_size`: Size of the metadata buffer (default: 4KB, supports units: B, KB, MB)
95
96
 
97
+ #### File (Video File Playback)
98
+ ```
99
+ file:///path/to/video.mp4
100
+ file:///path/to/video.mp4?loop=true
101
+ file:///path/to/video.mp4?preview=true
102
+ file:///path/to/video.mp4?loop=true&preview=true
103
+ ```
104
+
105
+ **Optional Parameters:**
106
+ - `loop`: Loop video playback when end is reached (`true` or `false`; default: `false`)
107
+ - `preview`: Enable preview window display (`true` or `false`; default: `false`)
108
+
96
109
  #### MJPEG over HTTP
97
110
  ```
98
111
  mjpeg+http://192.168.1.100:8080
@@ -318,6 +331,44 @@ for frame in client.frames():
318
331
  print(f"Received frame: {frame.shape}")
319
332
  ```
320
333
 
334
+ ## Preview Display
335
+
336
+ When using the `file://` protocol with `preview=true` parameter, you can display frames in a window. The `Show()` method must be called from the main thread:
337
+
338
+ ### C# Preview
339
+ ```csharp
340
+ var client = RocketWelderClient.FromConnectionString(
341
+ "file:///path/to/video.mp4?preview=true&loop=true"
342
+ );
343
+
344
+ // Start processing in background
345
+ client.Start(frame => {
346
+ // Process frame
347
+ });
348
+
349
+ // Show preview window in main thread (blocks until 'q' pressed)
350
+ client.Show();
351
+ ```
352
+
353
+ ### Python Preview
354
+ ```python
355
+ client = rw.Client.from_connection_string(
356
+ "file:///path/to/video.mp4?preview=true&loop=true"
357
+ )
358
+
359
+ # Start processing in background
360
+ client.start(lambda frame: process_frame(frame))
361
+
362
+ # Show preview window in main thread (blocks until 'q' pressed)
363
+ client.show()
364
+ ```
365
+
366
+ **Note**: The `Show()` method:
367
+ - Blocks when `preview=true` is set in the connection string
368
+ - Returns immediately when `preview` is not set or `false`
369
+ - Must be called from the main thread (X11/GUI requirement)
370
+ - Stops when 'q' key is pressed in the preview window
371
+
321
372
  ## Docker Integration
322
373
 
323
374
  ### C++ Dockerfile
@@ -385,6 +436,75 @@ COPY . .
385
436
  CMD ["python", "app.py"]
386
437
  ```
387
438
 
439
+ ### Running Docker with X11 Display Support (Preview)
440
+
441
+ When using the `preview=true` parameter with file protocol, you need to enable X11 forwarding for Docker containers to display the preview window.
442
+
443
+ #### Linux
444
+
445
+ ```bash
446
+ # Allow X server connections from Docker
447
+ xhost +local:docker
448
+
449
+ # Run container with display support
450
+ docker run --rm \
451
+ -e DISPLAY=$DISPLAY \
452
+ -e CONNECTION_STRING="file:///data/video.mp4?preview=true&loop=true" \
453
+ -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
454
+ -v /path/to/video.mp4:/data/video.mp4:ro \
455
+ --network host \
456
+ your-image:latest
457
+
458
+ # Restore X server security after running
459
+ xhost -local:docker
460
+ ```
461
+
462
+ #### Windows WSL2
463
+
464
+ WSL2 includes WSLg which provides automatic X11 support:
465
+
466
+ ```bash
467
+ # WSLg sets DISPLAY automatically, just verify it's set
468
+ echo $DISPLAY # Should show :0 or similar
469
+
470
+ # Allow X server connections
471
+ xhost +local:docker 2>/dev/null || xhost +local: 2>/dev/null
472
+
473
+ # Run container with display support (same as Linux)
474
+ docker run --rm \
475
+ -e DISPLAY=$DISPLAY \
476
+ -e CONNECTION_STRING="file:///data/video.mp4?preview=true&loop=true" \
477
+ -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
478
+ -v /mnt/c/path/to/video.mp4:/data/video.mp4:ro \
479
+ --network host \
480
+ your-image:latest
481
+
482
+ # Restore X server security
483
+ xhost -local:docker 2>/dev/null || xhost -local: 2>/dev/null
484
+ ```
485
+
486
+ #### Helper Scripts
487
+
488
+ The SDK includes helper scripts for easy testing:
489
+
490
+ ```bash
491
+ # Build Docker images with sample clients
492
+ ./build_docker_samples.sh
493
+
494
+ # Test Python client with preview
495
+ ./run_docker_x11.sh python
496
+
497
+ # Test C# client with preview
498
+ ./run_docker_x11.sh csharp
499
+ ```
500
+
501
+ These scripts automatically:
502
+ - Configure X11 display forwarding
503
+ - Use a test video from the repository's data folder
504
+ - Mount the video into the container
505
+ - Set up the connection string with preview enabled
506
+ - Clean up X server permissions after running
507
+
388
508
  ## Protocol Details
389
509
 
390
510
  ### Shared Memory Protocol (shm://)
@@ -394,6 +514,15 @@ High-performance local data transfer between processes:
394
514
  - **Performance**: Minimal latency, maximum throughput
395
515
  - **Use Cases**: Local processing, multi-container applications on same host
396
516
 
517
+ ### File Protocol (file://)
518
+
519
+ Local video file playback with OpenCV:
520
+
521
+ - **Performance**: Controlled playback speed based on video FPS
522
+ - **Features**: Loop playback, preview window, frame-accurate timing
523
+ - **Use Cases**: Testing, development, offline processing, demos
524
+ - **Supported Formats**: All formats supported by OpenCV (MP4, AVI, MOV, etc.)
525
+
397
526
  ### MJPEG over HTTP (mjpeg+http://)
398
527
 
399
528
  Motion JPEG streaming over HTTP:
@@ -1,10 +1,12 @@
1
- rocket_welder_sdk/__init__.py,sha256=hv0U_UsvIjyLhZLsumjGwKrBJs8vzb1kczUzANilHug,1789
1
+ rocket_welder_sdk/__init__.py,sha256=tL2NPprMSh19MDUtLsk1YByB0YTLp6nNAkWv2fxNKuM,2001
2
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
3
+ rocket_welder_sdk/connection_string.py,sha256=hW61Yf1uCGTWz5KA-yis1nrXO5pyTOCTzxJUbAxf7uk,9685
4
+ rocket_welder_sdk/controllers.py,sha256=DGy33gikQEi8HhdC3JHKN38ADa-qlSE5acKEsnZLzNA,26593
5
5
  rocket_welder_sdk/gst_metadata.py,sha256=jEQvZX4BdR6OR3lqp12PV-HEXZhcxfiS010diA2CbMM,14213
6
+ rocket_welder_sdk/opencv_controller.py,sha256=MDM6_yFBB9BaMa5jnZRqw7xZZB-WuLr7EPrrfHQ2DK4,9905
7
+ rocket_welder_sdk/periodic_timer.py,sha256=hnObybmrnf3J47QrNKJhYAytLKwria016123NvPRfQ0,9369
6
8
  rocket_welder_sdk/py.typed,sha256=0cXFZXmes4Y-vnl4lO3HtyyyWaFNw85B7tJdFeCtHDc,67
7
- rocket_welder_sdk/rocket_welder_client.py,sha256=uvaAtog-xVCY9YldisgkCnCkbEWMHEgrJUUWJA1J3hg,5237
9
+ rocket_welder_sdk/rocket_welder_client.py,sha256=aiNfNJjDXLWJ-vw5uDg2tv0HuSkerCVMl109zQaVjGg,14311
8
10
  rocket_welder_sdk/external_controls/__init__.py,sha256=ldOLGhLLS5BQL8m4VKFYV0SvsNNlV2tghlc7rkqadU8,699
9
11
  rocket_welder_sdk/external_controls/contracts.py,sha256=3DU6pdpteN50gF2fsS7C2279dGjDa0tZLrLntkBa2LM,2607
10
12
  rocket_welder_sdk/external_controls/contracts_old.py,sha256=XWriuXJZu5caTSS0bcTIOZcKnj-IRCm96voA4gqLBfU,2980
@@ -14,7 +16,7 @@ rocket_welder_sdk/ui/icons.py,sha256=DcDklZkPmiEzlOD4IR7VTJOtGPCuuh_OM_WN7ScghWE
14
16
  rocket_welder_sdk/ui/ui_events_projection.py,sha256=siiNhjLEBOPfTKw1ZhOPGkwIN5rLDH7V9VCZTNrhEtQ,7836
15
17
  rocket_welder_sdk/ui/ui_service.py,sha256=uRdpyJGoCQmtOli_HKSrxLwhZYG-XRuHIYdkmFz1zNk,12026
16
18
  rocket_welder_sdk/ui/value_types.py,sha256=f7OA_9zgXEDPoITc8v8SfAR23I4XeFhE3E2_GcAbR6k,1616
17
- rocket_welder_sdk-1.1.27.dist-info/METADATA,sha256=7ASdgQYwEmQFNAHNxEzgdTJycgy-5J59uujE9Zwxw6I,14402
18
- rocket_welder_sdk-1.1.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- rocket_welder_sdk-1.1.27.dist-info/top_level.txt,sha256=2iZvBjnwVCUW-uDE23-eJld5PZ9-mlPI69QiXM5IrTA,18
20
- rocket_welder_sdk-1.1.27.dist-info/RECORD,,
19
+ rocket_welder_sdk-1.1.28.dist-info/METADATA,sha256=_4x2JrvbxuknI2dU9FeuZFX_SZ3SEPcnnG5U_ZI_DKU,18081
20
+ rocket_welder_sdk-1.1.28.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
+ rocket_welder_sdk-1.1.28.dist-info/top_level.txt,sha256=2iZvBjnwVCUW-uDE23-eJld5PZ9-mlPI69QiXM5IrTA,18
22
+ rocket_welder_sdk-1.1.28.dist-info/RECORD,,