Image History: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 15: Line 15:
* libcurl must be available when compiling midas
* libcurl must be available when compiling midas
* The current webcam image must be accessible via a URL (http or https)
* The current webcam image must be accessible via a URL (http or https)
* The webcam features are configured in the [[/History ODB tree#images|/History/Images]] section of the ODB
* The webcam features are configured in the [[/History ODB tree#Images_subtree|/History/Images]] section of the ODB
* [[Mlogger|mlogger]] is running.
* [[Mlogger|mlogger]] is running.


You can log multiple webcams, and specify the recording period and storage duration independently for each.
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 <code>/Logger/Data dir</code> in the ODB).
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 <code>/Logger/History dir</code> in the ODB (or <code>/Logger/Data dir</code> if <code>/Logger/History dir</code> is not defined).


== Tips for finding your webcam's image URL ==
== Tips for finding your webcam's image URL ==
Line 36: Line 36:
== Configuring the ODB ==
== Configuring the ODB ==


See the [[/History ODB tree#images|/History/Images]] documentation.
See the [[/History ODB tree#Images_subtree|/History/Images]] documentation.


== Using the web interface for viewing images ==
== Using the web interface for viewing images ==

Latest revision as of 10:55, 25 June 2020


Links

Overview

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/History dir in the ODB (or /Logger/Data dir if /Logger/History dir is not defined).

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.