The Opentrons OT-2 has a camera built in to its chassis, positioned to get a view of the deck. It has a resolution of 640x480px for still images and 320x240px for video.

The camera can be used in two ways: taking a picture (can only be a still image) through the HTTP API of the robot, and saving images or video from the robot's terminal.

Advanced Usage Warning

While the OT-2 does have a built-in camera, the software functionality behind this feature is still in development. The existing iteration of the camera functionality is considered an advanced usage of the OT-2 features. We will support you in all efforts to be able to use this feature, but there are limitations to what we can support and what the camera can do.

Known Limitations

  1. If you take photos while the OT-2 is in motion it can render the OT-2 unresponsive.

Where the camera is located on the OT-2

Taking images with HTTP

You can send an HTTP request to the OT-2 to have it take a picture.


Robot's IP address. See below.



HTTP method


HTTP path


Special HTTP headers

Opentrons-Version: 2

(header required since OT-2 software version 4.0.0)

The OT-2 will respond with the picture in the response body, with Content-Type: image/jpeg.

For instance, you can find your robot's IP address from the Opentrons App:

In this image, the robot's IP address is 

You can then use an application like Postman, wget, or curl to send a POST request to

Taking images and video from the robot's command line

Sometimes, taking a still image is not enough, or you want to handle the images from the robot itself. In this case, you can SSH into the robot and use the ffmpeg utility to interact with the camera directly.

1. Connect to your OT-2 with SSH

See Connecting to Your OT-2 With SSH.

2. Invoke ffmpeg

Once you can run commands on the robot, you can use the pre-installed ffmpeg utility to save pictures and video. Full documentation on this interface can be found online.

Example: save an image

ffmpeg -y -f video4linux2 -s 640x480 -i /dev/video0 -ss 0:0:1 -frames 1 /data/user_storage/image.jpg 

This will save a 640x480 (-s 640x480 ) JPEG image (-ss 0:0:1 -frames 1 ) from the camera (-i /dev/video0) to a file in the /data/user_storage  directory named image.jpg .

Example: save a video

ffmpeg -y -video_size 320x240 -i /dev/video0 -t 00:00:01 /data/user_storage/video.mp4
This will save 1 second (-t 00:00:01 ) of 320x240 video (-video_size 320x240 ) from the camera (-i /dev/video0 ) to a file in the /data/user_storage  directory named video.mp4 .

Taking images and video from a Python protocol

To integrate the camera into your protocol, use the Python subprocess module to invoke the ffmpeg  commands above. For instance, to save an image from the camera from a protocol you might do this:

import subprocess

def run(protocol):
if not protocol.is_simulating():
subprocess.check_call(['ffmpeg', '-y', '-f', 'video4linux2', '-s',
'640x480', '-i', '/dev/video0', '-ss', '0:0:1',
'-frames', '1', '/data/user_storage/image.jpg'])

contents = open('/data/user_storage/image.jpg', 'rb').read()
protocol.comment('The OT-2 Just took a picture!')

 And the image file would be in the variable contents

Note that the code that takes the picture is wrapped in if not protocol.is_simulating()  to avoid taking pictures during protocol simulation.

Downloading image and video files from the robot to your computer

You can use SCP to download the files you just created. See: Copying Files To and From Your OT-2 With SCP.

You can also save your files under the /var/lib/jupyter/notebooks directory, which will allow them to be accessed through your robot's Jupyter Notebook.

Did this answer your question?