View Full Version : Tool for processing corrupt Quicktime files
Tramm Hudson July 19th, 2009, 02:36 PM I have a Quicktime from my 5D that was corrupted by my code trying to adjust timing parameters while recording. It won't open in the camera, nor in any of the usual tools, including the very forgiving VLC. Does anyone have any suggestions for tools that will allow recovery of the frames near the end of the file to verify the fps?
Sample corrupt file (http://www.mediafire.com/download.php?eztzz2i3jw3), featuring a watch face with a second hand to verify correct timing.
Tom Daigon July 19th, 2009, 03:42 PM Tramm, I tried opening it with After Effects CS3 which is my go to swiss army knife for problematic files (and way cool effects). No go. It said the file was unrecognizable. Same for FCP and Quictime.
(Dont forget about 29.97 ;-) )
Dan Chung July 19th, 2009, 05:52 PM Tramm,
Will the file play in the camera?
Dan
Tom Daigon July 19th, 2009, 06:31 PM "It won't open in the camera, nor in any of the usual tools..."
A quote from Tramm.
Tramm Hudson July 19th, 2009, 06:32 PM Will the file play in the camera?
No, unfortunately not.
I'm trying to figure out if anything has actually changed in the recording or if my code only messed up the Quicktime header, before I spend too much time chasing down the code that uses those parameters in the mvr_struct.
Chris Barcellos July 19th, 2009, 06:53 PM Can't seem to download the file, to check it out, but the title it is showing is getting me fired up.... !! I didn't think you were trying to go there yet..... Is there a limit to download activity on that site ? Wonder if Youtube or Vimeo could convert it. I would try a cineform coversion if I could down load it.
Tom Daigon July 19th, 2009, 09:13 PM It downloaded just fine for me, but as I said the tools I use for troublesome video could
not open it and gave an error of unknown file type.
Ray Bell July 20th, 2009, 05:17 AM There may be some info in this thread that might help...
http://www.dvinfo.net/conf/cineform-software-showcase/146035-qt-frame-rate-change-please.html
Robert Esmonde July 20th, 2009, 06:17 AM Tramm,
don't want to overburden you with links but found this and thought it might help.
web3null: how to fix a broken quicktime mov file (http://web3null.blogspot.com/2007/09/how-to-fix-broken-quicktime-mov-file.html)
Jay Bloomfield July 20th, 2009, 09:06 AM I'd start with looking over the QT file format specification:
http://developer.apple.com/documentation/QuickTime/qtff/qtff.pdf
and then downloading one of the freeware QT metadata editors/viewers. Since there are a number of them for both PCs and Macs, you best bet is to use Google to suit your OS. The next step would be to examine all the various atoms and entries for the video track and see if you see any problems. It also may be possible to change key entries in the trak atom, such that the corrupted frames are not read.
Have you tried QT Player Pro? Sometimes that will read MOV files with corrupted entries. VLC and most other players usually just give up and show no video window.
Thomas Richter July 20th, 2009, 05:32 PM Robert and Jay,
thank you very much for your input. I used it to modify the file in a Hex editor (fix atom length) and then copy and paste the media data (so called moov box or moov Atom) into the file.
It opens fine now!!! The disappointment was that it showed blank (dark green screen in Quicktime, white in TMPEG Enc).
I don't have a 5D, so if anyone has, it would be great if someone could make a file with c.a. 40 mb available, then I could paste perfectly fitting media data (clip length wise). I had to use the media info from a much smaller file.
Tramm,
does that mean you are beginning to play with the framerates? I totally missed this thread based on it's comparatively low-key title.
If you intend to corrupt more files in future I may be able to code you a small fixing software ;)
If someone else is interested reproducing the fix: (WARNING - very geeky)
Correct the first unsigned Int32 specifying the length of the second Atom to match the file length minus the length of the first Atom (first Atom has a length of 24 bytes). So from the 25th byte it should read 00 00 00 08 and changed to 02 AF 01 87.
Then paste the media data (moov Atom) of another 5D file at the end. Try to get one that is close in size or slightly smaller.
So when you are done, the file should have three atoms: FTYP, MDAT and MOOV
Will post the file tomorrow (it's very late here in Europe now).
Thomas
Tramm Hudson July 20th, 2009, 06:11 PM does that mean you are beginning to play with the framerates? I totally missed this thread based on it's comparatively low-key title.
It was deliberately low-key to avoid getting everyone's hopes up. While looking for something related to bracketing I saw code in the mvrRecStart() function that used a value in the mvr_struct to write values into the Quicktime header (and maybe the DIGIC engine). The tantalizing bits were that the computed values were 3000/100 == 30.00, 30000/1001 = 29.97 and 5994/100 = 59.94.
So I added some code that wrote new values into the structure when movie recording started to see if it would do the right thing. It still isn't clear if it did it or not, or if this is even the route to go down for adjusting the frame rate. There are lots of places where fps==30 seem to be hardcoded (like in mvrRecstart() and SetVideoInformation()).
Chris Barcellos July 20th, 2009, 08:10 PM Finally downloaded.
Corrupt in Cineform, won't convert.
Corrupt in Virtual dub
Currupt in Vegas.
Jay Bloomfield July 20th, 2009, 08:23 PM I just checked the file with QT Atom Viewer and the mdat atom is corrupt. Everything beyond that in the file cannot be read properly, because the length of each atom entry is stored with each atom and if the length doesn't match the atom's actual data length, the entire atom is corrupt.
If the MOV file metadata is corrupt, you are stuck using a hex editor (I use HHD Neo). Else, Apple's own Dumpster is the best way to edit MOV files, on a PC, except for Vista x64.
Tom Daigon July 20th, 2009, 08:30 PM It sounds like Thomas & Jay maybe on to something that addresses things more at a software level rather then the variety of apps we have all tried with no success.
Thomas Richter July 21st, 2009, 03:01 PM I just checked the file with QT Atom Viewer and the mdat atom is corrupt. Everything beyond that in the file cannot be read properly, because the length of each atom entry is stored with each atom and if the length doesn't match the atom's actual data length, the entire atom is corrupt.
If the MOV file metadata is corrupt, you are stuck using a hex editor (I use HHD Neo). Else, Apple's own Dumpster is the best way to edit MOV files, on a PC, except for Vista x64.
Yes, that's exactly my finding too. And I fixed the mediadata Atom manually in the Hex editor and added the missing meta data at the end (moov box). Now it opens:
attempted repair 24fps-maybe.mov (http://www.mediafire.com/?wiijgvaznwn)
(as promised yesterday)
Jay, thanks for your technical specifications - without it I could have never gotten it to actually load. However, in my programs (Quicktime, VLC and TMPEG Enc.) it still doesn't play back any content (just as if it didn't have the codec). Could someone please check in Premiere, Cineform, Vegas and Virtual Dub again? Also, could someone send me a 10 sec file right from the camera so I can give it the perfect meta information?
It was deliberately low-key to avoid getting everyone's hopes up.
Well, I will try to get mine down again. Btw, a crazy but possibly constructive idea I wanted to share with you. What about keeping the timebase as it is but freezing all camera processes for 1/180th of a second, 30 times a second just after sensor readout. Some kind of "thread.sleep" or "delay" function. You get a 30p file that would play back real time when slowed to 25p.
Thomas
Tom Daigon July 21st, 2009, 04:42 PM Thomas I will check it with with the tools I use at the commercial production facility I am senior editor at (After Effects, FCP, Avid and MPEG streamclip). Not the ones you requested but valid apps to give it a go.
Tom Daigon July 21st, 2009, 04:56 PM OK. It does open...and all apps report a H.264, 1920 x 1080, 4:27 sec., 30 FPS clip.
BUT, it comes up black in After Effects , Quicktime Pro , FCP and in MPEG streamclip
it opens up green. It does play back, but only the reported colors are evident.
Thomas Richter July 21st, 2009, 05:14 PM Yes, exactly my findings. Shame, I thought better players may do the trick. There are two possibilities:
1) the media data Atom is completely broken (nothing can be done then, as far as I know)
2) my meta data (moov box) is wrong. I don't own a 5DII, so I used the meta header from a supposedly "raw" 5DII file instead. I am not certain it really is raw, unmodified 5DII output.
Once I get a real, 10 - 12 sec long/ ca. 40 mb large original 5DII file, I can use that instead. I think this repair option is still promising.
Tom Daigon July 21st, 2009, 09:39 PM I tried 3 times to send you a 45.5 mb 5D file (10 sec,) but the site kept giving me a fatal error message after a 15 min. upload. Sorry. Maybe someone else will have better luck
Thomas Richter July 22nd, 2009, 02:16 PM Hi Tom,
thanks so much for your efforts. Attached a little tool I coded to extract just the Moov Box from a .mov so it becomes small enough to simply email. Please upload the moov box file here or send it to me via mail.
In case we will have to fix files on a regular basis to continue the framerate experiments I can just expand the tool to do whatever we need.
Tom Daigon July 22nd, 2009, 06:06 PM Thomas. I am on a Mac Pro. I unzipped the Moov box extractor. How am I supposed to utilize it? When I try to run the exe file it says "The contents of the file Moov Box Extractor.exe can not be extracted with this program." How do I tell it to extract the H.264 file. Its a little obtuse. Tried several approaches to use it, but none worked. Is this meant for the PC?
Thomas Richter July 23rd, 2009, 03:01 AM Tom,
sorry. I never thought about Mac OS actually. The little application was written in Microsoft C# (part of the .Net framework) and needs Windows.
Thanks for trying. I think we will leave it here. If someone else wants to provide a different Moov Box for me to try, I'll give it another go. For now I think we have to conclude Tramm's settings must have created a totally corrupt file.
Let's hope Tramm finds some non-corrupting framerate settings inside his wizard hat one day :D
Thomas
Tom Daigon July 23rd, 2009, 07:46 AM Thomas,
Sounds good.
Thomas Richter July 23rd, 2009, 04:11 PM Found an original 10 second 5D II clip on the web and used its meta data to fix Tramms file.
However, I get a black picture and just loud noise on the audio track. I think there is nothing more to fix. Unfortunately.
|
|