sciveo 0.1.73__tar.gz → 0.1.75__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 (179) hide show
  1. {sciveo-0.1.73 → sciveo-0.1.75}/PKG-INFO +1 -1
  2. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/cli.py +33 -5
  3. sciveo-0.1.75/sciveo/media/capture/gst_server.py +137 -0
  4. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/capture/nvr.py +58 -0
  5. sciveo-0.1.75/sciveo/media/capture/rtsp.py +80 -0
  6. sciveo-0.1.75/sciveo/monitoring/power/ems300.py +107 -0
  7. sciveo-0.1.75/sciveo/monitoring/power/tools.py +394 -0
  8. sciveo-0.1.75/sciveo/version.py +2 -0
  9. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo.egg-info/PKG-INFO +1 -1
  10. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo.egg-info/SOURCES.txt +2 -0
  11. sciveo-0.1.73/sciveo/monitoring/power/ems300.py +0 -108
  12. sciveo-0.1.73/sciveo/monitoring/power/tools.py +0 -378
  13. sciveo-0.1.73/sciveo/version.py +0 -2
  14. {sciveo-0.1.73 → sciveo-0.1.75}/README.md +0 -0
  15. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/__init__.py +0 -0
  16. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/api/__init__.py +0 -0
  17. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/api/base.py +0 -0
  18. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/api/predictors.py +0 -0
  19. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/api/server.py +0 -0
  20. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/api/upload.py +0 -0
  21. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/common/__init__.py +0 -0
  22. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/common/configuration.py +0 -0
  23. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/common/model.py +0 -0
  24. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/common/optimizers.py +0 -0
  25. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/common/sampling.py +0 -0
  26. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/content/__init__.py +0 -0
  27. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/content/dataset.py +0 -0
  28. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/content/experiment.py +0 -0
  29. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/content/project.py +0 -0
  30. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/content/runner.py +0 -0
  31. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/db/__init__.py +0 -0
  32. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/db/read_table.py +0 -0
  33. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/__init__.py +0 -0
  34. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/capture/__init__.py +0 -0
  35. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/capture/cam.py +0 -0
  36. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/capture/motion_detection.py +0 -0
  37. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/capture/readers.py +0 -0
  38. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/ml/__init__.py +0 -0
  39. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/ml/base.py +0 -0
  40. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/ml/encoders/__init__.py +0 -0
  41. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/ml/encoders/base.py +0 -0
  42. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/ml/encoders/normalizer.py +0 -0
  43. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/ml/nlp/__init__.py +0 -0
  44. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/ml/nlp/search.py +0 -0
  45. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/ml/time_series/__init__.py +0 -0
  46. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/ml/time_series/dataset.py +0 -0
  47. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/ml/time_series/predictor.py +0 -0
  48. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/ml/time_series/trainer.py +0 -0
  49. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/ml/time_series/window_generator.py +0 -0
  50. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/__init__.py +0 -0
  51. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/base.py +0 -0
  52. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/job_daemon.py +0 -0
  53. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/layouts/__init__.py +0 -0
  54. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/layouts/base.py +0 -0
  55. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/pipeline.py +0 -0
  56. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/postprocessors/__init__.py +0 -0
  57. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/postprocessors/base.py +0 -0
  58. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/postprocessors/default.py +0 -0
  59. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/__init__.py +0 -0
  60. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/audio/__init__.py +0 -0
  61. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/audio/audio.py +0 -0
  62. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/audio/audio_extractor_process.py +0 -0
  63. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/aws.py +0 -0
  64. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/base.py +0 -0
  65. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/file/__init__.py +0 -0
  66. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/file/archive.py +0 -0
  67. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/__init__.py +0 -0
  68. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/album.py +0 -0
  69. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/album_in_image.py +0 -0
  70. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/depth_esimation.py +0 -0
  71. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/embeddings.py +0 -0
  72. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/filters.py +0 -0
  73. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/generators.py +0 -0
  74. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/histogram.py +0 -0
  75. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/mask.py +0 -0
  76. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/object_detection.py +0 -0
  77. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/resize.py +0 -0
  78. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/segmentation.py +0 -0
  79. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/watermark.py +0 -0
  80. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/media_info.py +0 -0
  81. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/nlp/__init__.py +0 -0
  82. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/nlp/address.py +0 -0
  83. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/qr.py +0 -0
  84. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/__init__.py +0 -0
  85. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/base.py +0 -0
  86. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/dataset.py +0 -0
  87. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/time_series/__init__.py +0 -0
  88. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/time_series/predictor.py +0 -0
  89. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/time_series/trainer.py +0 -0
  90. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/tpu_base.py +0 -0
  91. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/__init__.py +0 -0
  92. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/generators.py +0 -0
  93. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/motion_detection.py +0 -0
  94. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/resize.py +0 -0
  95. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/video_album.py +0 -0
  96. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/video_frames.py +0 -0
  97. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/video_resample.py +0 -0
  98. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/queues.py +0 -0
  99. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/server.py +0 -0
  100. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/web/__init__.py +0 -0
  101. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/pipelines/web/server.py +0 -0
  102. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/tools/__init__.py +0 -0
  103. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/media/tools/video_interactive.py +0 -0
  104. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/__init__.py +0 -0
  105. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/base.py +0 -0
  106. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/dataset/__init__.py +0 -0
  107. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/dataset/object_detection.py +0 -0
  108. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/evaluation/__init__.py +0 -0
  109. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/evaluation/markdown.py +0 -0
  110. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/evaluation/object_detection.py +0 -0
  111. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/images/__init__.py +0 -0
  112. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/images/base.py +0 -0
  113. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/images/description.py +0 -0
  114. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/images/embeddings.py +0 -0
  115. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/images/object_detection.py +0 -0
  116. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/images/tools.py +0 -0
  117. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/images/transformers.py +0 -0
  118. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/nlp/__init__.py +0 -0
  119. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/nlp/embeddings.py +0 -0
  120. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/nlp/tokenizers/__init__.py +0 -0
  121. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/nlp/tokenizers/bpe.py +0 -0
  122. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/video/__init__.py +0 -0
  123. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/ml/video/description.py +0 -0
  124. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/monitoring/__init__.py +0 -0
  125. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/monitoring/monitor.py +0 -0
  126. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/monitoring/power/__init__.py +0 -0
  127. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/monitoring/power/sim.py +0 -0
  128. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/monitoring/start.py +0 -0
  129. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/monitoring/watchdog/__init__.py +0 -0
  130. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/monitoring/watchdog/base.py +0 -0
  131. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/monitoring/watchdog/process.py +0 -0
  132. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/network/__init__.py +0 -0
  133. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/network/camera.py +0 -0
  134. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/network/sniffer.py +0 -0
  135. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/network/tools.py +0 -0
  136. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/__init__.py +0 -0
  137. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/array.py +0 -0
  138. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/aws/__init__.py +0 -0
  139. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/aws/priority_queue.py +0 -0
  140. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/aws/s3.py +0 -0
  141. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/common.py +0 -0
  142. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/complexity.py +0 -0
  143. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/compress.py +0 -0
  144. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/configuration.py +0 -0
  145. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/crypto.py +0 -0
  146. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/daemon.py +0 -0
  147. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/draw/__init__.py +0 -0
  148. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/draw/contours.py +0 -0
  149. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/formating.py +0 -0
  150. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/hardware.py +0 -0
  151. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/http.py +0 -0
  152. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/logger.py +0 -0
  153. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/os.py +0 -0
  154. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/queue.py +0 -0
  155. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/random.py +0 -0
  156. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/remote.py +0 -0
  157. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/simple_counter.py +0 -0
  158. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/synchronized.py +0 -0
  159. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/timers.py +0 -0
  160. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/tools/totp.py +0 -0
  161. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/web/__init__.py +0 -0
  162. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo/web/common.py +0 -0
  163. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo.egg-info/dependency_links.txt +0 -0
  164. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo.egg-info/entry_points.txt +0 -0
  165. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo.egg-info/requires.txt +0 -0
  166. {sciveo-0.1.73 → sciveo-0.1.75}/sciveo.egg-info/top_level.txt +0 -0
  167. {sciveo-0.1.73 → sciveo-0.1.75}/setup.cfg +0 -0
  168. {sciveo-0.1.73 → sciveo-0.1.75}/setup.py +0 -0
  169. {sciveo-0.1.73 → sciveo-0.1.75}/test/test_complexity.py +0 -0
  170. {sciveo-0.1.73 → sciveo-0.1.75}/test/test_compress.py +0 -0
  171. {sciveo-0.1.73 → sciveo-0.1.75}/test/test_configuration.py +0 -0
  172. {sciveo-0.1.73 → sciveo-0.1.75}/test/test_crypto.py +0 -0
  173. {sciveo-0.1.73 → sciveo-0.1.75}/test/test_eval_markdown.py +0 -0
  174. {sciveo-0.1.73 → sciveo-0.1.75}/test/test_ml_datasets.py +0 -0
  175. {sciveo-0.1.73 → sciveo-0.1.75}/test/test_monitoring.py +0 -0
  176. {sciveo-0.1.73 → sciveo-0.1.75}/test/test_runner.py +0 -0
  177. {sciveo-0.1.73 → sciveo-0.1.75}/test/test_sampling.py +0 -0
  178. {sciveo-0.1.73 → sciveo-0.1.75}/test/test_tokenizers.py +0 -0
  179. {sciveo-0.1.73 → sciveo-0.1.75}/test/test_totp.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.1.73
3
+ Version: 0.1.75
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
6
  Provides-Extra: net
@@ -27,9 +27,10 @@ def main():
27
27
  parser.add_argument(
28
28
  'command',
29
29
  choices=[
30
- 'init', 'monitor', 'scan', 'nvr', 'predictors-server',
31
- 'media-server', 'media-run',
32
- 'watchdog'
30
+ 'init', 'monitor', 'scan',
31
+ 'nvr', 'rtsp',
32
+ 'predictors-server', 'media-server', 'media-run',
33
+ 'watchdog',
33
34
  ],
34
35
  help='Command to execute')
35
36
 
@@ -46,20 +47,31 @@ def main():
46
47
  parser.add_argument('--output-path', type=str, default=None, help='Output Path')
47
48
  parser.add_argument('--width', type=str, default=None, help='width')
48
49
  parser.add_argument('--height', type=str, default=None, help='height')
50
+ parser.add_argument('--fps', type=int, help='FPS')
51
+ parser.add_argument('--stream', type=str, default=None, help='Stream')
49
52
  parser.add_argument('--rate', type=int, help='Rate number')
50
53
  parser.add_argument('--processor', type=str, help='Processor name')
51
54
  parser.add_argument('--src', type=str, default=None, help='Source')
55
+ parser.add_argument('--src-id', type=int, default=None, help='Source Id')
52
56
  parser.add_argument('--dst', type=str, default=None, help='Destination')
53
57
  parser.add_argument('--value', type=float, help='Value')
54
58
  parser.add_argument('--threshold', type=float, default=None, help='Threshold')
55
59
  parser.add_argument('--execute', type=str, default=None, help='Execute command')
56
60
  parser.add_argument('--pid', type=int, default=None, help='Process PID')
61
+ parser.add_argument('--serial', type=str, default=None, help='Serial Name')
57
62
 
58
63
  args = parser.parse_args()
59
64
 
60
65
  if args.command == 'monitor':
61
- from sciveo.monitoring.start import MonitorStart
62
- MonitorStart(period=args.period, block=args.block, output_path=args.output_path)()
66
+ if args.src is None:
67
+ from sciveo.monitoring.start import MonitorStart
68
+ MonitorStart(period=args.period, block=args.block, output_path=args.output_path)()
69
+ elif args.src.startswith("power"):
70
+ from sciveo.monitoring.power.ems300 import PowerEMS300
71
+ mon = PowerEMS300(serial=args.serial, host=args.host, port=args.port, period=args.period, output_path=args.output_path)
72
+ mon.start()
73
+ while(True):
74
+ time.sleep(3600)
63
75
  elif args.command == 'scan':
64
76
  from sciveo.network.tools import NetworkTools
65
77
  host=args.host
@@ -86,6 +98,22 @@ def main():
86
98
  elif args.command == 'nvr':
87
99
  from sciveo.media.capture.nvr import VideoRecorder
88
100
  VideoRecorder(args.input_path).start()
101
+ elif args.command == 'rtsp':
102
+ if args.src is None and args.src_id is None:
103
+ from sciveo.media.capture.nvr import RTSPVideoPlayer
104
+ player = RTSPVideoPlayer(f"rtsp://{args.host}:{args.port}/{args.stream}")
105
+ player.run()
106
+ else:
107
+ from sciveo.media.capture.gst_server import CamFactory, ColorBarFactory
108
+ if args.src_id is not None:
109
+ server = CamFactory(args.src_id, args.width, args.height, args.fps)
110
+ elif args.src is not None:
111
+ if "color" in args.src:
112
+ server = ColorBarFactory(args.width, args.height, args.fps)
113
+ else:
114
+ # warning("RTSP src", args.src, "not recognised")
115
+ server = CamFactory(args.src, args.width, args.height, args.fps)
116
+ server.serve(host=args.host, port=args.port, stream=args.stream)
89
117
  elif args.command == 'media-server':
90
118
  from sciveo.media.pipelines.server import __START_SCIVEO_MEDIA_SERVER__
91
119
  __START_SCIVEO_MEDIA_SERVER__()
@@ -0,0 +1,137 @@
1
+ #
2
+ # Pavlin Georgiev, Softel Labs
3
+ #
4
+ # This is a proprietary file and may not be copied,
5
+ # distributed, or modified without express permission
6
+ # from the owner. For licensing inquiries, please
7
+ # contact pavlin@softel.bg.
8
+ #
9
+ # 2025
10
+ #
11
+
12
+ import numpy as np
13
+
14
+ import gi
15
+ gi.require_version('Gst', '1.0')
16
+ gi.require_version('GstRtspServer', '1.0')
17
+ from gi.repository import Gst, GObject, GstRtspServer, GLib
18
+ Gst.init(None)
19
+
20
+ from sciveo.tools.logger import *
21
+ from sciveo.media.capture.cam import CameraDaemon
22
+
23
+
24
+ class RTSPFactoryBase(GstRtspServer.RTSPMediaFactory):
25
+ def __init__(self, width, height, fps):
26
+ super().__init__()
27
+ self.width = width
28
+ self.height = height
29
+ self.fps = fps
30
+ self.set_shared(True)
31
+
32
+ def do_create_element(self, url):
33
+ pipeline_str = (
34
+ f"appsrc name=mysrc is-live=true block=true format=time "
35
+ f"caps=video/x-raw,format=BGR,width={self.width},height={self.height},framerate={self.fps}/1 "
36
+ "! videoconvert "
37
+ "! x264enc tune=zerolatency speed-preset=ultrafast "
38
+ "! rtph264pay config-interval=1 name=pay0 pt=96"
39
+ )
40
+ return Gst.parse_launch(pipeline_str)
41
+
42
+ def do_configure(self, rtsp_media):
43
+ self.appsrc = rtsp_media.get_element().get_child_by_name("mysrc")
44
+ self.appsrc.connect("need-data", self.on_need_data)
45
+ self.timestamp = 0
46
+
47
+ def on_need_data(self, src, length):
48
+ frame = self.next_frame()
49
+
50
+ data = frame.tobytes()
51
+ buf = Gst.Buffer.new_allocate(None, len(data), None)
52
+ buf.fill(0, data)
53
+ buf.duration = Gst.SECOND // self.fps
54
+ buf.pts = buf.dts = self.timestamp
55
+ self.timestamp += buf.duration
56
+ src.emit("push-buffer", buf)
57
+
58
+ def next_frame(self):
59
+ return np.zeros((self.height, self.width, 3), dtype=np.uint8)
60
+
61
+ def serve(self, host="0.0.0.0", port=8554, stream="test"):
62
+ rtsp_url = f"rtsp://{host}:{port}/{stream}"
63
+ server = GstRtspServer.RTSPServer()
64
+ server.set_address(host)
65
+ server.set_service(str(port))
66
+
67
+ mount_points = server.get_mount_points()
68
+ mount_points.add_factory(f"/{stream}", self)
69
+
70
+ server.attach(None)
71
+ info(f"RTSP server {type(self).__name__} running at {rtsp_url}")
72
+ GLib.MainLoop().run()
73
+
74
+
75
+ """
76
+ RTSP TV-like Color Bars Test Generator
77
+ """
78
+ class ColorBarsGenerator:
79
+ """
80
+ Generates standard vertical color bars (SMPTE/EBU-like) for testing.
81
+ """
82
+ def __init__(self, width=640, height=480):
83
+ self.width = width
84
+ self.height = height
85
+ self.colors = [
86
+ (255, 255, 255), # White
87
+ (0, 255, 255), # Yellow
88
+ (255, 255, 0), # Cyan
89
+ (0, 255, 0), # Green
90
+ (255, 0, 255), # Magenta
91
+ (0, 0, 255), # Red
92
+ (255, 0, 0), # Blue
93
+ (0, 0, 0) # Black
94
+ ]
95
+ self.n_colors = len(self.colors)
96
+
97
+ def next_frame(self):
98
+ frame = np.zeros((self.height, self.width, 3), dtype=np.uint8)
99
+ bar_width = self.width // self.n_colors
100
+
101
+ for i, color in enumerate(self.colors):
102
+ start_x = i * bar_width
103
+ end_x = start_x + bar_width if i < self.n_colors - 1 else self.width
104
+ frame[:, start_x:end_x] = color
105
+
106
+ return frame
107
+
108
+
109
+ class ColorBarFactory(RTSPFactoryBase):
110
+ def __init__(self, width, height, fps):
111
+ super().__init__(width, height, fps)
112
+ self.gen = ColorBarsGenerator(width=width, height=height)
113
+
114
+ def next_frame(self):
115
+ return self.gen.next_frame()
116
+
117
+
118
+ class CamFactory(ColorBarFactory):
119
+ def __init__(self, cam_id, width, height, fps):
120
+ super().__init__(width, height, fps)
121
+ self.cam = CameraDaemon(cam_id=cam_id)
122
+ self.cam.start()
123
+
124
+ def next_frame(self):
125
+ frame = self.cam.read()
126
+ if frame is None:
127
+ frame = super().next_frame()
128
+ return frame
129
+
130
+
131
+ if __name__ == "__main__":
132
+
133
+ # server = ColorBarFactory(640, 480, 10)
134
+ # server.serve(host="0.0.0.0", port=8554, stream="test")
135
+
136
+ server = CamFactory(0, 640, 480, 30)
137
+ server.serve(host="0.0.0.0", port=8554, stream="camera")
@@ -197,5 +197,63 @@ class VideoRecorder:
197
197
  exception(e, cmd)
198
198
 
199
199
 
200
+ class RTSPVideoPlayer:
201
+ def __init__(self, rtsp_url, name=None):
202
+ self.rtsp_url = rtsp_url
203
+ if name is None:
204
+ name = rtsp_url
205
+ self.name = name
206
+ self.cap = None
207
+ self.is_running = False
208
+
209
+ def open(self):
210
+ info("Opening RTSP", self.rtsp_url)
211
+ self.cap = cv2.VideoCapture(self.rtsp_url)
212
+ if not self.cap.isOpened():
213
+ error("Failed to open RTSP URL", self.rtsp_url)
214
+ self.cap = None
215
+
216
+ def close(self):
217
+ if self.cap:
218
+ info("Closing RTSP", self.rtsp_url)
219
+ try:
220
+ self.cap.release()
221
+ except:
222
+ pass
223
+ self.cap = None
224
+ try:
225
+ cv2.destroyWindow(self.window_name)
226
+ except:
227
+ pass
228
+
229
+ def run(self):
230
+ self.is_running = True
231
+ while(self.is_running):
232
+ self.loop()
233
+
234
+ def loop(self):
235
+ if self.cap is None:
236
+ self.open()
237
+ if self.cap is None:
238
+ time.sleep(1)
239
+ return
240
+
241
+ ret, frame = self.cap.read()
242
+ if not ret or frame is None:
243
+ error("Failed to read frame, reconnecting...")
244
+ self.close()
245
+ time.sleep(1)
246
+ return
247
+
248
+ cv2.imshow(self.name, frame)
249
+ if cv2.waitKey(1) & 0xFF == ord('q'):
250
+ info("Quit key pressed, stopping player")
251
+ self.close()
252
+ self.is_running = False
253
+
254
+ def finalise(self):
255
+ self.close()
256
+
257
+
200
258
  if __name__ == '__main__':
201
259
  VideoRecorder("./cams.json").start()
@@ -0,0 +1,80 @@
1
+ #
2
+ # Pavlin Georgiev, Softel Labs
3
+ #
4
+ # This is a proprietary file and may not be copied,
5
+ # distributed, or modified without express permission
6
+ # from the owner. For licensing inquiries, please
7
+ # contact pavlin@softel.bg.
8
+ #
9
+ # 2025
10
+ #
11
+
12
+ import time
13
+ import cv2
14
+
15
+ from sciveo.tools.logger import *
16
+
17
+
18
+ class RTSPVideoPlayer:
19
+ def __init__(self, rtsp_url, name=None):
20
+ self.rtsp_url = rtsp_url
21
+ if name is None:
22
+ name = rtsp_url
23
+ self.name = name
24
+ self.cap = None
25
+ self.is_running = False
26
+
27
+ def open(self):
28
+ info("Opening RTSP", self.rtsp_url)
29
+ self.cap = cv2.VideoCapture(self.rtsp_url)
30
+ if not self.cap.isOpened():
31
+ error("Failed to open RTSP URL", self.rtsp_url)
32
+ self.cap = None
33
+
34
+ def close(self):
35
+ if self.cap:
36
+ info("Closing RTSP", self.rtsp_url)
37
+ try:
38
+ self.cap.release()
39
+ except:
40
+ pass
41
+ self.cap = None
42
+ try:
43
+ cv2.destroyWindow(self.window_name)
44
+ except:
45
+ pass
46
+
47
+ def run(self):
48
+ self.is_running = True
49
+ while(self.is_running):
50
+ self.loop()
51
+
52
+ def loop(self):
53
+ if self.cap is None:
54
+ self.open()
55
+ if self.cap is None:
56
+ time.sleep(1)
57
+ return
58
+
59
+ ret, frame = self.cap.read()
60
+ if not ret or frame is None:
61
+ error("Failed to read frame, reconnecting...")
62
+ self.close()
63
+ time.sleep(1)
64
+ return
65
+
66
+ cv2.imshow(self.name, frame)
67
+ if cv2.waitKey(1) & 0xFF == ord('q'):
68
+ info("Quit key pressed, stopping player")
69
+ self.close()
70
+ self.is_running = False
71
+
72
+ def finalise(self):
73
+ self.close()
74
+
75
+
76
+ if __name__ == '__main__':
77
+
78
+ player = RTSPVideoPlayer("rtsp://192.168.10.118:8554/test")
79
+ # player = RTSPVideoPlayer("rtsp://192.168.10.118:8554/camera")
80
+ player.run()
@@ -0,0 +1,107 @@
1
+ #
2
+ # Stanislav Georgiev, Softel Labs
3
+ #
4
+ # This is a proprietary file and may not be copied,
5
+ # distributed, or modified without express permission
6
+ # from the owner. For licensing inquiries, please
7
+ # contact s.georgiev@softel.bg.
8
+ #
9
+ # 2025
10
+ #
11
+
12
+ import os
13
+ import json
14
+ import datetime
15
+ import time
16
+ from pymodbus.client import ModbusTcpClient
17
+ from sciveo.tools.logger import *
18
+ from sciveo.tools.daemon import DaemonBase
19
+ # from sciveo.api.base import APIRemoteClient
20
+ from sciveo.monitoring.power.tools import *
21
+
22
+
23
+ class PowerEMS300(DaemonBase):
24
+ def __init__(self, serial, host, port=502, device_id=247, delay=0.01, period=30, output_path=None):
25
+ super().__init__(period=period)
26
+ self.serial = serial
27
+ self.host = host
28
+ self.port = port
29
+ self.device_id = device_id
30
+ self.delay = delay
31
+ self.client = None
32
+
33
+ if output_path is not None and os.path.isdir(output_path):
34
+ self.output_path = os.path.join(output_path, f"{self.serial}.json")
35
+ else:
36
+ self.output_path = output_path
37
+
38
+ # self.api = APIRemoteClient()
39
+ self.client = ModbusTcpClient(host=self.host, port=self.port)
40
+
41
+ def connect(self):
42
+ if not self.client.connected:
43
+ if self.client.connect():
44
+ info(type(self.client).__name__, "connected", (self.host, self.port))
45
+ else:
46
+ error("Connect FAIL", (self.host, self.port))
47
+ return self.client.connected
48
+
49
+ def send(self, data):
50
+ api_result = self.api.POST_SCI("monitor", {"data": data})
51
+ debug(data, "api_result", api_result)
52
+
53
+ def output_write(self, data):
54
+ if os.path.isfile(self.output_path):
55
+ with open(self.output_path, "rb+") as fp:
56
+ fp.seek(-2, 2)
57
+ fp.truncate()
58
+ with open(self.output_path, "a") as fp:
59
+ fp.write(f", {json.dumps(data)}]\n")
60
+ else:
61
+ with open(self.output_path, "w") as fp:
62
+ fp.write(json.dumps([data]) + "\n")
63
+
64
+ def save(self, data):
65
+ try:
66
+ if self.output_path is not None:
67
+ info("save", self.output_path, data)
68
+ self.output_write(data)
69
+ except Exception as e:
70
+ error(e, "writing failed for", self.output_path)
71
+
72
+ def loop(self):
73
+ if not self.connect():
74
+ warning("Not connected", (self.host, self.port))
75
+ return
76
+
77
+ try:
78
+ data = {
79
+ "local_time": datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
80
+ "serial": self.serial,
81
+ }
82
+
83
+ current_info = [8026, 8044, 8060, 8776, 8778, 10101, 10103, 10105, 10713, 10715, 10716, 10945]
84
+ for addr in current_info:
85
+ result = read_input_registers(self.client, EMS300_REG_MAP, addr, self.device_id)
86
+ if result is not None:
87
+ value, name, dtype = result
88
+ debug(f"{name}: {value}")
89
+ data[name] = value
90
+ time.sleep(self.delay)
91
+
92
+ # self.send(data)
93
+ self.save(data)
94
+ except Exception as e:
95
+ exception(e)
96
+
97
+ def close(self):
98
+ self.client.close()
99
+
100
+
101
+ if __name__ == "__main__":
102
+
103
+ mon = PowerEMS300(serial="EMS300-1", host="192.168.86.184", port=502, period=30, output_path="ems300.json")
104
+ mon.start()
105
+
106
+ while(True):
107
+ time.sleep(30)