ALVideoRecorder

NAOqi Vision - Overview | API | Tutorial


What it does

The ALVideoRecorder module allows you to record video sequences using the robot cameras and save them on disk.

StartRecording and StopRecording

These two functions are used to record AVI videos on the robot.

Note

Video recording can be quickly accessed using Monitor, which internally uses ALVideoRecorder’s functions.

They are quite straightforward to use. Just call ALVideoRecorderProxy::startRecording() passing the video name as argument. NAO will then start to record what it can see with its active camera. The record is done using the module’s parameters (color space, frame rate, resolution, video format). All these parameters can be set using the appropriate methods (see the API section). Please note that the frame rate may go down below the specified value depending on what is running on the robot.

Note

startRecording is not a blocking function, it launches a separate thread that performs the video recording.

When you want to stop the record, call ALVideoRecorderProxy::stopRecording(). The record is then saved on the robot in using the file path and name you specified.

Warning

Please note that you can only have one active record at a time. If you want to know if there is an active record, you can call ALVideoRecorderProxy::isRecording().

Note

If you don’t manually set the parameters, the following ones will be used by default:

  • Color space: BGR
  • Frame rate: 15 frames per second (FPS)
  • Resolution: QVGA (320 x 240)
  • Video format: MJPG

Performances and limitations

Among the different available video formats, MJPG should be preferred since it compresses the video and produces smaller video files. This leads to better performance when ALVideoRecorderProxy::stopRecording() is called. With uncompressed formats such as ARV or IYUV a call to this method can take much longer time to complete.

Getting started

The easiest way to get started with most of these features is to use the corresponding Choregraphe vision boxes. Recording capabilities can be easily used through the camera panel of Monitor. You will also find working examples on the Tutorial page.