in

andy vt's tools & blog

Flexibility isn't free

Work around Vista's "Incorrect duration bug" with FixDVRMSDuration.exe

Last post 09-13-2008 11:02 PM by HT Slider. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 09-13-2008 11:02 PM

    Work around Vista's "Incorrect duration bug" with FixDVRMSDuration.exe

    Many Vista Media Center users have been affected by Microsoft's "Incorrect duration bug" since Vista was first released (getting close to 2 years ago now).  For more information on this very annoying bug, have a look at this thread http://thegreenbutton.com/forums/thread/286741.aspx.  Microsoft has recently said they will "likely" release a patch to fix this issue in the next cumalative Media Center update.  Until they do release a patch...

    This bug randomly affects roughly 5-10% of my recordings and makes it so a 1 hour recording may only appear to be perhaps 7 minutes in length.  It breaks the ability to reliably FF, RW, Skip, Replay and worst of all breaks automatic commercial skipping (the addin jumps to the wrong point in the show).

    Andy produced an executable, FixDVRMSDuration.exe, that can be manually used to repair broken files.  It can be downloaded here:  http://babgvant.com/files/folders/misc/entry6485.aspx (note I included it in the attached .zip file since the syntax has changed slightly through revisions and my batch file was modified to work with the current version; it doesn't work with older versions and may not work with newer ones...).

    Although there may be more elegant solutions, I created a custom profile condition (Execute Find Commercials and Fix Duration Bug), a custom profile (Find Commercials and Fix Duration Bug, named "FindCommFixDuration"), and a custom batch file ("FixDuration.bat") that detects recordings with incorrect durations and automatically repairs them.  Note this has only been tested with Show Analyzer.

    Key to this working properly, I wanted to ensure Media Center's scheduler considered that the repaired recording was actually the same recording.  This way Media Center will abide by series limit settings, associate the recording with any series recordings, and be aware that the episode exists on the hard drive.  Note that maintaining the link between the Media Center scheduler and the physical file was the most difficult part to get working properly and this is why I ended up using a batch file.

    How this works:

    1. Media Center records a show.
    2. The custom profile condition (Execute Find Commercials and Fix Duration Bug) examines the show and if it appears to be short, it executes the custom profile (Find Commercials and Fix Duration Bug).  Note that since DVRMSToolbox acts on files shortly after MC starts to record, that the custom profile actually runs on all recordings as they are recording.  The only time it doesn't get used is if a completed recording is moved/copied into the Recorded TV folder from somewhere else.
    3. "Find Commercials and Fix Duration Bug" does everything the same as the default "Find Commercials/nativecommdetect" profile, except at the very end it runs the custom batch file (FixDuration.bat).
    4. FixDuration.bat first sets up a few variables (file names without quotation marks).
    5. It then calls FixDVRMSDuration.exe, with a 1% file duration accuracy tolerance which creates a new ".fixed" file if the duration was out by more than 1%.
    6. Finally it moves the "fixed" file over top of the original file and forces the fixed file to replace the original file.  I found that this was the only way I could maintain the relationship between the Media Center scheduler and the recording.  If I ever deleted the original recording or used a different file name for the "fixed" recording, Media Center would loose track of the recording (and often schedule it to be recorded again right away as well as ignore series limit settings, etc).

    How to install:

    1. Create a folder "C:\Utilities" and place "FixDVRMSDuration.exe" and "FixDuration.bat" in here.
    2. Place "FindCommFixDuration.dpc" and "81497ecd-fb89-471b-99a2-91771ee4b1be.dcc" in the DVRMSToolbox profiles directory (default:  "C:\Program Files\DVRMSToolbox\Profiles").
    3. Launch the DVRMSToolbox Processing Condition Editor and make sure that "Execute Find Commercials and Fix Duration Bug" is directly under "Processed Files".
    Gigabyte GA-P35-DS4, Intel Quad Q6600, 4 GB RAM, ATI HD 2600XT 512MB, Enermax 495P PSU, 2x SATA 500GB, 3x SATA 300GB, LG GSA-4167B, Hauppauge PVR-250, Toshiba 51H83 (51" HDTV), Yamaha RX-V2400 Amp, 5x Energy Speakers, SVS Subwoofer
Page 1 of 1 (1 items)
@2008 andy vt
Powered by Community Server (Non-Commercial Edition), by Telligent Systems