Does anyone know how to automatically skip commercials in an existing file?

Mythtv will mark the commercial times in a database and let you skip them while playing. It uses 3 methods to try to detect and from what I have read it works pretty good.

Has someone taken that code and made it work on an existing video file? Possibly just skipping them and putting it into another file marked "skipped" or something?

If you know the technical details of what code or programs do this, please let me know. If the mythtv program could spit out the times it wouldn't be too hard to make a script that uses ffmpeg or mencoder to stop and then continue putting data into another file.