Skip to main content

Starting a Stream

To start a stream through the SDK, use the steps below :
1

Create a Stream Object

2

Discover Available Sources

Example console output would look like the following:
3

Select a Source

If no source is set explicitly, index 0 is used by default.
4

Start Streaming

Once started, the stream will begin capturing video from the selected source functions can be run on the stream from its respective index. For example:

Best Practices

Some best practices for streaming:
  1. Verify devices first with ms.sources()— ID ordering can change between reboots.
  2. Combine live Stream sessions with batch upload() to cover both real-time and historical footage.
  3. Keep streams short when testing (ms.start(10)) to conserve local and network resources.
  4. Use search or inquire during a live session to build interactive dashboards or alerts.

string
required
Index that receives the live feed.Must have been created with performance=True

Stream() methods
Returns List[str]—the display-ready names of cameras or screens detected on your machine.
int
required
The integer ID shown by .sources()
int
Optional. Duration to stream in seconds.
Omit or pass Noneto run until manually stopped.