Author Topic: How to replace file footer, aka fix the Error: This ain't a lv_rec RAW file  (Read 46312 times)

Shield

  • Senior
  • ****
  • Posts: 254
If you are recording and run out of space on the card, when you try to extract the dng files you'll get the following error:

Error: This ain't a lv_rec RAW file

You need to replace the file footer information to get this back.

Here's what I did, and I'm sure there are easier ways, but this is free.

Step 1:
Download the freeware Hex editor from here:
http://mh-nexus.de/en/downloads.php?product=HxD

Step 2: Open the .raw file in the hex editor.  Scroll all the way to the bottom.

You have 2 choices at this point:

Option 1 - Record another file with the same settings on the card, and retrieve the footer information in the hex editor.  It should be the last 12 lines of the file.  The downside to doing it this way is it'll only extract the same number of DNG files that the secondary file has listed; i.e. if your 2nd file is 200 megs or so, if you copy that file's footer information to the (assuming) larger troubled file, you'll only be able to pull out the first 50 or so dng files.

So I suggest you do #2:

Option 2 - Copy and paste this into your file footer:

52 41 57 4D 80 07 38 04 00 5F 37 00 F4 21 00 00 01 00 00 00 A8 5D 00 00 18 02 98 19 18 02 98 19 01 00 00 00 00 20 15 0B 26 05 00 00 20 08 00 00 38 0E 00 00 50 34 49 00 0E 00 00 00 0C 08 00 00 98 3A 00 00 00 00 00 00 00 00 00 00 88 07 00 00 08 05 00 00 1E 00 00 00 92 00 00 00 26 05 00 00 1A 08 00 00 00 00 00 00 00 00 00 00 00 01 01 02 01 00 00 00 42 1A 00 00 10 27 00 00 85 FD FF FF 10 27 00 00 3D FC FF FF 10 27 00 00 41 EF FF FF 10 27 00 00 AC 30 00 00 10 27 00 00 EC 07 00 00 10 27 00 00 74 FC FF FF 10 27 00 00 72 08 00 00 10 27 00 00 24 16 00 00 10 27 00 00 82 03 00 00

Save the file, and start unpacking your dng's!

This will work for file sizes up to 32gb.
**Of note - say your "bad" file was smaller than 32GB - let's say it was 11GB - by using this footer it will try to unpack 8692 DNG files.  Since I'm not smart enough to read hex, I just estimate where the good dng files should be and delete everything after it.

Here's a screen shot of the pasted in footer:


Shield

  • Senior
  • ****
  • Posts: 254
Since I'm not a programmer or really that smart, I've been doing "trial and error" work on how many frames it will extract.

The key numbers are these:

52 41 57 4D 80 07 38 04 00 5F 37 00 F4 21 00 00 01 00 00 00 A8 5D 00 00 18 02 98 19 18 02 98 19 01 00 00 00 00 20 15 0B 26 05 00 00 20 08 00 00 38 0E 00 00 50 34 49 00 0E 00 00 00 0C 08 00 00 98 3A 00 00 00 00 00 00 00 00 00 00 88 07 00 00 08 05 00 00 1E 00 00 00 92 00 00 00 26 05 00 00 1A 08 00 00 00 00 00 00 00 00 00 00 00 01 01 02 01 00 00 00 42 1A 00 00 10 27 00 00 85 FD FF FF 10 27 00 00 3D FC FF FF 10 27 00 00 41 EF FF FF 10 27 00 00 AC 30 00 00 10 27 00 00 EC 07 00 00 10 27 00 00 74 FC FF FF 10 27 00 00 72 08 00 00 10 27 00 00 24 16 00 00 10 27 00 00 82 03 00 00


So for example if I change "F4 21" to 66 22" it will try to extract 8806 frames, or "6A 29" is over 10,000 frames (10,602 to be exact). 

Here's some sample footers for you:

8806 frames (for corrupt 32GB raw file):  - This is exactly the number of "good" dng files I got from an empty 32GB Lexar recording a full 32GB file @ 1920x1080 with FPS override set to 24FPS.  So the F4 21 has been changed to 66 22.  Not bolded so can copy and paste:

52 41 57 4D 80 07 38 04 00 5F 37 00 66 22 00 00 01 00 00 00 A8 5D 00 00 18 02 98 19 18 02 98 19 01 00 00 00 00 20 15 0B 26 05 00 00 20 08 00 00 38 0E 00 00 50 34 49 00 0E 00 00 00 07 08 00 00 BB 35 00 00 00 00 00 00 00 00 00 00 88 07 00 00 08 05 00 00 1E 00 00 00 92 00 00 00 26 05 00 00 1A 08 00 00 00 00 00 00 00 00 00 00 00 01 01 02 01 00 00 00 42 1A 00 00 10 27 00 00 85 FD FF FF 10 27 00 00 3D FC FF FF 10 27 00 00 41 EF FF FF 10 27 00 00 AC 30 00 00 10 27 00 00 EC 07 00 00 10 27 00 00 74 FC FF FF 10 27 00 00 72 08 00 00 10 27 00 00 24 16 00 00 10 27 00 00 B2 03 00 00

More to follow...




Shield

  • Senior
  • ****
  • Posts: 254
66 11 = 4454  (Roughly the fix for a corrupt 16GB file)

Footer:
52 41 57 4D 80 07 38 04 00 5F 37 00 66 11 00 00 01 00 00 00 A8 5D 00 00 18 02 98 19 18 02 98 19 01 00 00 00 00 20 15 0B 26 05 00 00 20 08 00 00 38 0E 00 00 50 34 49 00 0E 00 00 00 07 08 00 00 BB 35 00 00 00 00 00 00 00 00 00 00 88 07 00 00 08 05 00 00 1E 00 00 00 92 00 00 00 26 05 00 00 1A 08 00 00 00 00 00 00 00 00 00 00 00 01 01 02 01 00 00 00 42 1A 00 00 10 27 00 00 85 FD FF FF 10 27 00 00 3D FC FF FF 10 27 00 00 41 EF FF FF 10 27 00 00 AC 30 00 00 10 27 00 00 EC 07 00 00 10 27 00 00 74 FC FF FF 10 27 00 00 72 08 00 00 10 27 00 00 24 16 00 00 10 27 00 00 B2 03 00 00

(You may need to remove some DNG files at the end; take a look at them in your image viewer software, i.e. Photoshop.  If they look like bad frames you'll know right away.


Shield

  • Senior
  • ****
  • Posts: 254
9e 08 - 2206 frames; should be enough to fix corrupt 8GB file

Begin Footer

52 41 57 4D 80 07 38 04 00 5F 37 00 9e 08 00 00 01 00 00 00 A8 5D 00 00 18 02 98 19 18 02 98 19 01 00 00 00 00 20 15 0B 26 05 00 00 20 08 00 00 38 0E 00 00 50 34 49 00 0E 00 00 00 07 08 00 00 BB 35 00 00 00 00 00 00 00 00 00 00 88 07 00 00 08 05 00 00 1E 00 00 00 92 00 00 00 26 05 00 00 1A 08 00 00 00 00 00 00 00 00 00 00 00 01 01 02 01 00 00 00 42 1A 00 00 10 27 00 00 85 FD FF FF 10 27 00 00 3D FC FF FF 10 27 00 00 41 EF FF FF 10 27 00 00 AC 30 00 00 10 27 00 00 EC 07 00 00 10 27 00 00 74 FC FF FF 10 27 00 00 72 08 00 00 10 27 00 00 24 16 00 00 10 27 00 00 B2 03 00 00




Shield

  • Senior
  • ****
  • Posts: 254
80 04 = 1152 frames; should be exact number for corrput 4GB files.

Footer
52 41 57 4D 80 07 38 04 00 5F 37 00 80 04 00 00 01 00 00 00 A8 5D 00 00 18 02 98 19 18 02 98 19 01 00 00 00 00 20 15 0B 26 05 00 00 20 08 00 00 38 0E 00 00 50 34 49 00 0E 00 00 00 07 08 00 00 BB 35 00 00 00 00 00 00 00 00 00 00 88 07 00 00 08 05 00 00 1E 00 00 00 92 00 00 00 26 05 00 00 1A 08 00 00 00 00 00 00 00 00 00 00 00 01 01 02 01 00 00 00 42 1A 00 00 10 27 00 00 85 FD FF FF 10 27 00 00 3D FC FF FF 10 27 00 00 41 EF FF FF 10 27 00 00 AC 30 00 00 10 27 00 00 EC 07 00 00 10 27 00 00 74 FC FF FF 10 27 00 00 72 08 00 00 10 27 00 00 24 16 00 00 10 27 00 00 B2 03 00 00


Hex is hurting my brain, so that's all for now.  If you want other file sizes let me know.
Shawn

Shield

  • Senior
  • ****
  • Posts: 254
Can a MOD move this to the "workflow" forum?
Thanks!

Shawn

boytecreative

  • Just arrived
  • *
  • Posts: 1
Thanks for your hard work Shield. Looks like you're doing this on a PC platform, you don't know if mac works the same do you?

Copy/Paste didn't work from browser to the editor, so I typed it in by hand, confirmed multiple times, and still haven't had any luck after I save it and then redrop it back into the ML raw2dng converter.

I'm on a 2013 iMac, tried two different editors (010 editor and Hex Fiend), type in the code at the very bottom of the code (is there something I am supposed to do in order to get to the footer?), save it, and then drag the raw file back on to the raw2dng and receive the same error "Error: This ain't a lv_rec RAW file"

I also tried two different file sizes, 4.29gb and 2.99gb.

Any ideas?

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Mac needs newer converter if it can't read over 2.x gb.

Shield

  • Senior
  • ****
  • Posts: 254
Mac needs newer converter if it can't read over 2.x gb.

I see on the new build the footer is auto-saved, which makes my thread rather pointless.  First of all great job, and I guess you can delete this now... :'(

DaveAbbott

  • New to the forum
  • *
  • Posts: 8
Hey guys, how do I work out what I should change the values to?

I've got a 2.68GB file that was shot at 1280 x 720 at 25 fps.

I'm able to extract files using this technique but each frame it extracts is a collage of 9 frames. If I can work out the correct value I can probably recover a nice bit of footage.

Thanks in advance.

Edit: Nevermind. I found a file of very similar size and copied the footer from that. Thanks Shield, I couldn't have done it without you!

DerekDock

  • Freshman
  • **
  • Posts: 59
So I was referred to this thread by the ML twitter to fix what appears to be corrupted RAW files. Anyone know if this works? I see that there are a ton of FFFFFFF hexs at the end of my file but also sporadic patches throughout the file. Fixing the end enables me to run through the process of converting and then to lightroom but it's just Digital pink noise in LR.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Obviously not pointless for people with damaged files.

Paste a footer of correctitude onto the end and re-save.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
You can also upload a small clip (not more than 100MB though, since my net connection is limited).

DerekDock

  • Freshman
  • **
  • Posts: 59
If you guys want one of the clips to dissect let me know but i just went and reshot everything as it seemed too corrupted to fix and the newest build worked smooth. Thanks for all your efforts!

Haliburton

  • New to the forum
  • *
  • Posts: 44
Thanks, Shawn (Shield).

1% is right:

Obviously not pointless for people with damaged files.

Paste a footer of correctitude onto the end and re-save.

The collage of 9 mini-frames that DaveAbbott experienced, appears to happen if the footer is copied from RAW file of a different camera and/or resolution.

What worked for me, was to copy the last 192 bytes (eg. 12 lines x 16 bytes per line; begins with RAWM as seen in the ASCII column) of a file from the same camera shot at the same resolution, and append it to the damaged file, replacing any final truncated line.

At this point, you will only be able to extract as many frames as the file you copied the footer from has, but at least the frame size will be correct, avoiding the mini-frames problem.

Next, replace the 4th group of 4 bytes, as Shield pointed out in bold:

52 41 57 4D 80 07 38 04 00 5F 37 00 F4 21 00 00 01 00 00 00 A8 5D 00 00 18 02 98 19 18 02 98 19 01 00 00 00 00 20 15 0B 26 05 00 00 20 08 00 00 38 0E 00 00 50 34 49 00 0E 00 00 00 0C 08 00 00 98 3A 00 00 00 00 00 00 00 00 00 00 88 07 00 00 08 05 00 00 1E 00 00 00 92 00 00 00 26 05 00 00 1A 08 00 00 00 00 00 00 00 00 00 00 00 01 01 02 01 00 00 00 42 1A 00 00 10 27 00 00 85 FD FF FF 10 27 00 00 3D FC FF FF 10 27 00 00 41 EF FF FF 10 27 00 00 AC 30 00 00 10 27 00 00 EC 07 00 00 10 27 00 00 74 FC FF FF 10 27 00 00 72 08 00 00 10 27 00 00 24 16 00 00 10 27 00 00 82 03 00 00

According to the number of frames you shot (thus size of your *.RAW file), choose the next bigger number of frames according to Shield's list:

66 22 00 00 = 8806 frames  (Roughly the fix for a corrupt 32 GB file at Shield’s resolution of 1920x1080)
66 11 00 00 = 4454 frames  (Roughly the fix for a corrupt 16 GB file at Shield’s resolution of 1920x1080)
9e 08 00 00 = 2206 frames  (Roughly the fix for a corrupt 8  GB file at Shield’s resolution of 1920x1080)
80 04 00 00 = 1152 frames  (Roughly the fix for a corrupt 4  GB file at Shield’s resolution of 1920x1080)

Yes, you'll end up with a garbage .dng files representing the excess of the number chosen above, beyond the actual number of frames you shot, but you can just throw those out.

I’m using hexfiend for Mac http://ridiculousfish.com/hexfiend/

Note to boytecreative: I found that hexfiend would only save changes if "Saved as…" a new file name.

As least in my first few baby steps with hexfield, it didn’t seem to save files in place.

eatbuckshot

  • New to the forum
  • *
  • Posts: 24
wow hahaha just a couple hours ago I also discovered this fix using the same exact program, hxd
trying to save some footage

I am a computer engineer though, and it's helpful to use
https://bitbucket.org/hudson/magic-lantern/src/1222c61e8120e24f2d8fd4836179c5891a4bc20f/modules/lv_rec/lv_rec.h?at=unified
Code: [Select]
#ifndef _lv_rec_h_
#define _lv_rec_h_

#include "raw.h"

/* file footer data */
typedef struct
{
    unsigned char magic[4];
    unsigned short xRes;
    unsigned short yRes;
    unsigned int frameSize;
    unsigned int frameCount;
    unsigned int frameSkip;
    unsigned int sourceFpsx1000;
    unsigned int reserved3;
    unsigned int reserved4;
    struct raw_info raw_info;
} lv_rec_file_footer_t;

#endif
where each char is 1 byte (2 hex characters), short is 2 bytes, and int is 4 bytes, that way you can crossreference the struct definition with the number's you are editing in hex.

the raw hex stores these numbers in "little endian" which means that if you want to obtain the real value of an integer from raw hex you would have to write it in reverse( raw hex: "52 41 57 4D 80 07 38 04 00 5F 37 00 F4 21 00 00 ..."  is 00 00 21 F4 or just 0x21F4)
I used windows calculator in programmer mode to convert from hex to dec quickly (f4 f5)

I used footers from raw videos that were correct to calculate how many frames i had using the framesize field which is the size of a frame in bytes.  I took the file size and divided by the frame size to get a rough rounded down frame count that i would translate into hex, into little endian and write into the raw hex in that location in the footer.

Shield

  • Senior
  • ****
  • Posts: 254
I recorded a 64GB file tonight and the footer was MIA.

Here's the HEX that is slightly larger than for a 64GB file, but should cover all 64GB 1920x1080 23.976 files:

52 41 57 4D 80 07 38 04 00 5F 37 00 66 46 00 00 01 00 00 00 A8 5D 00 00 18 02 98 19 18 02 98 19 01 00 00 00 00 20 15 0B 26 05 00 00 20 08 00 00 38 0E 00 00 50 34 49 00 0E 00 00 00 0C 08 00 00 98 3A 00 00 00 00 00 00 00 00 00 00 88 07 00 00 08 05 00 00 1E 00 00 00 92 00 00 00 26 05 00 00 1A 08 00 00 00 00 00 00 00 00 00 00 00 01 01 02 01 00 00 00 42 1A 00 00 10 27 00 00 85 FD FF FF 10 27 00 00 3D FC FF FF 10 27 00 00 41 EF FF FF 10 27 00 00 AC 30 00 00 10 27 00 00 EC 07 00 00 10 27 00 00 74 FC FF FF 10 27 00 00 72 08 00 00 10 27 00 00 24 16 00 00 10 27 00 00 82 03 00 00

It will unpack 18022 frames.

Shawn

MarkvC

  • New to the forum
  • *
  • Posts: 2
This is my first post on this forum so i apologise if this has been answered else where but i searched and this is the only thread that came up.
I shot 15 clips of which 6 went over the 4gb mark. The card still had approximately 13gb of spaced remaining. I used Raw2DNG version 0.13 to convert the clips to DNG's. Of all the clips only the ones that whet over the 4gb mark came up with this error:
Error: This ain't a lv_rec RAW file
I have been through this process and replaced the footer for a 4.29gb file with the 8GB  footer from above and when i tried to open the DNG image sequence in After Effects i got a lot of very corrupt looking images with psychedelic colors in them.
Please help 
This is not some thing that I can reshoot as it was dolphins feeding on small fish. :( :( :(

xfornos

  • New to the forum
  • *
  • Posts: 2
MarkVc, I have the same problem, with a file 4'13GB.
I need the solution, it's so important.

Thank you.

Barry Williams films

  • New to the forum
  • *
  • Posts: 2
MarkV Im having the same problem also.....Man I thought I had it.......SMH

Gigi_Five

  • Just arrived
  • *
  • Posts: 1
The problem is:
CF is fat32 so file longer than 4GB does not have enough addressing space so ML splits the file and writes info of entire recording to last file. This is what you have to do, you must join those two files on some other file system i.e. (NTFS). The command is simple:

for example if you have "M29-1817.RAW" and "M29-1817.R00", then the command is (in command prompt):
copy /b M29-1817.RAW + M29-1817.R00 M29-JOINED.RAW

this is for windows, there must be some similar command on mac for joining files.

it worked for me..

Regards

BrotherD

  • New to the forum
  • *
  • Posts: 49
If you are recording and run out of space on the card, when you try to extract the dng files you'll get the following error:

Error: This ain't a lv_rec RAW file

You need to replace the file footer information to get this back.

Here's what I did, and I'm sure there are easier ways, but this is free.

Step 1:
Download the freeware Hex editor from here:
http://mh-nexus.de/en/downloads.php?product=HxD

Step 2: Open the .raw file in the hex editor.  Scroll all the way to the bottom.

You have 2 choices at this point:

Option 1 - Record another file with the same settings on the card, and retrieve the footer information in the hex editor.  It should be the last 12 lines of the file.  The downside to doing it this way is it'll only extract the same number of DNG files that the secondary file has listed; i.e. if your 2nd file is 200 megs or so, if you copy that file's footer information to the (assuming) larger troubled file, you'll only be able to pull out the first 50 or so dng files.

So I suggest you do #2:

Option 2 - Copy and paste this into your file footer:

52 41 57 4D 80 07 38 04 00 5F 37 00 F4 21 00 00 01 00 00 00 A8 5D 00 00 18 02 98 19 18 02 98 19 01 00 00 00 00 20 15 0B 26 05 00 00 20 08 00 00 38 0E 00 00 50 34 49 00 0E 00 00 00 0C 08 00 00 98 3A 00 00 00 00 00 00 00 00 00 00 88 07 00 00 08 05 00 00 1E 00 00 00 92 00 00 00 26 05 00 00 1A 08 00 00 00 00 00 00 00 00 00 00 00 01 01 02 01 00 00 00 42 1A 00 00 10 27 00 00 85 FD FF FF 10 27 00 00 3D FC FF FF 10 27 00 00 41 EF FF FF 10 27 00 00 AC 30 00 00 10 27 00 00 EC 07 00 00 10 27 00 00 74 FC FF FF 10 27 00 00 72 08 00 00 10 27 00 00 24 16 00 00 10 27 00 00 82 03 00 00

Save the file, and start unpacking your dng's!

This will work for file sizes up to 32gb.
**Of note - say your "bad" file was smaller than 32GB - let's say it was 11GB - by using this footer it will try to unpack 8692 DNG files.  Since I'm not smart enough to read hex, I just estimate where the good dng files should be and delete everything after it.

Here's a screen shot of the pasted in footer:



Shield I hope you or someone can help me out. Today is the first time I have seen the "This ain't a lv_rec Raw file" problem so I need  help fixing this raw file.

My problems are: Copying the number there are two options: paste write and paste insert? One way, or maybe both, I did it twice,  pasted in the right column with the symbols. In your screen shot the symbols are at the right of the numbers you copied?  I was hoping but not surprised that method did not work.  Now it is time to seek help. This was an 8gb card and the file is 281mbs. Is there a way to avoid this from happening again?

Derrick   


BrotherD

  • New to the forum
  • *
  • Posts: 49
I am still need help opening a 288mb "This ain't a lv_rec Raw file." Raw2dng or Eyeframe could not open it. The file was on a 8gb sd card that only had three raw files, none larger than 488mb's on it? I tried to follow the instructions by copying and saving the "numbers" twice to the file using the HxD program? Somebody help!

Derrick

jas.brooks

  • New to the forum
  • *
  • Posts: 14
Can confirm that this method worked for me on OS X. I had a corrupted (header-less) file caused by filling the card whilst shooting (I'm 99% sure).

Using a free hex editor called "0xED.app" I copied the last 12 lines (16 bytes per line) from another shot with similar settings. Replaced the file size bytes (bytes 13 & 14) with the code for a 4gb file, and once converted, just deleted the blank black frames.

Thanks Shield! Nice method. :-)

jason

clapalm

  • New to the forum
  • *
  • Posts: 6
The problem is:
CF is fat32 so file longer than 4GB does not have enough addressing space so ML splits the file and writes info of entire recording to last file. This is what you have to do, you must join those two files on some other file system i.e. (NTFS). The command is simple:

for example if you have "M29-1817.RAW" and "M29-1817.R00", then the command is (in command prompt):
copy /b M29-1817.RAW + M29-1817.R00 M29-JOINED.RAW

this is for windows, there must be some similar command on mac for joining files.

it worked for me..

Regards

I'm having the same problem and I am using a Mac.  Can anyone please suggest the Mac solution for joining the .RAW and .R00 files?

Thanks

clapalm

  • New to the forum
  • *
  • Posts: 6
Thru a friend I discovered how to join files on a Mac using Terminal.  Here is the link to the article:

http://shar.es/zOvt1

It worked! Was able to join my .RAW, .R00 and R01 file together into a single file that raw2dng was able to create .dng files with! Happy Day.

alexp

  • New to the forum
  • *
  • Posts: 30
Re: How to replace file footer, aka fix the Error: This ain't a lv_rec RAW file
« Reply #26 on: September 03, 2013, 01:21:41 AM »
So I was referred to this thread by the ML twitter to fix what appears to be corrupted RAW files. Anyone know if this works? I see that there are a ton of FFFFFFF hexs at the end of my file but also sporadic patches throughout the file. Fixing the end enables me to run through the process of converting and then to lightroom but it's just Digital pink noise in LR.

I was able to join .R00 and .RAW files together using Terminal. I was also able to extract DNGs by pasting footer using Hex Friend. But all my DNGs have pink noise now. Any ideas?

silvertonesx24

  • Freshman
  • **
  • Posts: 73
  • 5Dii
Re: How to replace file footer, aka fix the Error: This ain't a lv_rec RAW file
« Reply #27 on: September 07, 2013, 09:24:22 PM »
But all my DNGs have pink noise now. Any ideas?

Same exact thing here each time I've tried this method.

ifleeter

  • New to the forum
  • *
  • Posts: 19
Re: How to replace file footer, aka fix the Error: This ain't a lv_rec RAW file
« Reply #28 on: September 10, 2013, 07:24:44 PM »
My RAW file wouldn't work in the RAW2DNG.exe so I downloaded HxD and put the numbers in the footer. My RAW file now converts to DNG but after the first frame all the rest have Pink in them.


dangerh33@mac.com

  • New to the forum
  • *
  • Posts: 9
Re: How to replace file footer, aka fix the Error: This ain't a lv_rec RAW file
« Reply #29 on: September 12, 2013, 02:17:11 AM »
Same issue, here need help! Is there any way to salvage this footage? The RAW files appear full size to what we shot, just getting all jumbled pink craziness.

pedrosuarez

  • New to the forum
  • *
  • Posts: 9
Re: How to replace file footer, aka fix the Error: This ain't a lv_rec RAW file
« Reply #30 on: September 15, 2013, 04:14:37 AM »
I posted a workflow in this thread that I believe solves the "neon pink" photo issue.. Hopefully it's beneficial for you.

http://www.magiclantern.fm/forum/index.php?topic=8237.0

vprocessing

  • New to the forum
  • *
  • Posts: 13
Re: How to replace file footer, aka fix the Error: This ain't a lv_rec RAW file
« Reply #31 on: September 17, 2013, 09:37:30 AM »
Hi to all !

I'm discovering RAW with the 50D…AND It is Awesome !!!!!!!!!
I had on my 2nd time test shooting 2 problems with the "This ain't a lv_rec RAW file"
First was with a splitted file so I joined them with terminal and it was OK for use with RawMagic
The second is a clip who had "skipped frame"…the 50D just got blocked on the skippinng frame I had to pull out battery.
Then I have a 4,29 .RAW file and a 807ko .R00 file…
I've tried to change the footer with the 4GB one like before on this thread…
I just pasted it at the end of the file with Hexfiend…so the file was recognized by RawMagic but it is all purple crazyness !!!!
Am I doing the procedure bad ?
To finish, As I had this skipped frame I wanted to benchmark my Komputerbay x1000 UDMA7 64Go…the 5min benchmark never ends…
The buffer card bench give me results about 43,7MB/s, 40,1MB/s,44,1MB/s, 46,1MB/s (for this value buffer=19371k)
Should I send it back for exchange ?

Spring Pictures

  • New to the forum
  • *
  • Posts: 9
I posted a workflow in this thread that I believe solves the "neon pink" photo issue.. Hopefully it's beneficial for you.

http://www.magiclantern.fm/forum/index.php?topic=8237.0

Hi pedrosuarez
I have had no luck trying your technique.  My clips were cut short when the camera shut off automatically at 4mins. Also one when the battery died.
They are all approx 15GB in size, I have used the appropriate Hex code each time I've tried your technique (in thread above).
I'm working on Mac and didn't receive "Error: This ain't a lv_rec RAW file" they simply just don't create anything inside the DNG folder when placed in raw2dng, no ProRes either.  I also tried RAWMagic.
I have tried with both the merged files and the original files straight from camera.
These files are very very important to me so any help with be deeply appreciated.  I'm also happy to Paypal anyone who is willing to work it through with me. Thanks, Dylan

santogallo

  • Just arrived
  • *
  • Posts: 1
Hi... I'm new to all of this, I mean shooting with ML hack on the MkIII which I find truly AWESOME, quality of the DNG files are just amazing compared to the H264 native codec, I've been looking for that cine look for years, so anyways I've been testing my camera for the first time and I've got the same situation with corrupt files either when the file gets larger than 4gb or when the card is full, so first of all I had to reformat all my CF cards to the exFAT format on Mac, then my solution after looking and trying several times was the easiest and obvious (Yeah 2 days later of trying), copy the footer of a non-corrupted file that weighs aprox. the same than the corrupted one, all of this with the Hex program, and just copy/paste the footer, that's all.

Dimasan

  • New to the forum
  • *
  • Posts: 2
Re: How to replace file footer, aka fix the Error: This ain't a lv_rec RAW file
« Reply #34 on: February 18, 2014, 11:20:24 PM »
Here's what worked for me:
Been running across the issue of pink/flashing frames when trying to convert my spanned RAW files to DNGs. I've been recording to FAT32 cards, so file size was limited and files spanned to multiple RAW files (RAW, R00, R01, etc)
All of my problem files have been at the end of the card, when the card filled up and the camera rolled out, before it had a chance to write the footer.
None of the converters even recognized these files, labeling them with crazy resolutions (23453x51246) and Framerates (-69.345).
I looked around and found this forum, which was a godsend.
Shield's Hex fix worked flawlessly for the files that did not span across multiple 4GB files - Thank you!

Those that did span, however, still provided a corrupted image.
I cross-checked similar takes from the card, and noticed that the footer for spanned files is actually longer than the one posted by Shield, so I grabbed the longer length of the footer, making sure to choose a take that was similar length, but slightly longer to compensate for the extra frames, and pasted it at the end of the corrupted spanned file.
Then, I used RAWanizer to open the file and convert to DNG+Cineform Proxy.

Been checking out the proxies, and the problem has been resolved!
And the converter actually truncates the file automatically, so there are no extra frames to worry about at the end.
Here are the steps again:

1. Open the last spanned file of the corrupted clip in HxD or another Hex editor (the ones with extension .R04, .R05, etc. Not the .RAW file)
2. Open the last spanned file of a non-corrupted clip in HxD. Preferably one of the same extension and slightly larger file size (ie. if you opened M16-1700.R05 in Step 1 with a size of 1GB, then this file would ideally be something like M16-1646.R05 with a size of 1.1GB or larger.)
3. Copy the footer from the non-corrupted file to the end of the corrupted file. For me it was the last 28 lines, starting with the tags A5 A5 A5 A5... - see image below.
4. Open the file in the converter, and it should recognize it and be able to process it. RAWanizer was the only one I have tried so far, but I'm sure it would work with any of them after this point.

If you're in doubt, I suggest repeating Step 2 for several non-corrupted files and checking for similarities in the footer.

Hope this helps!

Code: [Select]
A5 A5 A5 A5 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
55 55 AA AA 55 55 AA AA 55 55 55 55 AA AA AA AA
52 41 57 4D 80 07 38 04 00 60 37 00 87 1F 00 00
01 00 00 00 A8 5D 00 00 48 48 04 00 00 00 00 00
01 00 00 00 00 20 15 0B 26 05 00 00 20 08 00 00
38 0E 00 00 50 34 49 00 0E 00 00 00 FE 07 00 00
98 3A 00 00 00 00 00 00 00 00 00 00 88 07 00 00
08 05 00 00 1E 00 00 00 92 00 00 00 26 05 00 00
1A 08 00 00 00 00 00 00 00 00 00 00 00 01 01 02
01 00 00 00 42 1A 00 00 10 27 00 00 85 FD FF FF
10 27 00 00 3D FC FF FF 10 27 00 00 41 EF FF FF
10 27 00 00 AC 30 00 00 10 27 00 00 EC 07 00 00
10 27 00 00 74 FC FF FF 10 27 00 00 72 08 00 00
10 27 00 00 24 16 00 00 10 27 00 00 EF 03 00 00


psiconauta

  • Just arrived
  • *
  • Posts: 1
Re: How to replace file footer, aka fix the Error: This ain't a lv_rec RAW file
« Reply #35 on: February 26, 2014, 05:51:08 PM »
Hi everyone, I've been using 0xED to correct the hex with the footer i found on this forum and I was able to convert all my "NAN" RAW files into cinema DNG. Now I do have a new situation:
I purchased a 128gb 1000x lexar CF and my corrupt files is over 64gb, around 86gb. Is anyone able to help me out with that?
I mean to calculate the footer for such a big file or to teach me how to do it myself?
Thanks a lot,
Psiconauta

LEVISDAVIS

  • Member
  • ***
  • Posts: 134
This technique is rock solid for recovering files! I simply re-recorded another file with the same resolution and frame rate and took the last lines of information from that file and pasted it to the original corrupt file. Now I don't even have one pink-frame or skipped frame throughout the entire shot or nearly 15 minutes! Thanks.
Levi S. Davis

sines

  • New to the forum
  • *
  • Posts: 24
  • Director
When pasting the footer from another spanned file of shorter length, both raw2dng and RAWMagic Lite on the Mac truncate the sequence to the number of frames of the shorter sequence of 827 frames. So instead showing the entire 19 GB clip [spanned over an original 5 files] I am only seeing 827 frames instead of ... 2400 or so.

So I tried the hex value in the code from above, which would create a sequence of 1920x1080, 8071 frames [23.976fps]. Since I am shooting at 1.85:1, the res is 1920x1038, 23.976 fps, but a unknown sequence length since the clip got trimmed. Any idea on how to change the Y res in hex to 1038 so that RAWMagic thinks it's of a sequence longer than 827 frames?

I did a search of 0x438 in hex [1080] and there are just too many values & instances of it to sift through to have it make any sense.
Director | DoP | Creative Director
Arri Alexa · Arri IIC · Arritechno 35-90 · Blackmagic Pocket Cinema 6K · Canon 5D MKIII · DJI Focus, Matrice 600, Inspire 2, Ronin, Ronin-MX · Zeiss Standard Speeds · Zeiss Superspeed Contax Primes

phamnguyendo

  • Just arrived
  • *
  • Posts: 1
I also have some similar problem like Sines. I have 3 .RAW files and each is 4.29GB, the camera stopped recording. Instead of recording at 1920x1080, I shot at 1920x768, and when I pasted the code, it allows me to unpack the files again. But it doesn't turn out right, the resolution is at 1920x1080 and the smaller images in this frame keep overlaying each other. Is there a code to paste that would be fitting for 1920x768? Please help! I'd much appreciate your awesomeness. 

patdosanjh

  • Just arrived
  • *
  • Posts: 1
Preferably one of the same extension and slightly larger file size[/b] (ie. if you opened M16-1700.R05 in Step 1 with a size of 1GB, then this file would ideally be something like M16-1646.R05 with a size of 1.1GB or larger.)

That turned out for me to be a very important thing!!! Otherwise I would end in getting pink frames! So be sure to copy the footer from a .R0? - File with the same file ending!

Else I had some mistakes in the beginning not letting the Terminal (Mac-User!) merging the files to the end. Because there is no process displayed in the terminal and the file is created in the first second you may think terminal is finished but it is not! Depending on the file sizes it took up to 7 minutes and more! Two ways to find out if Terminal has finished:
1) When done Terminal shows up a new line beginning with your mac username+$
2) If you try to close Terminal while being in a progress it will give you a warning which says that the current action is not finished: cat

Maybe that can help somebody, I finally got all my clips working and was very happy about non-repeatable footage :)

Good luck!