Code Monkey home page Code Monkey logo

repair_cycorder_mov's Introduction

repair_cycorder_mov

Python script to repair interrupted Cycorder videos.

This script is used to reconstruct missing a 'moov' atom by reconstructing sample table information needed to repair an incomplete Cycorder .mov file.

Example use: ./repair_cycorder_mov.py my_broken.mov repaired.mov

============================================================== IF YOU FIND THIS SCRIPT USEFUL, FEEL FREE TO BUY ME SOME BEER!

Donation link ($5 recommended): https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=xylor77%40yahoo%2ecom&lc=US&item_name=Repair%20Cycorder%20%2emov%20Script&item_number=RCM1&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted

==============================================================

See the 'COPYING.txt' file for GPL licensing information.

After spending some time poring over a hex editor, Dumpster (QuickTime Tools) and the QuickTime File Format (Qtff pdf - .Pdf & Word Free Ebooks Download). As NFL_Demon and jumpfroggy found at http://modmyi.com/forums/windows-specific-modding-discussion/587461-editing-mov-files-corrupt-cycorder-videos-3.html, since Cycorder didn't finalize the .mov we are left with both a missing 'moov' atom, and an 'mdat' atom with a size of 0. However, simply appending a 'moov' atom from a healthy Cycorder .mov and updating the mdat size is not sufficient to fix a corrupt file. While that may allow the file to be loaded in a QuickTime player, the resulting video would have sample video/audio tables pointing at essentially random locations within the file. You would probably see a black video with crackling noises and snippets of sound.

The following areas of the 'moov' atom need to be reconstructed in order to have the file play correctly:

  • mvhd.duration
  • (video) trak.tkhd.duration
  • (video) trak.mdia.mdhd.duration
  • (video) trak.mdia.minf.stbl.stts ** This stts section basically syncs video/audio sample timing. The entire table needs to be rebuilt. Since we do not have the exact timing information for each video frame (presumably this was in Cycorder memory?) we can guess at the timing for each frame based on the rate of audio samples coming in. This produces reasonable results.
  • (video) trak.mdia.minf.stbl.stsz ** This stsz section is the table of video sample sizes. This can be reconstructed by scanning the 'mdat' atom for mjpg signatures.
  • (video) trak.mdia.minf.stbl.stco ** This stco section is the table of video sample offsets within the .mov file. Again, this can be reconstructed by scanning the 'mdat' atom.
  • (audio) trak.tkhd.duration
  • (audio) trak.mdia.mdhd.duration
  • (audio) trak.mdia.minf.stbl.stts.sampCnt
  • (audio) trak.mdia.minf.stbl.stsc ** This stsc section is the samples to chunks table. This can be reconstructed by analyzing the audio information in the 'mdat' atom.
  • (audio) trak.mdia.minf.stbl.stsz.numEntries
  • (audio) trak.mdia.minf.stbl.stco ** This stco section is the table of audio sample offsets within the .mov file. This can also be reconstructed by scanning the 'mdat' atom.
  • Various container sizes also need to be recalculated to account for the replacement table sizes.

repair_cycorder_mov's People

Contributors

dkjer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.