10000 feat: add rtstream by ankit-v2-3 · Pull Request #43 · video-db/videodb-python · GitHub
[go: up one dir, main page]

Skip to content

feat: add rtstream #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
May 28, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add start and stop camera, update status -> action in update status e…
…ndpoints
  • Loading branch information
ashish-spext committed Mar 19, 2025
commit c048b1583d6fafb99219fe7fd581fd26e0deb348
20 changes: 17 additions & 3 deletions videodb/rtstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ def get_scenes(self, start: int = None, end: int = None, page=1, page_size=100):
def start(self):
self._connection.patch(
f"{ApiPath.rtstream}/{self.rtstream_id}/{ApiPath.index}/{ApiPath.scene}/{self.rtstream_index_id}/{ApiPath.status}",
data={"status": "running"},
data={"action": "start"},
)
self.status = "running"
self.status = "connected"

def stop(self):
self._connection.patch(
f"{ApiPath.rtstream}/{self.rtstream_id}/{ApiPath.index}/{ApiPath.scene}/{self.rtstream_index_id}/{ApiPath.status}",
data={"status": "stopped"},
data={"action": "stop"},
)
self.status = "stopped"

Expand Down Expand Up @@ -109,6 +109,20 @@ def __repr__(self) -> str:
f"status={self.status})"
)

def start(self):
self._connection.patch(
f"{ApiPath.rtstream}/{self.id}/{ApiPath.status}",
data={"action": "start"},
)
self.status = "connected"

def stop(self):
self._connection.patch(
f"{ApiPath.rtstream}/{self.id}/{ApiPath.status}",
data={"action": "stop"},
)
self.status = "stopped"

def generate_stream(self, start, end):
stream_data = self._connection.get(
f"{ApiPath.rtstream}/{self.id}/{ApiPath.stream}",
Expand Down
0