Collecting Video Chunks
When you need to collect raw video chunks from the Stratus.
Before you start, write down this info:
1. Find objid of the camera you are trying to grab the chunks from
2. Time (in UTC 24-hour clock) that you want to cover
3. Server IP with that camera on it
4. Download WinSCP or other SCP (Secure Copy Protocol) to move files between Stratus and your Windows/Mac computer
Step-by-step guide
- Login as 'sos' and switch to 'root' user: # su -
- cd to the storage directory 'cd /vasm/store/va-3.3.0'
- cd to the directory for the camera you care about (e.g. if you want camera with objid=101 'cd 101')
- This directory will have a bunch of folders, one for each day. Folder names are YYMMDD format, so today's folder is '140327'. cd to the day you want
- This directory will have even more sub-folders, 2+ for each hour (in UTC 24-hour clock), for example 3-3:30pm local will be in folder 19.0000-00. The time 3:30-3:59 will be in folder 19.0000-01. cd to the desired half-hour. (the current time in utc on the server can be seen with command 'date -u')
In this final folder will be a list of video chunks. Each chunk is 30 seconds in length. The format for a chunk is YYMMDDHHmmss.<format>. For example, the 3 most recent chunks from our demo-10's camera 101 are in Motion JPG format, and their file names are:
140327162430.mjpg
140327162500.mjpg
140327162530.mjpgWhich can be read as 2014-03-27-16:25:00. Each chunk will either end in '00' or '30', since they are made every 30 seconds.
- Now that you have identified which chunks you want, you need to copy them to some place you can see with the sos account, such as the sos home directory. Run 'cp 140327162530.mjpg /home/sos/'
- Now, even though the file is in sos's home, he still does not have permissions to read the file.
- Run the command 'chown sos /home/sos/*' to change every file in sos's home to be owned by the sos user.
- Finally, you can copy these files off of the server. For instance, from my mac i would run 'scp sos@demo-10:*.mjpg ./' to copy all files ending in '.mjpg' in sos's home directory to my current directory.
- From the Windows computer I would use WinSCP logged as 'sos' user. From there you can just drag and drop files to your Windows folders.
I realize it looks complicated due to all the steps, but that is mostly because I was trying to be very descriptive of each step and what the purpose is. You can cut out a lot of those steps and just run something like:
'cp /vasm/store/va-3.3.0/101/140327/16.0000-00/140327192* ~sos/' to copy the entire 10-minute period from 1:20-1:30 to the sos directory, then change the permissions and scp it off the server.
Related articles