Due to continual spamming, forum registrations are now by Invitation Only. Hopefully this will be only a temporary measure to combat spammers.

If you want an invitation contact forumapplication @ camstudio . org

Sorry for the inconvenience.

Repair corrupt Camstudio files (when Camstudio crashes during recording)

Thanks to Amar S. Basu for the following information, pasted from an email he sent me! Introduction: Sometimes Camstudio crashes while recording, and we want to recover the partially recorded video. Most of the posts on this forum are about repairing Camstudio temporary files that are over the 2GB limit. However, in many cases, Camstudio crashes for other reasons, and those posts did not help me repair my files. Camstudio creates temporary In windows 8, the default location is C:\Users\<username>\AppData\Local\Temp In this directory you'll find two files. The first is the video recording, and the 2nd is the audio recording. For example, the filenames might look something like this. ~temp-20150122_1706_04.avi ~temp-20150122_1706_04.wav In my case, neither of these files opened in VirtualDub, VLC, Media player, or any other program I had. Here is what I did to fix the issue

Comments

  • PART 1: Repair the WAV file
    ---------------------------

    Open Audacity, a free audio file editing software available at http://audacity.sourceforge.net

    Import the Camstudio temporary WAV file into Audacity
    File->Import->Raw Data
    In the dialog box, you must select the same audio encoding settings you used in Camstudio. In Camstudio, the default audio settings are PCM encoding, 2 channel stereo at 22.05KHz. Accordingly, I used the following settings in Audacity

    Encoding: Signed 16 bit PCM
    Byte order: Little-endian
    Channels: 2 Channels (stereo)
    Start offset: 0 bytes
    Amount to import: 100%
    Sample rate: 22050 Hz (note that Audacity will have a default of 44100 Hz)

    Click import, and you should see your audio file. Test the audio by pressing the green play button at the top.

    Then save the file.
    File->Export Audio
    Choose a filename, and save as type 'WAV (Microsoft) signed 16 bit PCM)'

    This WAV file should now be playable in any media player.


  • PART 2: Repair the AVI File
    ---------------------------

    Complete AVI files contain a header, a short section of the file which describes the video properties like the codec, resolution, etc. The problem is that the AVI headers are written at the end of the capturing session, so if Camstudio crashes, no header gets written, and this is the reason it cannot be opened in any media player. However, *the data is still there!* We just need to recover it. So, we will begin by rewriting the header, using the freely avilable software "AVI Repair Tool" available at
    http://www.pk3.org/Astro/index.htm?software_utils.htm

    AVI Repair Tool will copy the header from a good (non-corrupt) AVI file into the temporary Camstudio AVI file (corrupt) AVI file. In order for this to work, the good AVI file must have the same video settings (resolution, codec, etc) as the corrupt file. So, first make a short Camstudio recording using the same video settings as when Camstudio crashed. Save the file - this is the 'good AVI' file.

    Then follow these steps, as listed on the pk3 website.
    Reparation procedure - Step by step
    - Backup your corrupted file
    - Run AVIRepair
    - Select source AVI file (the good AVI file)
    - Open Corrupted file (the Camstudio Temporary AVI file)
    The corrupted file's AVI header will be replaced by good one. If this was done successfully, you'll see 'Reparation OK' in the window's status pane.

    Now, open the file using VirtualDub. I used the 32 bit version of VirtualDub at http://virtualdub.sourceforge.net/.

    - Open the Camstudio Temporary AVI file in VirtualDub with advanced options ("Popup extended open options" checkbox must be checked)
    File->Open. Choose the file, and make sure the 'extended open options' is checked.
    - You'll see a dialog called 'Import Options'. In this window, under General AVI options, select the option 'Re-derive keyframe flags', then click OK. Virtual Dub will rekey the video stream. This step may take awhile for long videos.

    The AVI should now be repaired, and you should be able to play the movie in VirtualDub. The first few frames may be blank, but it should be fine after that. However, the movie will not contain any audio, brining us to step 3. Keep the file open in VirtualDub for this step.


  • PART 3: COMBINE THE VIDEO AND AUDIO FILES
    -----------------------------------------

    Now that we have repaired video (AVI) file and a repaired audio (WAV) file, we can combine them to complete the movie.

    If you did step 2 correctly, you should already have the repaired AVI file open in VirtualDub.

    Select an Audio File
    Audio->Audio from Other File
    Choose your repaired WAV file from Part 1.


    Now choose an audio compressor, to reduce your file size
    Audio->Full Processing Mode
    Audio->Compression
    I selected MPEG Layer-3 64kBits/s 22.050 Hz, Stereo


    Select a video compressor, also to reduce the file sie
    Select Video->Full Processing Mode
    Video->Compression
    I prefer the Xvid MPEG-4 Codec because it compresses long videos to relatively small files (see other Camstudio forums). To you use this codec, you scan install Jawor's xvid codec, available at
    http://www.divx-digest.com/software/xvid.html

    Now save the video file
    File->Save as AVI
    This step may also take some time.

    At this point, you should have a repaired video file that plays in most media players and is uploadable to sites like Youtube!
Sign In or Register to comment.