sciveo 0.1.74__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.
- {sciveo-0.1.74 → sciveo-0.1.75}/PKG-INFO +1 -1
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/cli.py +22 -2
- sciveo-0.1.75/sciveo/media/capture/gst_server.py +137 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/capture/nvr.py +58 -0
- sciveo-0.1.75/sciveo/media/capture/rtsp.py +80 -0
- sciveo-0.1.75/sciveo/version.py +2 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo.egg-info/PKG-INFO +1 -1
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo.egg-info/SOURCES.txt +2 -0
- sciveo-0.1.74/sciveo/version.py +0 -2
- {sciveo-0.1.74 → sciveo-0.1.75}/README.md +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/api/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/api/base.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/api/predictors.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/api/server.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/api/upload.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/common/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/common/configuration.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/common/model.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/common/optimizers.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/common/sampling.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/content/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/content/dataset.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/content/experiment.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/content/project.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/content/runner.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/db/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/db/read_table.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/capture/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/capture/cam.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/capture/motion_detection.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/capture/readers.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/ml/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/ml/base.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/ml/encoders/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/ml/encoders/base.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/ml/encoders/normalizer.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/ml/nlp/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/ml/nlp/search.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/ml/time_series/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/ml/time_series/dataset.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/ml/time_series/predictor.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/ml/time_series/trainer.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/ml/time_series/window_generator.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/base.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/job_daemon.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/layouts/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/layouts/base.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/pipeline.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/postprocessors/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/postprocessors/base.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/postprocessors/default.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/audio/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/audio/audio.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/audio/audio_extractor_process.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/aws.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/base.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/file/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/file/archive.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/album.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/album_in_image.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/depth_esimation.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/embeddings.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/filters.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/generators.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/histogram.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/mask.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/object_detection.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/resize.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/segmentation.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/image/watermark.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/media_info.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/nlp/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/nlp/address.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/qr.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/base.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/dataset.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/time_series/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/time_series/predictor.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/time_series/trainer.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/tpu_base.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/generators.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/motion_detection.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/resize.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/video_album.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/video_frames.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/video/video_resample.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/queues.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/server.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/web/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/web/server.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/tools/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/tools/video_interactive.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/base.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/dataset/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/dataset/object_detection.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/evaluation/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/evaluation/markdown.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/evaluation/object_detection.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/images/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/images/base.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/images/description.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/images/embeddings.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/images/object_detection.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/images/tools.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/images/transformers.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/nlp/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/nlp/embeddings.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/nlp/tokenizers/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/nlp/tokenizers/bpe.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/video/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/ml/video/description.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/monitoring/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/monitoring/monitor.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/monitoring/power/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/monitoring/power/ems300.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/monitoring/power/sim.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/monitoring/power/tools.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/monitoring/start.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/monitoring/watchdog/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/monitoring/watchdog/base.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/monitoring/watchdog/process.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/network/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/network/camera.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/network/sniffer.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/network/tools.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/array.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/aws/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/aws/priority_queue.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/aws/s3.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/common.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/complexity.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/compress.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/configuration.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/crypto.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/daemon.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/draw/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/draw/contours.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/formating.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/hardware.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/http.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/logger.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/os.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/queue.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/random.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/remote.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/simple_counter.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/synchronized.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/timers.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/tools/totp.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/web/__init__.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo/web/common.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo.egg-info/dependency_links.txt +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo.egg-info/entry_points.txt +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo.egg-info/requires.txt +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/sciveo.egg-info/top_level.txt +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/setup.cfg +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/setup.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/test/test_complexity.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/test/test_compress.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/test/test_configuration.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/test/test_crypto.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/test/test_eval_markdown.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/test/test_ml_datasets.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/test/test_monitoring.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/test/test_runner.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/test/test_sampling.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/test/test_tokenizers.py +0 -0
- {sciveo-0.1.74 → sciveo-0.1.75}/test/test_totp.py +0 -0
|
@@ -27,8 +27,9 @@ def main():
|
|
|
27
27
|
parser.add_argument(
|
|
28
28
|
'command',
|
|
29
29
|
choices=[
|
|
30
|
-
'init', 'monitor', 'scan',
|
|
31
|
-
'
|
|
30
|
+
'init', 'monitor', 'scan',
|
|
31
|
+
'nvr', 'rtsp',
|
|
32
|
+
'predictors-server', 'media-server', 'media-run',
|
|
32
33
|
'watchdog',
|
|
33
34
|
],
|
|
34
35
|
help='Command to execute')
|
|
@@ -46,9 +47,12 @@ 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')
|
|
@@ -94,6 +98,22 @@ def main():
|
|
|
94
98
|
elif args.command == 'nvr':
|
|
95
99
|
from sciveo.media.capture.nvr import VideoRecorder
|
|
96
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)
|
|
97
117
|
elif args.command == 'media-server':
|
|
98
118
|
from sciveo.media.pipelines.server import __START_SCIVEO_MEDIA_SERVER__
|
|
99
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()
|
|
@@ -29,9 +29,11 @@ sciveo/db/read_table.py
|
|
|
29
29
|
sciveo/media/__init__.py
|
|
30
30
|
sciveo/media/capture/__init__.py
|
|
31
31
|
sciveo/media/capture/cam.py
|
|
32
|
+
sciveo/media/capture/gst_server.py
|
|
32
33
|
sciveo/media/capture/motion_detection.py
|
|
33
34
|
sciveo/media/capture/nvr.py
|
|
34
35
|
sciveo/media/capture/readers.py
|
|
36
|
+
sciveo/media/capture/rtsp.py
|
|
35
37
|
sciveo/media/ml/__init__.py
|
|
36
38
|
sciveo/media/ml/base.py
|
|
37
39
|
sciveo/media/ml/encoders/__init__.py
|
sciveo-0.1.74/sciveo/version.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/audio/audio_extractor_process.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/time_series/__init__.py
RENAMED
|
File without changes
|
{sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/time_series/predictor.py
RENAMED
|
File without changes
|
{sciveo-0.1.74 → sciveo-0.1.75}/sciveo/media/pipelines/processors/sci/time_series/trainer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|