CGI commands are used commonly with Axis VAPIX API (see this manual, e.g.). I am sure lots of traditional / older camera APIs use them.
"When it comes to pulling images/streams should you use RTSP links versus CGI links?"
An RTSP link just pulls video. A CGI command / URL can change settings / 'do things'.
"What kind of scripting can you do with CGI links?"
It depends on what commands are supported via CGI. For example, you might use it to control a PTZ camera (see Axis VAPIX PTZ manual). Here's an excerpt from that:
CGI is a way to invoke a command on a host in response to an action on that hosts web server. It goes way back to the early days of the web (mid to early 1990’s). It can be inefficient because it may require a new process fork every time a command is invoked via this interface. And resource leaks were common. Today many web services do not use CGI at all but rather invoke code directly in the web server via extension modules and frameworks designed to support this behavior more efficiently.
I suspect when you say CGI (which is a specific technology used to implement a web service) what you mean is the more generalized usage of a web interface to an IP camera for command and control or configuration of the camera.
Most IP cameras have a web service based API, be that implemented via CGI or otherwise. These APIs have historically been proprietary to individual camera manufacturer’s product lines. Over the past several years a particular standard of API has emerged that is supported by most popular cameras that is called ONVIF. Looking at the commands supported by ONFIV might be a good way to get an overview of the myriad of things one might ask of an IP camera’s API. Another would be to look at the original VAPIX command interface offered by AXIS.
I have used it for years to script cameras (Panasonic, Samsung) to do almost anything. The last thing i want to do on a 400 camera system is to have to keep track and go camera by camera to set the NTP function on, set the server address, change WDR, set the shutter speed, enable motion detection, focus the camera, flip the image, change frame rate, bit rate, etc. I can write a quick script that I can run once, or use it later if needed to run again, or change settings.
I have used this before the various companies had utilities to provide these functions. Even with the utilities, they don't always do every function. Or, if I want a script to refocus the cameras twice a year. I used to use this to enable the manual DST function before it was automated. I would create a scheduled job on a windows or linux server to run the command using WGET.
Very easy to do, but you need access to the CGI API document and a camera to test. Preferrable one of each model. Also, if the firmware changes, you should retest the command.
WGET also keeps a log, so you have a backup of what was done and when.
I would use MS Excel and the concatenate function to assembe the parts of the command, so I could insert a 0 or 1 to enable or disable a command, etc., so I could easily change my template to build a command.
I could in 5 minutes do all of the above commands to hundreds of cameras. If I kept my scripts, the next site is even easier, as I have tested the nuiances of the command.
Just as an aside - this is the type of stuff that VMS manufacturers include in their user interface to allow users to control the camera. It's essentially doing the job of Aaron's spreadsheet, but probably not the way he wants. It's a good solution to help maintain a large number of cameras fairly easily.
Great stuff, more of this would be great. .