AVI file length in time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I, preferably using C#, find out the length, in time, for an AVI file?
 
Joachim,

There is no easy way to do this. The best way would be to interop with
the DirectShow components (it would require COM interop) and get the
information from there. You can load the file in a graph in DirectShow, and
it should give you information about the length of the file, etc, etc.

Hope this helps.
 
Nicholas Paldino said:
There is no easy way to do this. The best way would be to interop with
the DirectShow components (it would require COM interop) and get the
information from there. You can load the file in a graph in DirectShow,
and it should give you information about the length of the file, etc, etc.

It's a *little* easier (but not much...you still need to interop with
DirectShow). You can use the MediaDet object to obtain information about a
media file without having to do all the graph building stuff yourself:

http://msdn.microsoft.com/library/en-us/directshow/htm/imediadetinterface.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top