First of all, great job on WPF Media Kit! The code is cleanly written and your library is easy to use.
I am trying to save thumbnails of a video at 5 second intervals. I am using the following code (which is very short thanks to your library!):
private void SaveVideoFrame(string videoFilePath, System.TimeSpan position, string imageFilePath)
WPFMediaKit.DirectShow.MediaPlayers.MediaDetector detector = new MediaDetector();
var src = detector.GetImage(position);
var encoder = new JpegBitmapEncoder();
using (FileStream file = File.OpenWrite(imageFilePath))
It works flawlessly for .avi files but I get a "The media does not have a video stream" exception for mp4 files. Stepping through the code I found that get_OutputStreams returned 1. That 1 stream is an audio stream. I am able to play
mp4 files through the MediaUriPlayer element without a problem.
Do you know what could be causing this problem? Also, is this the most efficient way to be extracting frames from a video file? Please excuse any dumb questions because I am new to video and DirectShow.