views:

13

answers:

1

I am trying to find duration of an mp4 file using direct show component of windows using the Dotnet wrapper(directShow-lib 2005). But the method i used was GetDuration of IMediaSeeking interface. But this returns zero as duration.

After searching i found the following statement:

"It doesn't matter whether it's in a container or not, it only matters whether you have a parser/reader for it. There is no stock DirectShow parser to read raw H.264 files and no third-party one I can think of. Also, whether IMediaSeeking would work with such a raw file is implementation-dependent. Last, most H.264-related filters use MPEG2Video or VideoInfo2 and neither works with MediaDet, so you would have to build the graph yourself."

Any body please help me to do this in c#.net?

A: 

You'll need to either find or make an MP4 file source filter to make this work. You can build one with mp4v2 or follow the instructions here.

kidjan