Main Content

closePreview

Close IP camera preview window

Add-On Required: This feature requires the MATLAB Support Package for IP Cameras add-on.

Description

closePreview(cam) closes the IP camera preview window for the ipcam object cam. You can close the preview at any time using the closePreview function. If you do not explicitly close the preview, it closes when you clear the ipcam object.

example

Examples

collapse all

You can open or close the IP camera preview window any time after creating the ipcam object.

Create an object, cam, using the URL of the IP camera. The URL address is for a Motion JPEG (mjpeg) HTTP stream.

cam = ipcam('http://172.28.17.193/video.mjpeg')
cam = 

Display Summary for ipcam:

             URL: 'http://172.28.17.193/video.mjpeg'
        Username: ''
        Password: ''
         Timeout: 10
             

Preview the image from the camera.

preview(cam)

The preview window opens and displays live video stream from your camera. The banner of the preview window shows the camera URL. The lower portion of the window shows the timestamp in seconds, resolution, and the frame rate in frames per second. Timestamp is the elapsed time since the object was created.

Close the preview.

closePreview(cam)

The preview window closes.

Version History

Introduced in R2015a