matrice-streaming 0.1.63__tar.gz → 0.1.64__tar.gz

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.
Files changed (71) hide show
  1. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/PKG-INFO +1 -1
  2. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/matrice_streaming.egg-info/PKG-INFO +1 -1
  3. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/nvdec.py +50 -11
  4. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/LICENSE.txt +0 -0
  5. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/README.md +0 -0
  6. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/matrice_streaming.egg-info/SOURCES.txt +0 -0
  7. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/matrice_streaming.egg-info/dependency_links.txt +0 -0
  8. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/matrice_streaming.egg-info/not-zip-safe +0 -0
  9. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/matrice_streaming.egg-info/top_level.txt +0 -0
  10. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/pyproject.toml +0 -0
  11. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/setup.cfg +0 -0
  12. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/setup.py +0 -0
  13. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/__init__.py +0 -0
  14. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/client/__init__.py +0 -0
  15. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/client/client.py +0 -0
  16. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/client/client_utils.py +0 -0
  17. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/deployment/__init__.py +0 -0
  18. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/deployment/camera_manager.py +0 -0
  19. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/deployment/deployment.py +0 -0
  20. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/deployment/inference_pipeline.py +0 -0
  21. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/deployment/streaming_gateway_manager.py +0 -0
  22. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/deployment/todo.txt +0 -0
  23. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/py.typed +0 -0
  24. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/__init__.py +0 -0
  25. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/ARCHITECTURE.md +0 -0
  26. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/__init__.py +0 -0
  27. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/async_camera_worker.py +0 -0
  28. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/async_ffmpeg_worker.py +0 -0
  29. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/camera_streamer.py +0 -0
  30. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/device_detection.py +0 -0
  31. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/encoder_manager.py +0 -0
  32. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/encoding_pool_manager.py +0 -0
  33. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/ffmpeg_camera_streamer.py +0 -0
  34. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/ffmpeg_config.py +0 -0
  35. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/ffmpeg_worker_manager.py +0 -0
  36. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/frame_processor.py +0 -0
  37. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/gstreamer_camera_streamer.py +0 -0
  38. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/gstreamer_worker.py +0 -0
  39. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/gstreamer_worker_manager.py +0 -0
  40. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/message_builder.py +0 -0
  41. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/nvdec_worker_manager.py +0 -0
  42. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/platform_pipelines.py +0 -0
  43. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/retry_manager.py +0 -0
  44. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/stream_statistics.py +0 -0
  45. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/video_capture_manager.py +0 -0
  46. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/camera_streamer/worker_manager.py +0 -0
  47. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/debug/README.md +0 -0
  48. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/debug/__init__.py +0 -0
  49. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/debug/benchmark.py +0 -0
  50. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/debug/debug_gstreamer_gateway.py +0 -0
  51. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/debug/debug_stream_backend.py +0 -0
  52. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/debug/debug_streaming_gateway.py +0 -0
  53. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/debug/debug_utils.py +0 -0
  54. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/debug/example_debug_streaming.py +0 -0
  55. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/debug/test_videoplayback.py +0 -0
  56. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/dynamic_camera_manager.py +0 -0
  57. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/event_listener.py +0 -0
  58. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/metrics_reporter.py +0 -0
  59. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/streaming_action.py +0 -0
  60. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/streaming_gateway.py +0 -0
  61. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/streaming_gateway_utils.py +0 -0
  62. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/src/matrice_streaming/streaming_gateway/streaming_status_listener.py +0 -0
  63. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/tests/test_async_infrastructure.py +0 -0
  64. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/tests/test_batch_auto_calculation.py +0 -0
  65. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/tests/test_batching_verification.py +0 -0
  66. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/tests/test_e2e_production.py +0 -0
  67. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/tests/test_flatten_binary.py +0 -0
  68. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/tests/test_gstreamer_integration.py +0 -0
  69. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/tests/test_msgpack_fix.py +0 -0
  70. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/tests/test_phase1_unit.py +0 -0
  71. {matrice_streaming-0.1.63 → matrice_streaming-0.1.64}/tests/test_phase2_scaling.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice_streaming
3
- Version: 0.1.63
3
+ Version: 0.1.64
4
4
  Summary: Common server utilities for Matrice.ai services
5
5
  Author-email: "Matrice.ai" <dipendra@matrice.ai>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice_streaming
3
- Version: 0.1.63
3
+ Version: 0.1.64
4
4
  Summary: Common server utilities for Matrice.ai services
5
5
  Author-email: "Matrice.ai" <dipendra@matrice.ai>
6
6
  License-Expression: MIT
@@ -547,7 +547,12 @@ def surface_to_nv12(frame, target_h: int = 640, target_w: int = 640) -> Optional
547
547
  return nv12_frame[:, :, cp.newaxis] if nv12_frame is not None else None
548
548
 
549
549
  except Exception as e:
550
- logger.warning(f"surface_to_nv12 failed: {e}")
550
+ # Safely encode error message (some CUDA errors contain non-ASCII chars like '×')
551
+ try:
552
+ err_msg = str(e).encode('ascii', errors='replace').decode('ascii')
553
+ except Exception:
554
+ err_msg = "unknown error"
555
+ logger.warning(f"surface_to_nv12 failed: {err_msg}")
551
556
  return None
552
557
 
553
558
 
@@ -727,7 +732,6 @@ def nvdec_pool_worker(
727
732
  frames_since_counter_update = 0
728
733
  counter_batch_size = 100
729
734
  start_time = time.perf_counter()
730
- last_log_time = start_time
731
735
  camera_ids = pool.get_camera_ids_for_decoder(decoder_idx)
732
736
  num_streams = len(camera_ids)
733
737
 
@@ -745,19 +749,12 @@ def nvdec_pool_worker(
745
749
  next_frame_time = 0
746
750
  fps_mode = ", unlimited FPS"
747
751
 
748
- logger.info(f"Worker {worker_id}: decoder={decoder_idx}, cams={num_streams}{fps_mode}")
752
+ logger.debug(f"Worker {worker_id}: decoder={decoder_idx}, cams={num_streams}{fps_mode}")
749
753
 
750
754
  while not stop_event.is_set():
751
755
  if time.perf_counter() - start_time >= duration_sec:
752
756
  break
753
757
 
754
- now = time.perf_counter()
755
- if now - last_log_time >= 5.0:
756
- elapsed = now - start_time
757
- fps = local_frames / elapsed if elapsed > 0 else 0
758
- logger.info(f"Worker {worker_id}: {local_frames} frames, {fps:.0f} FPS")
759
- last_log_time = now
760
-
761
758
  # FPS limiting: wait until next scheduled frame time
762
759
  if fps_limit_enabled:
763
760
  current_time = time.perf_counter()
@@ -952,10 +949,52 @@ def nvdec_pool_process(
952
949
  t.start()
953
950
  threads.append(t)
954
951
 
952
+ # Progress monitoring loop with current/avg FPS tracking
955
953
  start_time = time.perf_counter()
954
+ last_report_time = start_time
955
+ last_frame_count = 0
956
+ report_interval = 5.0
957
+ processing_start_time = None
958
+ frames_at_processing_start = 0
959
+
956
960
  while not stop_event.is_set():
957
- if time.perf_counter() - start_time >= duration_sec:
961
+ current_time = time.perf_counter()
962
+ if current_time - start_time >= duration_sec:
958
963
  break
964
+
965
+ # Periodic progress report with current and average FPS
966
+ if current_time - last_report_time >= report_interval:
967
+ elapsed = current_time - start_time
968
+
969
+ if shared_frame_count is not None:
970
+ current_frames = shared_frame_count.value
971
+ interval_frames = current_frames - last_frame_count
972
+ interval_fps = interval_frames / report_interval
973
+ per_stream_fps = interval_fps / len(camera_configs) if camera_configs else 0
974
+
975
+ # Track when processing actually starts (exclude warmup)
976
+ if processing_start_time is None and current_frames > 0:
977
+ processing_start_time = last_report_time
978
+ frames_at_processing_start = last_frame_count
979
+
980
+ # Calculate average FPS excluding warmup
981
+ if processing_start_time is not None:
982
+ processing_elapsed = current_time - processing_start_time
983
+ processing_frames = current_frames - frames_at_processing_start
984
+ avg_fps = processing_frames / processing_elapsed if processing_elapsed > 0 else 0
985
+ avg_per_stream = avg_fps / len(camera_configs) if camera_configs else 0
986
+ remaining = max(0, duration_sec - elapsed)
987
+
988
+ logger.info(
989
+ f"GPU{gpu_id} [{elapsed:5.1f}s] {current_frames:,} frames | "
990
+ f"cur: {interval_fps:,.0f} FPS ({per_stream_fps:.1f}/stream) | "
991
+ f"avg: {avg_fps:,.0f} FPS ({avg_per_stream:.1f}/stream) | "
992
+ f"{remaining:.0f}s left"
993
+ )
994
+
995
+ last_frame_count = current_frames
996
+ last_report_time = current_time
997
+
959
998
  time.sleep(0.1)
960
999
 
961
1000
  thread_stop_event.set()