Question

We have a desktop client with several hundreds of users in our company. Sometimes it throws exceptions and crashes, but it's been hard to get the users to report their issues. To track these exceptions we are catching them and e-mailing the stacktrace and user specific data relating to the crash to a server wherefrom we then can view a log of all the crashes.

What would be really nice, is if we could log, not only the exception details, but also a screen recording video clip, of say the last 2 minutes up until the exception.

It shouldn't be very hard, all we need is some software that continuously records the screen and saves the video on drive, but erases everything older than a certain number of minutes. When the crash occurs we have can simply pick the current videoclip and attach it along with the exception details.

Anyone know of such a software, or anything similar that would solve our issue?

----------Solved: I used both AndrewThompson´s and pjvds answers below. Andrews strategy outline, but with C# instead of Java, simply because our application is written in C#. The Code Project article pjvds linked helped me on how to do it in C#.

Was it helpful?

Solution

Here is one strategy:

  1. Define a ScreenGrab object that encapsulates a BufferedImage and other relevant information (e.g. the time in millis or the mouse location).
  2. Gain a screenshot using either the Robot or by establishing a BufferedImage the size of the content pane, and painting the content pane to the Graphics instance obtained from the image.
  3. Create a ScreenGrab object and add it to an ArrayList
  4. If the array list has exceeded a certain size, delete the first ScreenGrab in the list.
  5. Rinse & repeat, perhaps at 2FPS, until an error occurs.
  6. Either:
    1. Use an adapted version of JpegImagesToMovie (uses the JMF) to transform the images (with pseudo mouse drawn in) to a MOV.
    2. Zip all the ScreenGrab objects and send the archive instead.

Tweaks on this technique. The advantage of sending the ScreenGrab archive are multiple.

  1. It can record the GUI perfectly, without the 'lossy' effect typical of JPEG compression.
  2. If the user leaves the computer, neither the screen nor mouse position will change. So compare each one to the last and if the details are the same, skip storing it. The MOV would have to be at constant frame rate, but the Zip of custom objects could record at whatever rate best suits the user activity.

OTHER TIPS

I remember I tried some code from a Code Project article years ago to accomplish the same. Capture Activities on Screen in a Movie.

We removed it from our software a release later due a lot of complains. People don't like it when their boss records their screen ;-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top