Re: How to programmatically check and fix asf files like asfcheck.exe

From: Alessandro Angeli [MVP::DigitalMedia] (nobody_at_nowhere.in.the.net)
Date: 04/28/04


Date: Wed, 28 Apr 2004 10:20:33 +0200

Justin Engelman wrote:

> Hello,
> How can I programmatically (preferrably from VB.NET)
> check for wma or wmv file corruption and try to fix
> errors like the WMTools ASFCheck command line utility
> does? Ideally I think it would be done using the Encoder
> SDK since that has an interface I can use from VB, unlike
> the Format SDK which requires some complex C++ (and I
> still have a lot to learn about C++ and the Windows SDK).
> Is this possible?
>
> Also, if anyone knows what exactly the ASFCheck utility
> is looking for to see if a file is corrupt and how it
> tries to fix the problem, could you please explain? I
> can't find any detailed documentation on MSDN or anywhere
> else online for ASFCheck.

ASFCheck is old and pre-dates the WMFSDK and anything based
on it (WME9 for example). There is no library to perform a
check because that is not something that can be done using
the WMFSDK.

ASFCheck scans the ASF structure itself and, since the ASF
syntax forces a given pattern in the file, it can determine
whether the file is corrupt and fix it (only to some
extent).

You can get the ASF specs from http://www.microsoft.com/asf
and scan the file yourself in any language that can read
binary files. It is not too difficult but not the easiest of
things either. Finding a reliable error detection and error
correction algorithm is a whole other story.

-- 
/**
 * Alessandro Angeli
 *
 * MVP :: Digital Media
 *
 * a dot angeli at biosys dot net
 */


Relevant Pages

  • Re: How to programmatically check and fix asf files like asfcheck.exe
    ... > check for wma or wmv file corruption and try to fix ... if anyone knows what exactly the ASFCheck utility ... > is looking for to see if a file is corrupt and how it ... ASFCheck scans the ASF structure itself and, ...
    (microsoft.public.windowsmedia.sdk)
  • Re: dump/restore corrupted filesystems
    ... and fsck can't fix the damage. ... That might be worth filing a PR for, especially the panics. ... If dump dies on ... So if any of these is corrupt, ...
    (freebsd-questions)
  • Re: Does Word SP-3 address the old problem of a build-up of list templates?
    ... Once a document is corrupt, merely opening it in a fixed system isn't likely ... it doesn't fix existing buildup. ... >>>> documents which had a build-up of list templates. ... >>>> necessary edit to the Windows registry which corrected the problem. ...
    (microsoft.public.word.numbering)
  • Re: Cannot open zips they are either invalid or corrupt
    ... but don't know how to fix or where to start. ... It was done legitimately for some so that they could spread the results across multiple external media sources *and* the software 'sharing' community liked it because it allowed for checksums easily and made the download sizes smaller and a bunch of smaller single files is less to download overall. ... Now - I understand that you later state, "I also downloaded a corrupted zip repair utitlity called Object Fix and it repaired the corrupted zip." ... ;-) Skimming the results might lead someone to quickly believe you had a corrupt 7-Zip install and somehow had a messed up native compression utility as well. ...
    (microsoft.public.windowsxp.general)
  • Re: dump/restore corrupted filesystems
    ... and fsck can't fix the damage. ... That might be worth filing a PR for, especially the panics. ... So if any of these is corrupt, ...
    (freebsd-questions)