I figured out how to parse my remaining 3Gb file showing "This ain't a lv_rec RAW file" using a1ex's hack suggestion early this thread. With the code changes allowing >2Gb but this file still failing, I realized that the footer must not have been written. There are a number of reasons that could have caused this, like a battery dying, and I had footage I wanted to keep. Here's what I did to recover the file, in case anyone finds themselves in this boat.
When I recorded the .RAW, I used the same settings as the previous file in the series.
The previous file (which was only 34M) outputted the following when I processed it with raw2dng
$ /path/to/raw2dng M0000008.RAW
Resolution : 1720 x 720
Frames : 16
Frame size : 2167200 bytes
Frame skip : 1
FPS : 23.976
Processing frame 16 of 16...
Done.
So first, you need to calculate the # frames of the file you want to process.
$ ls -al M0000009.RAW
-rwxrwxrwx 1 david.thomas staff 3101263200 May 22 19:02 M0000009.RAW
Mine is 3101263200 bytes. Then you need a calculator. Divide that file size by the frame size. In my case 3101263200/2167200 = 1430 frames.
Next you need to read the last frame from the working file onto the tail of the broken one.
$ tail -c 2167200 M0000008.RAW >> M0000009.RAW
Next, hack the raw2dng.c file and build:
$ diff -Naur raw2dng.c.orig raw2dng.c
--- raw2dng.c.orig 2013-05-22 18:50:44.000000000 -0700
+++ raw2dng.c 2013-05-22 19:05:44.000000000 -0700
@@ -38,12 +38,8 @@
raw_info = lv_rec_footer.raw_info;
fseek(fi, 0, SEEK_SET);
- if (strncmp((char*)lv_rec_footer.magic, "RAWM", 4))
- FAIL("This ain't a lv_rec RAW file\n");
-
- if (raw_info.api_version != 1)
- FAIL("API version mismatch: %d\n", raw_info.api_version);
-
+lv_rec_footer.frameCount=1430;
+
printf("Resolution : %d x %d\n", lv_rec_footer.xRes, lv_rec_footer.yRes);
printf("Frames : %d\n", lv_rec_footer.frameCount);
printf("Frame size : %d bytes\n", lv_rec_footer.frameSize);
As you can see, I've taken out the checks and hardcoded the frame count.
Yep, it's a hack, but I got 59 seconds of video from my little brother's med school graduation out of it!