Yes. Duration is an editable metadata field, and I can write it manually using http://blogs.msdn.com/toub/archive/2005/05/12/416874.aspx or programmatically using http://babgvant.com/forums/t/760.aspx (modified to get the metadata classes from todvrmslib.dll).
As background to understand what I'm doing: I've written some scripts that will convert mpeg2/ac3 wtv files to h264/ac3 mkv using a variety of tools cobbled together to suit my own needs.
-
W7's built-in WTV to DVR-MS converter, since the WTV to MPG conversion in dvrmstb failed for me in 1.2.2.0 but worked fine for dvr-ms files (I should retry that with 1.2.2.1)
-
DVRMSToolbox to convert DVR-MS to MPG, since Handbrake doesn't like DVR-MS files
-
Handbrake to convert MPG to MKV, since it does a much better job encoding. I had tons of quality/interlacing issues when trying to do this in dvrmstb so I stopped.
In the process of converting dvr-ms to mpg, the sagetv metadata xml file is written. Unfortunately I wasn't planning ahead, and I didn't save that metadata file for all of my prior conversions. Thus now when I can successfully convert back from mkv to wtv, I have to try and get some metadata myself. My mkv to wtv script will re-generate that metadata file if it doesn't exist, and todvrms does its thing with the metadata file, setting title, description, etc as available. Everything works except the duration field, so I go back after creating the wtv file and re-write the duration value in the metadata.
When I saw the off-by-10 error, I was converting using a metadata file created in step 2 above. When I saw the "recorded seconds rather than seconds x 10^7" error I was using my own manually generated metadata file. I haven't yet been able to create a metadata file that will get the duration right on the first try.