SoftBank Robotics documentation What's new in NAOqi 2.8?

ALVideoRecorder Tutorial

NAOqi Vision - Overview | API | Tutorial


This tutorial explains how to run the ALVideoRecorder functions using Python.

Getting a proxy to ALVideoRecorder

After some initialization steps, we first instantiate a proxy to the ALVideoRecorder module.

# This test demonstrates how to use the ALVideoRecorder module.
# Note that you might not have this module depending on your distribution
import os
import sys
import time
from naoqi import ALProxy

# Replace this with your robot's IP address
IP = ""
PORT = 9559

# Create a proxy to ALVideoRecorder
  videoRecorderProxy = ALProxy("ALVideoRecorder", IP, PORT)
except Exception, e:
  print "Error when creating ALVideoRecorder proxy:"
  print str(e)

Record a video file

videoRecorderProxy.setResolution(2) # Set resolution to VGA (640 x 480)
# We'll save a 5 second video record in /home/nao/recordings/cameras/
videoRecorderProxy.startRecording("/home/nao/recordings/cameras", "test")
print "Video record started."


videoInfo = videoRecorderProxy.stopRecording()
print "Video was saved on the robot: ", videoInfo[1]
print "Total number of frames: ", videoInfo[0]