-
Notifications
You must be signed in to change notification settings - Fork 21
Guide to Image URLs
CameraProxy can open most IP cameras via the jpg
, mjpg
, and vlc_transcode
camera types. Regardless of which of these camera types you choose, CameraProxy makes the video available in JPEG, WebP, PNG, and M-JPEG formats. (you can also request an mjpeg stream with WebP or PNG encoding, by using advanced encoding parameters)
The image/
segment of the URL is new since CameraProxy version 1.6.
e.g. For CameraProxy 1.6 the correct URL format is: http://cameraproxy:44456/image/cameraid.jpg
For CameraProxy 1.3.8 and older, the equivalent URL is: http://cameraproxy:44456/cameraid.jpg
http://cameraproxy:44456/image/cameraid.jpg
JPEG snapshots (supported by practically any web browser)
http://cameraproxy:44456/image/cameraid.webp
WebP snapshots (supported by Google Chrome)
http://cameraproxy:44456/image/cameraid.png
PNG snapshots (supported by practically any web browser)
http://cameraproxy:44456/image/cameraid.mjpg
M-JPEG stream. Supported by most modern web browsers. M-JPEG streams one jpeg image after another in the same connection, providing a better frame rate at the cost of higher bandwidth usage.
You can add URL parameters to the JPEG and M-JPEG URLs to modify the image encoding.
size
- [1-100] Default Value: 100
Change the size of the image to a percentage of its original size.
quality
- [1-100] Default Value: 80
Change the encoding quality of the image. Applies to JPEG and WebP output formats.
format
- {"jpg", "webp", "png"} Default Value: "jpg"
Encode the image in a new format. Overrides the image format that would have been used otherwise.
rotate
- {-270, -180, -90, 0, 90, 180, 270} Default Value: 0
Rotate the image in 90 degree increments.
maxwidth
and maxheight
- Default Value: 0
Shrink image if necessary to make it fit in a rectangle with the dimensions maxwidth x maxheight. Preserves aspect ratio. Both parameters must be set greater than 0 for either of them to be considered.
special
- {"red"} Default Value: ""
A parameter reserved for testing. Currently, if you pass "red" as the value it will turn the image red.
http://cameraproxy:44456/image/cameraid.jpg?size=50
http://cameraproxy:44456/image/cameraid.mjpg?maxwidth=320&maxheight=240
http://cameraproxy:44456/image/cameraid.jpg?quality=10
http://cameraproxy:44456/image/cameraid.jpg?quality=10&format=webp
http://cameraproxy:44456/image/cameraid.mjpg?quality=10&format=webp
http://cameraproxy:44456/image/cameraid.jpg?rotate=90
http://cameraproxy:44456/image/cameraid.webp?format=jpg
http://cameraproxy:44456/image/cameraid.mjpg?quality=10&maxwidth=1280&maxheight=99999&rotate=180&format=webp
The most efficient way to request images is to request them as jpg or mjpg without using any of the advanced formatting parameters. This allows the image encoding step to be skipped entirely for jpg and mjpg camera types, resulting in minimal CPU usage.
PNG encoding is not recommended, as it greatly increases bandwidth usage.
WebP encoding uses more CPU time on the server than JPEG encoding, but has the benefit of better image quality and bandwidth usage.