-Kipling
This purpose of this project is to provide documentation and code samples which can assist people in developing applications for Windows Media Foundation in the C# language.
Normally, WMF is considered to be a C++ tool - however the full functionality of Windows Media Foundation is available to users of the C# language via the very capable open source MF.Net interface library.
Using C# and MF.Net you can source streams of media data, render those streams to the screen or save them to files. You can also manipulate the data as it passes through the Media Pipeline and make whatever changes to it you wish. The full debugging capabilities of Visual Studio are also available so you can step through your C# code to observe its operation.
The Tanta project has two parts: a free book (in pdf format) which provides detailed "get started" information and a series of C# Sample Projects which illustrate various WMF Concepts.
Well, the years rolled on and I was starting in on another project (named FPath) one aspect of which requires a computer to make decisions based on video data. I looked at the old Tanta project to see what might be usable within it. As part of the background research, I dug around and discovered Microsoft had really moved DirectShow forward with its successor technology: Windows Media Foundation. It seemed that it was possible that a WMF component called a Transform might be much more useful than what I had before (spoiler alert: yes it is - Transforms are a very good fit for the requirements).
So, the old DirectShow Tanta project was scrapped and the name re-used for a new Windows Media Foundation based project
with the same goal: Make a demonstration project that provides a C# application with access to raw video data at the
user level. From the FPath project perspective, the TantaTransformDirect
and TantaCaptureToScreenAndFile
sample applications
are the only two which are of interest. However, as part of the learning process, I wanted to thoroughly understand the
usage and capabilities of the Windows Media Foundation technology and thus wrote the other sample applications (and the book).
When I was looking (Spring 2018), there did not seem to be anything intended for the beginner which brought all of the information together and presented specific novice friendly advice on how to get started in Windows Media Foundation programming. This book has been written in an attempt to address that issue. In other words, this book contains the information I would like to have had when I was first trying to figure out how to make anything at all work in WMF using C#.
The book entitled "Windows Media Foundation: Getting Started in C#" is available free of charge. It is over 350 pages in length and, hopefully, along with the Sample Projects will enable you to write your own C# WMF applications. Although the book is intended for the C# programmer it does contain plenty of background material that would be of use to users of other languages.
Download: Windows Media Foundation: Getting Started in C# (2.5Mb)
It should be noted that the above book, although it is a free download, is copyrighted material. Please do not distribute or copy it (in whole or in part) without permission. A print version of this book can be found on Amazon at nominal cost.
The Tanta Sample Projects are open source and released under the MIT License. It should be noted that some parts of the code in the Tanta Sample Projects are based on the MF.Net samples and that code, in turn, is derived from the original Microsoft samples. These have been placed in the public domain without copyright. The Windows Media Foundation: Getting Started in C# book available for download above contains a detailed discussion of most of the techniques used in these applications.
You can download, clone or fork the Tanta Sample Projects at the following address:
https://github.com/OfItselfSo/Tanta
A selection of sample MP3 and MP4 files are available at the root of the Tanta Sample Application repository. All of the Tanta
Sample Projects expect, by default, to read and write to a directory named "C:\Dump"
. You can save yourself a bit of typing if
you create that directory and copy the sample files there.
There are 15 Sample Projects (listed below) but 4 of them will probably not work on Windows 7 due to missing codecs on that system. Windows 10 and Visual Studio 2017 (the community edition is fine) is the recommended development platform.
TantaAudioFileCopyViaPipelineAndWriter
TantaAudioFileCopyViaPipelineMP3Sink
TantaAudioFileCopyViaReaderWriter
TantaCaptureToFileViaReaderWriter
TantaCaptureToScreenAndFile
TantaFilePlaybackAdvanced
ctlTantaEVRFilePlayer
control from the TantaCommon library and demonstrates various Pipeline control mechanisms such as Pause, Fast-Forward, Jump Scrolling and volume control etc.
TantaFilePlaybackSimple
ctlTantaEVRStreamDisplay
control from the TantaCommon library to demonstrate simple audio and video playback with multiple streams.
TantaTransformDirect
TantaTransformInDLLClient
TantaTransformInDLL
TantaTransformPicker
TantaVideoFileCopyViaPipelineAndWriter
TantaVideoFileCopyViaPipelineMP4Sink
TantaVideoFileCopyViaReaderWriter
TantaVideoFormats
As discussed, at the top of this page, all of the C# interaction with Windows Media Foundation is done through the open source MF.Net library. This library, written by users "snarfle" and "nowinskie", is fine work and their effort creating it and releasing it as open source is much appreciated.
The icon used for the Tanta apps is from the the lovely Underwater Icons set by TurboMilk.
The open source sample MP4 and MP3 files which ship with the Tanta Software have been provided by https://www.sample-videos.com/.
Each Tanta Sample application has its own interface. The example screenshot below is the TantaTransformDirect
Sample Project
in the process of demonstrating how to write text on a video stream.