Does anyone know of a module or script that I can use to determine the playtime of a media file without playing it thru media player, etc? My scenario is this:

There is a base media file, which is used as a input file to my application. This base file is then run thru my application that embeds information to the file. I would like to verify that after the file has gone thru the application the playtime of the file is still the same. The media can be both audio or video.