Post date: Oct 11, 2014 3:07:22 PM
After struggling with integrating a USB Webcam with CrossMgr for over a year, I realized that a different approach was required.
The solution was to manage the camera in a separate application, CrossMgrCamera. CrossMgrCamera constantly shows what the camera sees, and maintains a 10 second circular video buffer.
When CrossMgr needs to take a photo, it sends a message to CrossMgrCamera. CrossMgrCamera then finds the video frames before and after the given time, then adds photo header, writes the photos to a file and uploads them to the server with ftp (if necessary).
As long as CrossMgr sends a request within 10 seconds of the required time. the required video frames will be available in the buffer. There is no need for a "real-time" link between the applications. Photos will not get dropped if CrossMgr gets busy.
This solves a number of problems with the old approach:
CrossMgrCamera can be run before the race starts. This important to ensure it is plugged in, working and the camera is positioned correctly.
CrossMgrCamera continuously shows what the camera sees. This is important if the camera gets bumped or the light changes.
CrossMgrCamera can maintain a constant frame rate with the USB Webcam because it is a separate process. When the camera was handled in CrossMgr, it could drop frames when it got busy doing other things (like getting results).
As CrossMgr is continuously sampling, there are no missed photos due to delays connecting to the USB Webcam.
CrossMgrCamera can be started/restarted before or during a race. Errors (like losing the connection to the camera) will not affect CrossMgr - it will continue to run.
To get CrossMgrCamera and the latest version of CrossMgr, see the new Downloads page.