Image History

From MidasWiki
Revision as of 11:19, 24 June 2020 by Bsmith (talk | contribs)
Jump to navigation Jump to search



It is possible to use the midas history system to periodically record images from a network-connected webcam, for later playback through the midas history webpage. The midas data logger will automatically grab the current image from the webcam, and store it on disk.

Requirements for this system to work:

  • libcurl must be available when compiling midas
  • The current webcam image must be accessible via a URL (http or https)
  • The webcam features are configured in the /History/Images section of the ODB
  • mlogger is running.

You can log multiple webcams, and specify the recording period and storage duration independently for each.

Note that although normal midas history variables can be logged to a database, the images from webcams are always only stored as files on disk (in the directory specified in /Logger/Data dir in the ODB).

Tips for finding your webcam's image URL

Depending on the brand of your webcam, it may trivial or tedious to find the correct URL for getting the current image. In the best case, the URL is specified in the user manual. More often, you need to do a bit of digging.

The best place to start is by loading your camera's normal web interface. Depending on how the page is coded, you should be able to find the correct URL by either:

  • Right-clicking the image and choosing "Copy Image Location" or similar (only works if the web interface is using a raw "img" tag to display the image)
  • Looking at the source code of the webpage (for example if the web interface specifying the URL as a CSS property)
  • Opening the Network tab of your browser's Developer Tools, reloading the page, and finding the request that loaded an image (should work in almost all cases)
  • Googling for help on your specific webcam brand/model

For AXIS cameras, the URL is typically http://<name>/axis-cgi/jpg/image.cgi

Configuring the ODB

See the /History/Images documentation.

Using the web interface for viewing images

An example from the MEG experiment is shown below.

MEG image history.png

You can go "backwards" in time and browse all stored images. The buttons at each image allow you to step backward, forward, and play a movie of images, forward or backward. You can query for a certain date/time and download a specific image to your local disk. You can even synchronize all time axes, drag left and right on each image to see your experiment from different cameras at the same time stamps. You see a blue ribbon below each image which shows time stamps for which an image is available.

Initially, only the most recent image is loaded to speed up loading time. As soon as you click on the image or one of the arrow buttons, previous images are loaded progressively, which you can see in the ribbon bar becoming blue. For slow internet connections this can take some time. For typical webcams and one minute update period you get typically a few GB per week.