Using MFTrace to Trace Your Own Code

Now that you know how to trace Media Foundation and analyze those traces to figure out what Media Foundation is doing, the next step is to figure out what your own code is doing. That means adding traces for MFTrace to your code. The simplest way to add traces is to use the OutputDebugString function….


Automating Trace Analysis

In our last post, we discussed how to examine Media Foundation traces manually, using TextAnalysisTool.NET. This time, we present a few scripts to automate the process and identify problems more quickly.   Getting Started First, install Perl, GraphViz, and Gnuplot. Then open a command prompt and add Gnuplot to your path. For example: set PATH=%PATH%;C:\Program…


Analyzing Media Foundation traces

As we mentioned in our previous blog post, log files generated by MFTrace quickly become huge, and it can be difficult to sort out interesting traces from background noise. This blog post will share a few tips to help analyze those log files. TextAnalysisTool.NET One (free) tool that we often use is TextAnalysilTool.NET. The tool…


Using MFTrace to Trace Media Foundation

We are continuing our series on Media Foundation and its tracing by introducing a new tool available in the latest Windows SDK: MFTrace. This tool is similar to Event Viewer: Both tools collect traces which give some insight into what Media Foundation and its components are doing. However, MFTrace is much more powerful, and collects…


Using Event Viewer to Trace Media Foundation

It is an unfortunate fact of life that sometimes things do not work as expected. Luckily, when bad things happen, the Event Viewer is there to help narrow down the issue and figure out the root cause of the problem. Without these traces, finding when and why a failure happened in Media Foundation can be…



SummaryMFDub is a simple linear video editor built on Media Foundation, modeled after the free video editor VirtualDub. MFDub can open any file format that can be resolved by the MF source resolver, display frames of video from the file, apply a series of video or audio effects implemented as MF transforms, and then save…



MFManagedEncode.exe This is a managed tool written in C# and XAML that converts files from one media format to another. The source code is provided to use as a reference on how to interop with source reader, sink writer and the transcode API from a managed environment. The sample previews media files using WPF’s MediaElement…



This is a command line tool showcasing the Windows 7 Media Foundation APIs to read media source attributes and metadata. It also shows how to leverage the Windows Media Format SDK to read DRM properties. The source code can be useful for learning about Media Foundation. The built executable can be useful for dumping media…



MFCopy.exe – This is a command line tool showcasing the Windows 7 Media Foundation source reader and sink writer APIs. This tool copies multimedia files from one multimedia container to another. Copying can involve simply remultiplexing the streams, transcoding to convert the streams to a different format. The source code is provided to use as…



MFSimpleEncode.exe – This is a command line tool that transcodes files from one media format to another. The source code is provided to use as a reference if you write your own transcode application. This tool uses the Media Foundation transcode API, which was introduced in Windows 7. Techniques: Transcoding is converting from one media…