pystreaming.video package¶
Subpackages¶
Submodules¶
pystreaming.video.collect module¶
- class pystreaming.video.collect.CollectDevice(endpoint, seed)[source]¶
Bases:
pystreaming.video.device.DeviceCreate a collection device.
Binds to a zmq PULL socket and republishes through a PUSH socket.
- Parameters
endpoint (str) – Descriptor of stream publishing endpoint.
seed (str) – File descriptor seed (to prevent ipc collisions).
pystreaming.video.dec module¶
- class pystreaming.video.dec.DecoderDevice(nproc, seed, fwdbuf=False)[source]¶
Bases:
pystreaming.video.device.DeviceCreate a multiprocessing frame decoder device.
- Parameters
nproc (int) – Number of decoding processes.
seed (str) – File descriptor seed (to prevent ipc collisions).
fwdbuf (bool, optional) – True if we forward the compressed frame. Defaults to False.
- handler(timeout)[source]¶
Yield a package of data from the decoder pool.
- Parameters
timeout (int) – Timeout period in milliseconds.
- Yields
list – [arr, buf, meta, ftime, fno] or None, if timeout is reached.
- recv(timeout=60000)[source]¶
Receive a package of data from the decoder pool.
- Parameters
timeout (int, optional) – Timeout period in milliseconds.
to None to wait forever. Defaults to 60_000. (Set) –
- Raises
TimeoutError – Raised when no messages are received in the timeout period.
- Returns
[arr, buf, meta, ftime, fno].
- Return type
list
pystreaming.video.device module¶
- class pystreaming.video.device.Device(dfunc, dkwargs, nproc)[source]¶
Bases:
objectBackground running device.
- Parameters
dfunc (function) – Function to run in background. Must have ‘shutdown’ and ‘barrier’ as arguments.
dkwargs (dict) – Kwargs to pass to dfunc.
nproc (int) – Number of background processes to launch.
pystreaming.video.dist module¶
- class pystreaming.video.dist.DistributorDevice(tracks, endpoint, seed)[source]¶
Bases:
pystreaming.video.device.DeviceCreate a multiprocessing frame distributor device.
- Parameters
tracks (list) – List of strings, where each string describes a track.
endpoint (str) – Descriptor of distributor endpoint.
seed (str) – File descriptor seed (to prevent ipc collisions).
pystreaming.video.enc module¶
- class pystreaming.video.enc.EncoderDevice(nproc, seed)[source]¶
Bases:
pystreaming.video.device.DeviceCreate a multiprocessing frame encoder device.
- Parameters
nproc (int) – Number of encoding processes.
seed (str) – File descriptor seed (to prevent ipc collisions).
pystreaming.video.pub module¶
- class pystreaming.video.pub.PublisherDevice(endpoint, seed)[source]¶
Bases:
pystreaming.video.device.DeviceCreate a publisher device.
Binds to a zmq PULL socket and republishes through a PUB socket.
- Parameters
endpoint (str) – Descriptor of stream publishing endpoint.
seed (str) – File descriptor seed (to prevent ipc collisions).
pystreaming.video.req module¶
- class pystreaming.video.req.RequesterDevice(source, track, nthread, seed)[source]¶
Bases:
pystreaming.video.device.DeviceCreate a asyncio frame requester device.
- Parameters
source (str) – Descriptor of stream endpoint.
track (str) – Video stream track name.
nthread (int) – Number of requester threads.
seed (str) – File descriptor seed (to prevent ipc collisions).
pystreaming.video.sub module¶
- class pystreaming.video.sub.SubscriberDevice(endpoint, seed)[source]¶
Bases:
pystreaming.video.device.DeviceCreate a multiprocessing subscriber.
Connects to a zmq SUB socket and republishes through a PUSH socket.
- Parameters
endpoint (str) – Descriptor of stream publishing endpoint.
seed (str, optional) – File descriptor seed (to prevent ipc collisions). Defaults to “”.