HPWREN Camera Image Access and Download Overview
March 18, 2021
Images and videos seen on the various HPWREN camera sites, such as /cameras,
are available to the public for download from our archives. The only requirement for their usage is to
provide attribution to HPWREN (http://hpwren.ucsd.edu) if images are published. See
/a_and_d.html for details.
The latest HPWREN camera images and videos are available in various display formats at
Recent collections of images and videos are found in the directory structure described in #2 below.
HPWREN servers capture, process, publish and archive images and videos around the clock
(images are captured once per minute, videos every three hours). This data is collected from a
few hundred camera image sources around San Diego, Imperial, and Orange County with new
cameras being added regularly. Our archives are spread across multiple servers and we provide
multiple tools for their access. Images are stored as jpg files and videos are stored as mp4 files.
Our Archives data back to around 2000 with past images coalesced into (and replaced by) mp4
videos to reduce storage requirements. Those mp4 videos can be downloaded and from them
the (very near) original jpg files can be re-extracted, if desired, using ffmpeg. This is most
readily done on a Unix system (sample re-extraction command line: “ffmpeg -i Q4.mp4 -f
image2 -qscale 0 -vcodec mjpeg Q4-%03d.jpg”) but ffmpeg is available on Windows as well.
See an example perl script for recovering jpg images from our mp4 files in Appendix A at the
end of this document.
HPWREN provides a number of mechanisms for users to search for, view, and if desired download single
or multiple images and videos (in custom packaged zip files when larger amounts of data are requested).
These tools include the following:
- Direct web download of single current image or video (via /cameras).
Images visible on /cameras can be directly downloaded (individually) after
their selection (e.g. after clicking on them once with your mouse) with a right-click of the mouse
and selection of "Save image as …" dialog for downloading to your local computer.
- Manual web search for specific past images or videos (via /cameras).
Click on the location link generally above the images (which is usually labeled with the camera
location followed by "360 degree panorama". There you will find links to current and past images
(the “data” links) and videos (called "Animations") from the selected camera. Following these links
you will be taken to a list of dates for image collections. Navigate this list to locate images or
videos of interest. Browse into the year/date of your choice, and then select one of the Q1-Q8
directory or the MP4 directory. The former will take you into a directory with 3 hours of jpg images and the latter will take you into the directory with the MP4 video for those periods. The Q prefixed directories and filenames refer to specific 3 hour image time periods as follows:
- Q1: 0000-0259 Q2: 0300-0559 Q3: 0600-0859 Q4: 0900-1159
- Q5: 1200-1459 Q6: 1500-1759 Q7: 1800-2059 Q8: 2100-2359
Browsing into these directories will allow you to individually download files from that location
using your mouse as you did in section #1 above.
- Manual web search of full archive for specific past images or videos.
Pointing your browser to http://c1.hpwren.ucsd.edu/archive/ will take you to HPWREN's image
archive. There you will find links to current and past images and videos, organized by camera
name and then by date (after browsing down into a specific camera and then into the "large"
directory). Browse into the year/day of your choice, and then select one of the Q1-Q8 entries or
the MP4 entry. The former will take into a folder with 3 hours of jpg images and the latter will take
you into the folder with the MP4 data for those periods. The Q prefixed directory and filenames
refer to specific 3 hour image time periods as follows:
-
- Q1: 0000-0259 Q2: 0300-0559 Q3: 0600-0859 Q4: 0900-1159
- Q5: 1200-1459 Q6: 1500-1759 Q7: 1800-2059 Q8: 2100-2359
- File Explorer graphical interface to all images and videos using https://nextcloud.hpwren.ucsd.edu.
Pointing your browser to the above link will take you to NextCloud, a File Explorer like interface
supporting the navigation, display and bulk download of selected images. As directed at the
bottom of the NextCloud login page, please login using username “archive” and password
“public_user” (without the double-quotes). From there you can navigate using point and click
similar to how you would do it on your Windows PC or Mac desktop. See the
“Locating_HPWREN_images_and_videos.pdf” file on NextCloud for details on where to look for
specific camera image locations (double click to open and read the pdf file).
Select folder path to targeted images (select and click, or double click in the space following the
folder name to navigate). Select one or more images (right click to select range of images). After
one or more files are selected, you can download them in a bulk zip file with a right click select of
"Download". Click the … icon after selection to see other options.
- Database search for all images and videos with specific criteria across spans of time and cameras
(via http://c1.hpwren.ucsd.edu/tools/fetch-cam-images.html).
This tool allows you to select from a range of criteria to choose images and videos for bulk
download (via customized zip files). It presents a web form allowing the selection of those criteria,
including combinations of the choices of:
- - One or more days of interest
- - One or more cameras of interest (from pulldown list of all cameras)
- - One or more 3 hour span collections of jpg and/or mp4 files
- - All images matching the above
- - Images at specific times of day only
- - First image (only) of each 3 hour selected period
- - Only jpg images
- - Only mp4 images
- - Only motion detected images
After selecting the desired options, click on the "Submit" button and the system will go off and
collect your images and place them in a zip file for your download. This interface supports finer
grain selection criteria and much larger image collection downloads (and consequently may take
some time after you click on "Submit" until your download link is presented, up to a minute per
camera per day/date). We may also add the ability to generate custom animations using this tool
in the future.
All the above tools are easier to use if you know the mapping of the camera names to the location. We
have a guide for that at http://c1.hpwren.ucsd.edu/tools/camera-locations.txt (or in NextCloud named
“Locating_HPWREN_images_and_videos.pdf”) which will list the locations of the cameras and, for
cameras that are no longer active, the date they became inactive.
If you are interested in our cameras image return rates, we also have two tools available to show return
rates for the previous 24 hours:
To see all image return rates, select "Summary" and click "Submit". You can also select individual
cameras.
We hope you find these tools useful and encourage any feedback you may have for us at
/contactForm4.html
Appendix A
Perl script example for recovering jpg images from mp4 files
The following perl script shows how to re-extract the original jpg files to their original (unix
epoch data string) filenames. Assumes you downloaded mp4 file from http://c1.hpwren.ucsd.edu/archive/sp-s-mobo-c/large/2018/20180806/MP4/ and the index file
from http://c1.hpwren.ucsd.edu/archive/sp-s-mobo-c/large/2018/20180806/Q4/ and placed them in local folder Q4:
#!/usr/local/bin/perl
# cd to target directory ... Q4
$vname=$ARGV[0]; # e.g.: Q4.mp4
$vdesc=$ARGV[1]; # e.g.: 20170708_syp-n-mobo-c_Q4-Source-file-ctime.txt
if($vdesc !~ "ctime"){die("need proper parameters....");}
open(I,"$vdesc") || die("Cannot open input file $vdesc");
system("ffmpeg -i ../MP4/$vname -f image2 -qscale 0 -vcodec mjpeg %05d.jpg");
while() {
($if,$ofname,@r)=split(" ",$_);
rename("$if.jpg","$ofname");
}
close(I);