Unlocking the Stream: A Guide to the Axis mjpg/video.cgi API
If you have ever integrated an Axis network camera into a custom web dashboard, a 3rd-party video management system, or a DIY monitoring script, you have likely encountered the axis-cgi/mjpg/video.cgi endpoint. This Common Gateway Interface (CGI) is the backbone of Motion JPEG (MJPEG) streaming for Axis VAPIX-compatible devices.
While modern protocols like RTSP and H.264/H.265 are more efficient for high-bandwidth surveillance, MJPEG remains a favorite for developers due to its simplicity: it is essentially a series of standalone JPEG images pushed over a single HTTP connection. How to Access the MJPEG Stream
The standard URL to pull a live stream from an Axis camera is: axis cgi mjpg
Most Axis cameras require authentication. Use one of these methods:
session = requests.Session() session.auth = HTTPDigestAuth(username, password)
While MJPEG is king for streaming, check out these related Axis CGI endpoints: Unlocking the Stream: A Guide to the Axis mjpg/video
| Endpoint | Purpose |
|----------|---------|
| /axis-cgi/jpg/image.cgi | Single JPEG snapshot |
| /axis-cgi/com/ptz.cgi | Pan, tilt, zoom control |
| /axis-cgi/param.cgi | Read or set configuration |
| /axis-cgi/io/port.cgi | Control digital I/O ports |
| /axis-cgi/operator/search.cgi | Search recorded video |
Combine them with MJPEG to build a full camera control app.
Note: Exact endpoint availability and path may vary by Axis firmware/model. Common Endpoints (typical patterns)
The CGI script accepts various query parameters to modify the stream on the fly. Common parameters include:
resolution: Sets the image dimensions (e.g., 640x480, 1920x1080).camera: Selects the video source on multi-sensor cameras (e.g., 1, 2, 3, 4).compression: Adjusts the JPEG compression level (0-100).fps: Limits the frame rate.textstring: Overlays text on the video (if supported by the camera).Example URL with parameters:
http://192.168.1.90/axis-cgi/mjpg/video.cgi?resolution=1280x720&fps=15
?clock=0&text=