SoftBank Robotics documentation What's new in NAOqi 2.8?

ALVideoRecorder API

NAOqi Vision - Overview | API | Tutorial


Namespace : AL

#include <alproxies/alvideorecorderproxy.h>

Methods

bool ALVideoRecorderProxy::isRecording()
Returns:
  • true if the robot is currently recording a video.
  • false otherwise.
int ALVideoRecorderProxy::getCameraID()
Returns:Current camera ID.
int ALVideoRecorderProxy::getColorSpace()
Returns:Current color space.
int ALVideoRecorderProxy::getFrameRate()
Returns:Current video framerate.
int ALVideoRecorderProxy::getResolution()
Returns:Current frame resolution.
std::string ALVideoRecorderProxy::getVideoFormat()
Returns:Current video format used to encode video. See ALVideoRecorderProxy::setVideoFormat for the list of possible return values.
void ALVideoRecorderProxy::setCameraID(const int& cameraID)

Sets the camera used for recording.

Parameters:
  • cameraID – New camera ID. Must be either 0 (top camera) or 1 (bottom camera).
void ALVideoRecorderProxy::setColorSpace(const int& colorSpace)

Sets the color space used.

Parameters:
  • colorSpace – New color space. It can be either kBGRColorSpace (color) or kYuvColorSpace (gray scale).
void ALVideoRecorderProxy::setFrameRate(const int& frameRate)

Sets the number of frames per second (FPS).

Parameters:
  • frameRate – New frame rate between 1 and 30 (with a maximum of 15 FPS in VGA resolution).

Note

MJPG format requires a frame rate greater than 2 FPS.

void ALVideoRecorderProxy::setResolution(const int& resolution)

Sets the frame resolution.

Parameters:
  • resolution – New resolution, either 0 (QQVGA), 1 (QVGA) or 2 (VGA).
void ALVideoRecorderProxy::setVideoFormat(const std::string& videoFormat)

Sets the codec name used to encode the video.

Parameters:
  • videoFormat
    • “IYUV” (raw avi, color video only)
    • “MJPG” (compressed avi, gray scale and color video)
void ALVideoRecorderProxy::startRecording(const std::string& folderPath, const std::string& fileName)

There are two overloads of this function:

Starts recording a video with the current parameters until ALVideoRecorderProxy::stopRecording is called. If the destination file already exists, it will be overwritten.

Parameters:
  • folderPath – Path were the video file will be save.
  • fileName – Name used to save the video. If the name does not end with ”.avi”, the file extension ”.avi” will be automatically added.

Note

Only one record at a time can be made.

void ALVideoRecorderProxy::startRecording(const std::string& folderPath, const std::string& fileName, const bool& overwrite)

Starts recording a video with the current parameters until ALVideoRecorderProxy::stopRecording is called.

Warning

Due to technical issues, do not use ARV format anymore.

Parameters:
  • folderPath – Path were the video file will be save.
  • fileName – Name used to save the video. If the name does not end with ”.avi”, the file extension ”.avi” will be automatically added.
  • overwrite – If you set this value to false and the destination file already exists, the method will return and throw an exception. No data will be saved on disk and the existing file will be preserved.

Note

Only one record at a time can be made.

AL::ALValue ALVideoRecorderProxy::stopRecording()

Stops a video record that was launched with ALVideoRecorderProxy::startRecording. The function returns the number of frames that were recorded, as well as the video absolute path.

Returns:Array of two elements [numRecordedFrames, recordAbsolutePath].