Record and visualize cameras#

Parrot Sphinx comes with a few tools to record and visualize video frames:

  • sphinx-cli: command line utility also capable of displaying and recording video frames

  • Web dashboard / sphinx-cli: a multi-step user interface to record video frames

sphinx-cli camera#

sphinx-cli called with the subcommand camera becomes a utility that lets you visualize and record video frames for any simulated camera.

For the most current list of commands and options, execute sphinx-cli camera --help.

Before issuing any further commands, it is helpful to know what cameras are available. Here is how you can generate a list of cameras:

$ sphinx-cli camera -l

Here is an example of how to display camera frames in a new window in real-time:

$ sphinx-cli camera front_streaming

Here is a command line example that records 5 consecutive frames from the front camera and saves them in current directory:

$ sphinx-cli camera front_streaming -n --count=5 -o .

By default, RGB images are saved in PNG format, grayscale images in PGM format, and floating-point images in OpenEXR format.

Using the Web dashboard / sphinx-cli#

Parrot Sphinx is able to record raw video frames into separate files using the Web dashboard, or the sphinx-cli utility.

To do that, open the widget called inspector (see Interact with the simulation for more details), and search for recording parameters. For the camera you want to record:

  • set the directory where to store the output files in recording/path. If kept empty the files are going to be written into Parrot Sphinx’s current working directory.

  • to start the recording, write true or 1 into the recording/enable parameter.

  • to stop it, write false or 0.

By default, images are saved in PNG format. For floating-point images like depth maps, the file format can bet set to Radiance RGBE HDR to preserve the original values. This is done by setting the recording/format parameter to hdr.

The same sequence of operations can be performed from the command line with the sphinx-cli tool by executing a series of param subcommands (see Interact with the simulation for more information on how to use sphinx-cli).

Note

This method is less efficient than sphinx-cli camera because it saves the images on the same thread that receives the frames in Parrot Sphinx.