On-the-Fly Image Conversion

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)

Standard output formats

http://cameraproxy:44456/cameraid.jpg
JPEG snapshots (supported by practically any web browser)

http://cameraproxy:44456/cameraid.webp
WebP snapshots (supported by Google Chrome)

http://cameraproxy:44456/cameraid.png
PNG snapshots (supported by practically any web browser)

http://cameraproxy:44456/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.

Advanced Encoding

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.

Advanced Encoding Examples

http://cameraproxy:44456/cameraid.jpg?size=50

http://cameraproxy:44456/cameraid.mjpg?maxwidth=320&maxheight=240

http://cameraproxy:44456/cameraid.jpg?quality=10

http://cameraproxy:44456/cameraid.jpg?quality=10&format=webp

http://cameraproxy:44456/cameraid.mjpg?quality=10&format=webp

http://cameraproxy:44456/cameraid.jpg?rotate=90

http://cameraproxy:44456/cameraid.webp?format=jpg

http://cameraproxy:44456/cameraid.mjpg?quality=10&maxwidth=1280&maxheight=99999&rotate=180&format=webp

Efficiency

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.

Last edited Apr 15 at 3:03 PM by bp2008, version 2