Tech used:
- .NET 3.5
- C# / WPF
- Visual Studio 2010 SP1
- Directshow.Net
- DES (DirectShow Editing Services)
- P/Invoke
=======
Summary of application:
I have developed a simple video editor in C#/WPF with a custom WPF timeline control that is connected to DES through DirectShow.NET and based heavily on the DESCombine.cs sample that is included with DirectShow.NET. Users of the application can add video and images to the timeline and select a song to play in the background.
The ultimate goal is to render the timeline contents (ds graph contents) to a wmv based file. This is done essentially by selecting a prx profile, and starting the properly built graph.
All input video is converted to wmv8 before being added to the timeline/directshow graph so that no special third party directshow filters are needed to connect the pins.
=======
The problem and question:
On occasion but not always, Directshow seizes during the render of the final video file. There is no exception, cpu usage simply drops to 0 and nothing happens. It's difficult to debug since I access DirectShow through DirectShow.NET and I don't know what is happening behind the scenes. While I do have unmanaged debugging enabled, there is no exception thrown and I do not know what is wrong.
I can tell this problem happens more frequently as the graph gets more and more pins. For example, rendering a timeline that has 50 videos and images is far more likely to cause this than rendering just a few images and videos.
What can I do to find exactly what is wrong and why this happens when there is no exception thrown or indication of error?
=======
What I have tried:
Set a log file for the graph (with IGraphBuilder::SetLogFile).
This log does indicate some pins fail to connect, but the log looks exactly the same both when renderring completes and fails.
IntPtr hfile = CreateFile("c:\\dslog2.txt", GENERIC_WRITE, 0, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero);
m_pGraph.SetLogFile(hfile);
Use IMediaControl to pause and run the graph when I detect that it has siezed. This does not do anything.
m_pControl.Pause();
Thread.Sleep(2000);
m_pControl.Run();
=======
Thank you in advance, any help is greatly appreciated.
EC_ERRORABORTevent, or a underrun on buffers on certain memory allocator. - Roman R.