Main Content

Image Acquisition

Acquire images from IP camera

Create a connection to an IP camera using the ipcam object. To create the object, you need the URL of the camera. If the camera requires authentication, specify a user name and password. The URL must either be Motion JPEG (mjpeg) over HTTP/RTSP or H.264 over RTSP streams.

Use the snapshot function to acquire images from an IP camera. You can acquire a single image or set up a loop to acquire multiple images. Use the preview function to test the camera stream.

For examples showing how to connect and tips for finding the IP camera URL and stream Codec, see Connect to IP Cameras.


ipcamCreate ipcam object to acquire images from an IP camera
previewPreview live video data from IP camera
snapshotAcquire single image frame from an IP camera
closePreviewClose IP camera preview window


Find IP Camera URL

Find the URL of your IP Camera.

Set Properties for IP Camera Acquisition

Set device specific properties of the IP camera during or after object creation and using the webread function.

Acquire Images from IP Cameras

Learn how to use the snapshot function to acquire one image frame from an IP camera and display it.

Acquire IP Camera Images in a Loop and Create an AVI File

Acquire multiple image frames from an IP camera, and log the images to an AVI file using MATLAB® VideoWriter.

Featured Examples