Skip to content

Commit a3c9b15

Browse files
committed
Add create rtstream
1 parent 2934798 commit a3c9b15

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

videodb/collection.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ def delete_image(self, image_id: str) -> None:
9898
path=f"{ApiPath.image}/{image_id}", params={"collection_id": self.id}
9999
)
100100

101+
def connect_rtstream(self, url: str, name: str, sample_rate: int = 1) -> RTStream:
102+
rtstream_data = self._connection.post(
103+
path=f"{ApiPath.rtstream}",
104+
data={
105+
"collection_id": self.id,
106+
"url": url,
107+
"name": name,
108+
"sample_rate": sample_rate,
109+
},
110+
)
111+
return RTStream(self._connection, **rtstream_data)
112+
101113
def get_rtstream(self, id: str) -> RTStream:
102114
rtstream_data = self._connection.get(
103115
path=f"{ApiPath.rtstream}/{id}",

0 commit comments

Comments
 (0)