How do I repair a corrupt Ladybug stream file?

Applicable products

Ladybug6

Ladybug5+

Problem

Sometimes a Ladybug stream file can become corrupted due to errors in the header. When this happens LadybugCap Pro and the stream repair utility are unable to read the stream file. 

Solution

Prevent

To prevent corruption of files, add an extra loop in your code to purge the first ten frames before beginning a recording.

LadybugImage image;                                   
    for (int i = 0; i < 10 && error != LADYBUG_OK; i++)
    {                                                  
        printf(".");                                   
        error = ::ladybugGrabImage(context, &image);   
    }                                                  

Repair

If a stream file is unreadable it can be repaired by removing the first frame.

From the bin/bin64 folder of LadybugCap Pro, run ladybugStreamCopy in a command prompt.

Run with the following arguments:

<C:\*location of stream file*> <C:\*location of copy destination*> default 1

This copies from frame 1 to the end of the file and leaves out frame 0 (the first frame).

Contact support if needed.