Media Foundation and DirectShow tips, gotchas and code bits

This blog is dedicated to assisting fellow Software Engineers who are integrating Microsoft’s audio and video technologies into their software.

List of Windows 10 (developer preview) UWP Audio, Video, Camera and Graphics samples

[Update: Fixed broken links] Hello again my fellow media development enthusiasts. It is that time...

Author: James Dailey - MSFT Date: 05/29/2015

BackgroundMediaPlayer architecture on Windows Phone 8.1

I posted this a while back on the MSDN Windows Phone Development forum. I think that it includes...

Author: James Dailey - MSFT Date: 12/25/2014

Capturing raw PCM audio on Windows Phone 8 and 8.1

[This is a copy of the blog post I originally wrote and published on behalf of the WSDS team. The...

Author: James Dailey - MSFT Date: 10/03/2014

Achievement Unlocked: MIDI support added to Windows 8.1 apps

[This is a copy of the blog post I originally wrote and published on behalf of the WSDS team. The...

Author: James Dailey - MSFT Date: 09/05/2014

Using MediaComposition to add background audio to video (Windows Phone 8.1)

One of our friends on the forum pointed out that we really don’t have any good samples on how...

Author: James Dailey - MSFT Date: 06/18/2014

Free Chalk Talk: Light up Your Apps with Sights and Sounds

Hello All, I am giving a live chalk talk on October 16th for interested English speaking engineers....

Author: James Dailey - MSFT Date: 10/02/2013

List of Windows 8.1 preview audio / video and camera samples

My fellow media development enthusiasts the awesomeness that is Windows 8.1 is upon us. My list of...

Author: James Dailey - MSFT Date: 06/27/2013

Mixed Media – Audio & Video – Windows Store vs. Windows Phone 8

Please note: This post is "reprinted" from the "Managing Windows Store Developer Solutions" blog...

Author: James Dailey - MSFT Date: 03/08/2013

Visual Studio 2012's simulator causes video to stop playback when orientation is changed

Just a quick post to let you know that one of my friends on the forums discovered that if you are...

Author: James Dailey - MSFT Date: 08/31/2012

MediaElement.Opacity is not supported in Windows store apps (Metro)

Just a quick note to let the media development community know that we don't support the "opacity"...

Author: James Dailey - MSFT Date: 08/31/2012

Get your Windows 8 Metro style app into the Windows App Store early!

Follow these steps to get invited to an App Excellence lab: Create a really great Windows 8 Metro...

Author: James Dailey - MSFT Date: 04/27/2012

List of Windows 8 CP audio / video and camera samples

I have been on the hunt for various samples to pass along to the developers I"ve been working with...

Author: James Dailey - MSFT Date: 03/21/2012

Windows 8 Consumer Preview digital media and You

Hello all, It’s been a while since I was able to get this blog updated. Fortunately I have...

Author: James Dailey Date: 02/29/2012

Out of memory errors with the Windows Media Format SDK

Over the last few years I’ve worked with a number of engineers that have reported out of...

Author: James Dailey Date: 06/07/2010

Why are the Multimedia Timer APIs (timeSetEvent) not as accurate as I would expect?

The Multimedia Timer APIs (MM Timer APIs) get their high accuracy by using the Programmable...

Author: James Dailey Date: 07/02/2009

Here is a consolidated list of changes that we can expect for DirectShow Windows 7

Potentially Breaking Change (IMPORTANT): Intelligent Connect adds a level of indirection on Win 7...

Author: James Dailey Date: 05/28/2009

Activating an audio endpoint when not connected causes the device to report incorrect capabilities

The other day we had a major OEM report an issue with the WASAPI. In particular when they found that...

Author: James Dailey Date: 04/28/2009

Exception playing .mp3 & .wma files using embedded WMP from .hta files

We recently had an engineer report a strange exception when displaying .hta files via mshta.exe. If...

Author: James Dailey Date: 04/07/2009

Playing an MPEG1 file in WMP via HTTP returns the wrong duration

A colleague of mine in Japan recently found this very interesting issue in Windows Media Player...

Author: James Dailey Date: 04/07/2009

Calling the Format SDK, DirectShow, Media Foundation or the WASAPI from managed code (C#, VB.net)

I get this series of questions from different developers from around the world at least once a week....

Author: James Dailey Date: 04/01/2009

Using the Format SDK to push to multiple publishing points on the same server

I have been working with an engineer for weeks trying to figure out why we were not able to push to...

Author: James Dailey Date: 03/30/2009

Where the heck did Microsoft hide the WM Format SDK x64 libraries for Vista? How about XP?

It looks like the 64 bit version of the Windows Media Format SDK .lib static library files are not...

Author: James Dailey Date: 03/27/2009

DirectShow Filter vs. DMO - Ready... Fight!

There are some rather interesting misunderstandings surrounding Direct Media Objects (DMO). I talked...

Author: James Dailey Date: 02/25/2009

Rendering MMS, RTSP and HTTP with DirectShow in Vista and Windows 7

I was talking to a DirectShow engineer the other day that was having issues rendering URLs using...

Author: James Dailey Date: 02/05/2009

“MediaElement.SetSource” throws “AE_INVALID_FORMAT_ERROR” when setting “Stream” sources

When reading a stream from a location such as a media resource object, and then calling...

Author: James Dailey Date: 01/08/2009

“Leave audio at remote computer” Doesn't Work in Windows Server 2008

When connecting to Windows Server 2008 through remote desktop choosing to leave the audio on the...

Author: James Dailey Date: 01/08/2009

Hotfix 929182 not updating Windows Media Encoder 9 components as expected on Vista

I was in training a few weeks ago (WMS 2008 new features) and found that no matter what I did I was...

Author: James Dailey Date: 10/17/2008

Windows Media Player does not negotiate media types for DMO DSP plug-ins on Vista

Here is an interesting issue I ran across writing Windows Media Player (WMP) custom DSP plug-ins....

Author: James Dailey Date: 10/17/2008

Using the WM Encoder to Protect Existing Content with WM DRM

One of the things that a lot of DRM savvy CDNs are doing is to use WM Encoder to add WM DRM to their...

Author: James Dailey Date: 10/14/2008

WMRM SDK 10.1.2 best practice sample code

I wrote this sample code a while back to show how to validate the latest individualization version...

Author: James Dailey Date: 09/26/2008

Custom DirectShow Audio Renderer hangs playback in Windows Media Player 11

If you write your own DirectShow based Audio Renderer and want it to work inside WM Player 11...

Author: James Dailey Date: 09/19/2008

WM Format SDK DRM returns NS_E_DRM_LICENSE_NOTACQUIRED when license is delivered

I ran into an issue using the WM Format SDK DRM Stub Library the other day. When we were trying to...

Author: James Dailey Date: 09/04/2008

Windows Media Encoder 9 (SDK) Limitations and Support

There are a few limitations to the supportability of the Windows Media Encoder 9 series application...

Author: James Dailey Date: 09/04/2008

Unexpected Windows Media Encoder shutdown / crash while encoding

I found an interesting problem when dynamically changing the input format of the WM Encoder while...

Author: James Dailey Date: 04/11/2008

When playing back a DV encoded AVI file, what does the AVI Splitter do when it detects a zero byte sample (zero byte index) from the Async File Source?

Q. When playing back a DV encoded AVI file, what does the AVI Splitter do when it detects a zero...

Author: James Dailey Date: 03/25/2008

When NTSC (29.97 interlaced) video is being fed to the VMR9 with a custom allocator/presenter, PresentImage is being called 60 times per second. You expect 30 times per second.

Q. When NTSC (29.97 interlaced) video is being fed to the VMR9 with a custom allocator/presenter,...

Author: James Dailey Date: 03/25/2008

Adding CRL data to WMRM SDK 10.1.2 based scripts

UPDATE: The code referenced on this page is written in ASP / VB Script. I recently created a...

Author: James Dailey Date: 03/14/2008

DirectMusic PlaySegmentEx stops working after running for 18 - 20 days

I ran into an interesting issue with DirectMusic yesterday. When you use PlaySegmentEx to repeatedly...

Author: James Dailey Date: 03/13/2008

Bug in prelicgen.asp may cuse error on the client

I found a bug recently in the prelicgen.asp page that has been causing pain for developers. They...

Author: James Dailey Date: 03/12/2008