Simple Viewer using Python

The sample shows how to use the Python API of Metavision Core SDK to display events from a live Camera or a RAW file.

The source code of this sample can be found in <install-prefix>/share/metavision/sdk/core/python_samples/metavision_simple_viewer when installing Metavision SDK from installer or packages. For other deployment methods, check the page Path of Samples.

Expected Output

The sample visualizes CD events from an event-based device or a RAW file:

Expected Output from Metavision Simple Viewer Sample

How to start

To start the sample based on the live stream from your camera, run:





To start the sample based on recorded data, provide the full path to a RAW file (here, we use the file spinner.raw from our Sample Recordings):


python3 -i spinner.raw


python -i spinner.raw

Code Notes

This sample is using the class LiveReplayEventsIterator that allows to replay a RAW file approximately at recording speed. A more basic viewer like the one shown in metavision_sdk_get_started is using EventsIterator which will play the file as fast as possible.