sciveo 0.1.44__tar.gz → 0.1.45__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.44 → sciveo-0.1.45}/PKG-INFO +1 -1
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/cli.py +4 -1
- sciveo-0.1.45/sciveo/media/tools/nvr.py +143 -0
- sciveo-0.1.45/sciveo/tools/aws/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/queue.py +16 -0
- sciveo-0.1.45/sciveo/version.py +2 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo.egg-info/PKG-INFO +1 -1
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo.egg-info/SOURCES.txt +2 -0
- sciveo-0.1.44/sciveo/version.py +0 -2
- {sciveo-0.1.44 → sciveo-0.1.45}/README.md +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/api/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/api/base.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/api/upload.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/common/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/common/configuration.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/common/model.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/common/optimizers.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/common/sampling.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/content/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/content/dataset.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/content/experiment.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/content/project.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/content/runner.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/ml/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/ml/base.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/ml/encoders/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/ml/encoders/base.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/ml/encoders/normalizer.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/ml/nlp/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/ml/nlp/search.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/ml/time_series/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/ml/time_series/dataset.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/ml/time_series/predictor.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/ml/time_series/trainer.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/ml/time_series/window_generator.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/base.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/job_daemon.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/layouts/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/layouts/base.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/pipeline.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/postprocessors/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/postprocessors/base.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/postprocessors/default.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/audio/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/audio/audio.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/audio/audio_extractor_process.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/aws.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/base.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/file/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/file/archive.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/image/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/image/album.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/image/album_in_image.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/image/depth_esimation.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/image/embeddings.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/image/filters.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/image/generators.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/image/histogram.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/image/mask.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/image/object_detection.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/image/resize.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/image/segmentation.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/image/watermark.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/media_info.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/nlp/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/nlp/address.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/qr.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/sci/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/sci/base.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/sci/dataset.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/sci/time_series/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/sci/time_series/predictor.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/sci/time_series/trainer.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/tpu_base.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/video/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/video/generators.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/video/motion_detection.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/video/resize.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/video/video_album.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/video/video_frames.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/video/video_resample.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/queues.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/server.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/web/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/web/server.py +0 -0
- {sciveo-0.1.44/sciveo/ml → sciveo-0.1.45/sciveo/media/tools}/__init__.py +0 -0
- {sciveo-0.1.44/sciveo/ml/evaluation → sciveo-0.1.45/sciveo/ml}/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/ml/base.py +0 -0
- {sciveo-0.1.44/sciveo/ml/images → sciveo-0.1.45/sciveo/ml/evaluation}/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/ml/evaluation/object_detection.py +0 -0
- {sciveo-0.1.44/sciveo/ml/nlp → sciveo-0.1.45/sciveo/ml/images}/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/ml/images/base.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/ml/images/description.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/ml/images/embeddings.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/ml/images/object_detection.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/ml/images/segmentation.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/ml/images/tools.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/ml/images/transformers.py +0 -0
- {sciveo-0.1.44/sciveo/ml/nlp/tokenizers → sciveo-0.1.45/sciveo/ml/nlp}/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/ml/nlp/embeddings.py +0 -0
- {sciveo-0.1.44/sciveo/ml/video → sciveo-0.1.45/sciveo/ml/nlp/tokenizers}/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/ml/nlp/tokenizers/bpe.py +0 -0
- {sciveo-0.1.44/sciveo/monitoring → sciveo-0.1.45/sciveo/ml/video}/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/ml/video/description.py +0 -0
- {sciveo-0.1.44/sciveo/network → sciveo-0.1.45/sciveo/monitoring}/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/monitoring/monitor.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/monitoring/start.py +0 -0
- {sciveo-0.1.44/sciveo/tools → sciveo-0.1.45/sciveo/network}/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/network/camera.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/network/sniffer.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/network/tools.py +0 -0
- {sciveo-0.1.44/sciveo/tools/aws → sciveo-0.1.45/sciveo/tools}/__init__.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/array.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/aws/priority_queue.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/aws/s3.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/common.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/complexity.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/compress.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/configuration.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/crypto.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/daemon.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/formating.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/hardware.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/http.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/logger.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/os.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/random.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/remote.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/simple_counter.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/synchronized.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo/tools/timers.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo.egg-info/dependency_links.txt +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo.egg-info/entry_points.txt +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo.egg-info/requires.txt +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/sciveo.egg-info/top_level.txt +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/setup.cfg +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/setup.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/test/test_complexity.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/test/test_compress.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/test/test_configuration.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/test/test_crypto.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/test/test_monitoring.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/test/test_runner.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/test/test_sampling.py +0 -0
- {sciveo-0.1.44 → sciveo-0.1.45}/test/test_tokenizers.py +0 -0
|
@@ -25,7 +25,7 @@ def main():
|
|
|
25
25
|
parser.add_argument(
|
|
26
26
|
'command',
|
|
27
27
|
choices=[
|
|
28
|
-
'init', 'monitor', 'scan',
|
|
28
|
+
'init', 'monitor', 'scan', 'nvr',
|
|
29
29
|
'media-server', 'media-run'
|
|
30
30
|
],
|
|
31
31
|
help='Command to execute')
|
|
@@ -75,6 +75,9 @@ def main():
|
|
|
75
75
|
fp.write(line + '\n')
|
|
76
76
|
else:
|
|
77
77
|
info(f"init, [{base_path}] already there")
|
|
78
|
+
elif args.command == 'nvr':
|
|
79
|
+
from sciveo.media.tools.nvr import VideoRecorder
|
|
80
|
+
VideoRecorder(args.input_path).start()
|
|
78
81
|
elif args.command == 'media-server':
|
|
79
82
|
from sciveo.media.pipelines.server import __START_SCIVEO_MEDIA_SERVER__
|
|
80
83
|
__START_SCIVEO_MEDIA_SERVER__()
|
|
@@ -0,0 +1,143 @@
|
|
|
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 subprocess as sp
|
|
14
|
+
import time
|
|
15
|
+
import re
|
|
16
|
+
import json
|
|
17
|
+
import cv2
|
|
18
|
+
import datetime
|
|
19
|
+
|
|
20
|
+
from sciveo.tools.logger import *
|
|
21
|
+
from sciveo.tools.daemon import DaemonBase
|
|
22
|
+
from sciveo.tools.queue import TouchedFilePathQueue
|
|
23
|
+
from sciveo.tools.simple_counter import RunCounter
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class VideoCameraCaptureDaemon(DaemonBase):
|
|
27
|
+
def __init__(self, cam_id, url, dst_path, max_video_len=60, transport="tcp"):
|
|
28
|
+
super().__init__()
|
|
29
|
+
self.cam_id = cam_id
|
|
30
|
+
self.url = url
|
|
31
|
+
self.dst_path = dst_path
|
|
32
|
+
self.max_video_len = max_video_len
|
|
33
|
+
self.transport = transport
|
|
34
|
+
self.cmd = [
|
|
35
|
+
"ffmpeg",
|
|
36
|
+
"-rtsp_transport", self.transport,
|
|
37
|
+
"-i", self.url,
|
|
38
|
+
"-c", "copy",
|
|
39
|
+
"-acodec", "aac",
|
|
40
|
+
"-f", "segment",
|
|
41
|
+
"-segment_time", f"{self.max_video_len}",
|
|
42
|
+
"-reset_timestamps", "1",
|
|
43
|
+
"-strftime", "1",
|
|
44
|
+
f"{self.dst_path}/{self.cam_id}___%Y-%m-%d___%H-%M-%S.mp4"
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
def clear(self):
|
|
48
|
+
os.system(f"pgrep -f \"{self.url}\" |xargs kill -9")
|
|
49
|
+
|
|
50
|
+
files = [f for f in os.listdir(self.dst_path) if os.path.isfile(os.path.join(self.dst_path, f))]
|
|
51
|
+
for file_name in files:
|
|
52
|
+
if file_name.startswith(f"{self.cam_id}___"):
|
|
53
|
+
file_path = os.path.join(self.dst_path, file_name)
|
|
54
|
+
info("RM", file_path)
|
|
55
|
+
os.remove(file_path)
|
|
56
|
+
|
|
57
|
+
def loop(self):
|
|
58
|
+
info("start", self.cam_id)
|
|
59
|
+
while(True):
|
|
60
|
+
self.clear()
|
|
61
|
+
|
|
62
|
+
p = sp.Popen(self.cmd, stdout=sp.DEVNULL, stderr=sp.DEVNULL)
|
|
63
|
+
p.wait()
|
|
64
|
+
|
|
65
|
+
self.clear()
|
|
66
|
+
warning(self.cam_id, "streaming interrupted, wait to retry...")
|
|
67
|
+
time.sleep(5)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class VideoRecorder:
|
|
71
|
+
def __init__(self, path_configuration):
|
|
72
|
+
with open(path_configuration, 'r') as fp:
|
|
73
|
+
self.configuration = json.load(fp)
|
|
74
|
+
self.cams = []
|
|
75
|
+
|
|
76
|
+
for cam_id, cam_config in self.configuration["cam"].items():
|
|
77
|
+
cam = VideoCameraCaptureDaemon(
|
|
78
|
+
cam_id, cam_config["url"],
|
|
79
|
+
self.configuration["path"]["tmp"],
|
|
80
|
+
self.configuration.get("max_video_len", 60),
|
|
81
|
+
self.configuration.get("transport", "tcp")
|
|
82
|
+
)
|
|
83
|
+
self.cams.append(cam)
|
|
84
|
+
|
|
85
|
+
self.queue = TouchedFilePathQueue(self.configuration["path"]["tmp"], period=5, touched_timeout=5)
|
|
86
|
+
self.cleaner_timer = RunCounter(1000, self.clean_old_videos)
|
|
87
|
+
|
|
88
|
+
def start(self):
|
|
89
|
+
for cam in self.cams:
|
|
90
|
+
cam.start()
|
|
91
|
+
|
|
92
|
+
time.sleep(10)
|
|
93
|
+
|
|
94
|
+
while(True):
|
|
95
|
+
try:
|
|
96
|
+
file_name, file_path = self.queue.pop()
|
|
97
|
+
debug("pop", file_name, file_path)
|
|
98
|
+
self.process_file(file_name, file_path)
|
|
99
|
+
self.cleaner_timer.run()
|
|
100
|
+
except Exception as e:
|
|
101
|
+
exception(e)
|
|
102
|
+
time.sleep(1)
|
|
103
|
+
|
|
104
|
+
def process_file(self, file_name, file_path):
|
|
105
|
+
split = file_name.split("___")
|
|
106
|
+
if len(split) == 3:
|
|
107
|
+
cam_id = split[0]
|
|
108
|
+
video_date = split[1]
|
|
109
|
+
video_file_name = split[2]
|
|
110
|
+
else:
|
|
111
|
+
warning("wrong file format, removing", file_name, file_path)
|
|
112
|
+
os.remove(file_path)
|
|
113
|
+
|
|
114
|
+
match = re.match(r"(\d{2})\-(\d{2})\-(\d{2})\.mp4", video_file_name)
|
|
115
|
+
if not match:
|
|
116
|
+
warning("Invalid filename format")
|
|
117
|
+
video_file_name_split = video_file_name.split(".")
|
|
118
|
+
video_file_name = f"{video_file_name_split[0]}-{video_file_name_split[0]}.{video_file_name_split[1]}"
|
|
119
|
+
else:
|
|
120
|
+
hh, mm, ss = map(int, match.groups())
|
|
121
|
+
start_time = datetime.datetime(2000, 1, 1, hh, mm, ss)
|
|
122
|
+
end_time = start_time + datetime.timedelta(seconds=self.configuration["max_video_len"])
|
|
123
|
+
video_file_name = f"{start_time.strftime('%H.%M.%S')}-{end_time.strftime('%H.%M.%S')}.mp4"
|
|
124
|
+
|
|
125
|
+
video_base_path = os.path.join(self.configuration["path"]["video"], cam_id, video_date)
|
|
126
|
+
video_file_path = os.path.join(video_base_path, video_file_name)
|
|
127
|
+
|
|
128
|
+
debug("MV", file_path, "=>", video_file_path)
|
|
129
|
+
os.makedirs(video_base_path, exist_ok=True)
|
|
130
|
+
os.rename(file_path, video_file_path)
|
|
131
|
+
|
|
132
|
+
def clean_old_videos(self):
|
|
133
|
+
try:
|
|
134
|
+
days = self.configuration.get("video_retention_period", 7)
|
|
135
|
+
cmd = "find {} -mtime +{} -type f -delete".format(self.configuration["path"]["video"], days)
|
|
136
|
+
debug("cmd", cmd)
|
|
137
|
+
os.system(cmd)
|
|
138
|
+
except Exception as e:
|
|
139
|
+
excprint([self], e, cmd)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
if __name__ == '__main__':
|
|
143
|
+
VideoRecorder("./cams.json").start()
|
|
File without changes
|
|
@@ -29,3 +29,19 @@ class FilePathQueue:
|
|
|
29
29
|
if self.filter(file_name, file_path):
|
|
30
30
|
return file_name, file_path
|
|
31
31
|
time.sleep(self.period)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class TouchedFilePathQueue(FilePathQueue):
|
|
35
|
+
def __init__(self, path, period, touched_timeout):
|
|
36
|
+
super().__init__(path, period)
|
|
37
|
+
self.touched_timeout = touched_timeout
|
|
38
|
+
|
|
39
|
+
def filter(self, file_name, file_path):
|
|
40
|
+
return self.touched(file_path) > self.touched_timeout
|
|
41
|
+
|
|
42
|
+
def touched(self, path):
|
|
43
|
+
try:
|
|
44
|
+
last_touched = time.time() - os.path.getmtime(path)
|
|
45
|
+
except Exception:
|
|
46
|
+
last_touched = sys.maxsize
|
|
47
|
+
return last_touched
|
|
@@ -87,6 +87,8 @@ sciveo/media/pipelines/processors/video/video_frames.py
|
|
|
87
87
|
sciveo/media/pipelines/processors/video/video_resample.py
|
|
88
88
|
sciveo/media/pipelines/web/__init__.py
|
|
89
89
|
sciveo/media/pipelines/web/server.py
|
|
90
|
+
sciveo/media/tools/__init__.py
|
|
91
|
+
sciveo/media/tools/nvr.py
|
|
90
92
|
sciveo/ml/__init__.py
|
|
91
93
|
sciveo/ml/base.py
|
|
92
94
|
sciveo/ml/evaluation/__init__.py
|
sciveo-0.1.44/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
|
{sciveo-0.1.44 → sciveo-0.1.45}/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.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/sci/time_series/__init__.py
RENAMED
|
File without changes
|
{sciveo-0.1.44 → sciveo-0.1.45}/sciveo/media/pipelines/processors/sci/time_series/predictor.py
RENAMED
|
File without changes
|
{sciveo-0.1.44 → sciveo-0.1.45}/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
|