DirectShow.NET opening any file that Windows Media Player can open
-
26-09-2019 - |
Question
Here is a code snippet from DirectShowNet library, used to open a video file:
this.graphBuilder = (IGraphBuilder) new FilterGraph();
// Have the graph builder construct its the appropriate graph automatically
hr = this.graphBuilder.RenderFile(filename, null);
but the RenderFile method fails. At the same time, Windows Media Player opens the same file nicely. What can be the problem.
I got the same behavior without DirectShowNet, but using native C++ code...
Solution 2
As Geraint Davies pointed in the comment: "Graphedt's Render File menu option calls RenderFile. If these are behaving differently, then perhaps you are running in different environments (eg x64 vs x86 or admin vs non-admin)."...actually the problem was not architecture or privileges, but some other part of the code related to seeking in the video, which was not performed well on the video that I have tested with.
OTHER TIPS
Windows media player uses the WMF sdk and MF as well as directshow.