DirectShow#Video rendering filters

{{Short description|Application programming interface for multimedia processing}}

{{Infobox software

| name = DirectShow

| logo = Dxmlogomsmall.png

| logo caption = Logo of the DirectX Media SDK{{snd}}the first time DirectShow was distributed under its current name.{{Citation needed|date=August 2010}}

| screenshot =

| screenshot size =

| caption =

| developer = Microsoft

| released =

| other_names = DShow

| replaces = ActiveMovie

| latest release version =

| latest release date =

| operating system = Microsoft Windows

| genre = Multimedia framework and API

| license = Proprietary commercial software

| website = {{URL|https://docs.microsoft.com/en-us/windows/win32/directshow/directshow}}

}}

DirectShow (sometimes abbreviated as DS or DShow), codename Quartz, is a multimedia framework and API produced by Microsoft for software developers to perform various operations with media files or streams. It is the replacement for Microsoft's earlier Video for Windows technology.{{cite news|url=http://msdn.microsoft.com/en-us/magazine/cc301631.aspx |title=Core Media Technology in Windows XP Empowers You to Create Custom Audio/Video Processing Components|author1=Blome, Michael |author2=Wasson, Mike |work=MSDN Magazine|publisher=Microsoft|date=July 2002|access-date=2007-04-02}} Based on the Microsoft Windows Component Object Model (COM) framework, DirectShow provides a common interface for media across various programming languages, and is an extensible, filter-based framework that can render or record media files on demand at the request of the user or developer. The DirectShow development tools and documentation were originally distributed as part of the DirectX SDK.{{Cite web|url=https://msdn.microsoft.com/en-us/library/dd375454%28v=VS.85%29.aspx|title=DirectShow|publisher=MSDN|date=2012-12-01|access-date=2013-01-21}} Currently, they are distributed as part of the Windows SDK (formerly known as the Platform SDK).{{cite web|url=https://msdn.microsoft.com/en-us/library/ms783323.aspx|title=DirectShow documentation|work=MSDN Library|publisher=Microsoft|date=2006-01-01|access-date=2006-01-01}}

Microsoft plans to completely replace DirectShow gradually with Media Foundation in future Windows versions. One reason cited by Microsoft is to provide "much more robust support for content protection systems"{{Cite web |title=Is the new Media Foundation a replacement of Direct Show? |last=Weiss |first=Becky |work=Microsoft Developer Network forum |date=30 May 2006 |url= https://social.msdn.microsoft.com/Forums/en-US/36661a0b-fefa-4719-8134-6956e505e6f7/is-the-new-media-foundation-a-replacement-of-direct-show}} (see digital rights management). Microsoft's Becky Weiss confirmed in 2006 that "you'll notice that working with the Media Foundation requires you to work at a slightly lower level than working with DirectShow would have. And there are still DirectShow features that aren't (yet) in Media Foundation".{{cite web|url=https://msdn.microsoft.com/en-us/library/aa468614.aspx|title=Migrating from DirectShow to Media Foundation|work=MSDN Library|publisher=Microsoft|date=July 2006|access-date=2010-08-17}} As described in the Media Foundation article, Windows Vista and Windows 7 applications use Media Foundation instead of DirectShow for several media related tasks.

History

The direct predecessor of DirectShow, ActiveMovie (codenamed Quartz), was designed to provide MPEG-1 support for Windows. It was also intended as a future replacement for media processing frameworks like Video for Windows and the Media Control Interface, which had never been fully ported to a 32-bit environment and did not utilize COM.{{cite web |title=DirectShow: Core Media Technology in Windows XP Empowers You to Create Custom Audio/Video Processing Components |url=https://docs.microsoft.com/en-us/archive/msdn-magazine/2002/july/directshow-core-media-technology-in-windows-xp-empowers-you-to-create-custom-audio-video-processing-components |website=docs.microsoft.com |date=23 October 2019 |access-date=31 March 2021 |language=en-us}}

The development team used a pre-existing modular digital-media-processor project codenamed "Clockwork" as a basis for DirectShow. Clockwork had previously been used in the Microsoft Interactive Television project.{{cite web|url=http://research.microsoft.com/~mbj/papers/mitv/tr-97-18.html|title=The Microsoft Interactive TV System: An Experience Report|author=B. Jones, Michael|work=Microsoft Research|publisher=Microsoft|date=July 1997|access-date=2007-04-02|archive-url=https://web.archive.org/web/20070516040458/http://research.microsoft.com/~mbj/papers/mitv/tr-97-18.html|archive-date=2007-05-16|url-status=dead}}

The project was initially named "ActiveMovie", and was released in May 1996, bundled with the beta version of Internet Explorer 3.0.{{cite press release|url=http://www.microsoft.com/presspass/press/1996/mar96/actmovpr.mspx|title=Microsoft Announces ActiveMovie|publisher=Microsoft|date=1996-03-05|access-date=2006-12-31|url-status=dead|archive-url=https://web.archive.org/web/20110717095400/http://www.microsoft.com/presspass/press/1996/mar96/actmovpr.mspx|archive-date=2011-07-17}}{{cite press release|url=http://www.microsoft.com/presspass/press/1996/may96/ie3btapr.mspx|title=Microsoft Internet Explorer 3.0 Beta Now Available|publisher=Microsoft|date=1996-05-29|access-date=2006-12-31|url-status=dead|archive-url=https://web.archive.org/web/20070707080854/http://www.microsoft.com/presspass/press/1996/may96/ie3btapr.mspx|archive-date=2007-07-07}} In March 1997, Microsoft announced that ActiveMovie would become part of the DirectX 5 suite of technologies, and around July started referring to it as DirectShow, reflecting Microsoft's efforts at the time to consolidate technologies that worked directly with hardware under a common naming scheme.{{cite press release |url=http://www.microsoft.com/presspass/press/1997/mar97/mmapipr.mspx |title=Microsoft Unveils First Unified Multimedia API Strategy |publisher=Microsoft |date=1997-03-31 |access-date=2006-12-31 |url-status=dead |archive-url=https://web.archive.org/web/20071024022546/http://www.microsoft.com/presspass/press/1997/mar97/mmapipr.mspx |archive-date=2007-10-24 }}{{cite press release|url=http://www.microsoft.com/presspass/press/1997/Jul97/pronetpr3_95.mspx |title=Microsoft and Progressive Networks Collaborate on Streaming Media |publisher=Microsoft |date=1997-07-21 |access-date=2006-12-31 |url-status=dead |archive-url=https://web.archive.org/web/20061210090534/http://www.microsoft.com/presspass/press/1997/Jul97/pronetpr3_95.mspx |archive-date=2006-12-10 }}{{cite web|url=http://craig.theeislers.com/2006/02/directx_then_and_now_part_1.php|title=DirectX Then and Now|author=Eisler, Craig|work=Craig's Musings|date=2006-02-20|access-date=2010-08-17|url-status=dead|archive-url=https://archive.today/20120711181236/http://craig.theeislers.com/2006/02/directx_then_and_now_part_1.php|archive-date=2012-07-11}} DirectShow became a standard component of all Windows operating systems starting with Windows 98;{{cite press release |url=http://www.microsoft.com/presspass/press/1997/dec97/dshwspr.mspx |title=Microsoft Releases DirectShow SDK - Universal Playback for DVD, Digital Video and Audio, and the Internet |publisher=Microsoft |date=1997-12-10 |access-date=2010-08-17 |url-status=dead |archive-url=https://web.archive.org/web/20100212184601/http://www.microsoft.com/presspass/press/1997/dec97/dshwspr.mspx |archive-date=2010-02-12 }} however it is available on Windows 95 by installing the latest available DirectX redistributable.{{cite web|url=https://msdn.microsoft.com/en-us/library/dd375463(VS.85).aspx|title=DirectShow FAQ|work=MSDN Library|publisher=Microsoft|date=2010-07-06|access-date=2010-08-17}} In DirectX version 8.0, DirectShow became part of the core DirectX SDK along with other DirectX APIs.{{cite web|url=https://msdn.microsoft.com/en-us/library/ms867154.aspx|title=FAQs about the DirectShow and Windows Media SDKs|work=MSDN Library|publisher=Microsoft|date=December 2001|access-date=2010-08-17}}

In October 2004, DirectShow was removed from the main DirectX distribution and relocated to the DirectX Extras download.{{Citation needed|date=August 2010}} In April 2005, DirectShow was removed entirely from DirectX and moved to the Windows SDK starting with the Windows Server 2003 SP1 version of the SDK. The DirectX SDK was, however, still required to build some of the DirectShow samples.{{cite web|url=https://msdn.microsoft.com/en-us/library/ms783352(VS.85).aspx|title=DirectX Samples|work=MSDN Library|publisher=Microsoft|date=2005-09-11|access-date=2005-09-11}}

Since November 2007, DirectShow APIs are part of the Windows SDK. It includes several new enhancements, codecs and filter updates such as the Enhanced Video Renderer (EVR) and DXVA 2.0 (DirectX Video Acceleration).{{cite web|url=https://msdn.microsoft.com/en-us/library/dd390976(VS.85).aspx|title=What's New in DirectShow Windows Vista|work=MSDN Library|publisher=Microsoft|date=2006-11-08|access-date=2006-11-08}}

Architecture

DirectShow divides a complex multimedia task (e.g. video playback) into a sequence of fundamental processing steps known as filters.[https://msdn.microsoft.com/en-us/library/ms786509(VS.85).aspx Introduction to DirectShow application programming][https://msdn.microsoft.com/en-us/library/ms783354(VS.85).aspx DirectShow system overview] Each filter{{snd}}which represents one stage in the processing of the data{{snd}}has input and/or output pins that may be used to connect the filter to other filters. The generic nature of this connection mechanism enables filters to be connected in various ways so as to implement different complex functions.{{cite web|url=https://msdn.microsoft.com/en-us/library/ms778825(VS.85).aspx|title=About DirectShow filters|work=MSDN Library|date=7 March 2008 |publisher=Microsoft|access-date=2010-08-17}} To implement a specific complex task, a developer must first build a filter graph by creating instances of the required filters, and then connecting the filters together.{{cite web|url=https://msdn.microsoft.com/en-us/library/ms783701(VS.85).aspx|title=Overview of graph building|work=MSDN Library|date=7 March 2008 |publisher=Microsoft|access-date=2010-08-17}}

There are three main types of filters:

;Source filters: These provide the source streams of data. For example, reading raw bytes from any media file.

;Transform filters: These transform data that is provided from other filter's output. For example, doing a transform such as adding text on top of video or uncompressing an MPEG frame.

;Renderer filters: These render the data. For example, sending audio to the sound card, drawing video on the screen or writing data to a file.

During the rendering process, the filter graph searches the Windows Registry for registered filters and builds its graph of filters based on the locations provided. After this, it connects the filters together, and, at the developer's request, executes (i.e., plays, pauses, etc.) the created graph.{{Citation needed|date=August 2010}} DirectShow filter graphs are widely used in video playback (in which the filters implement functions such as file parsing, video and audio demultiplexing, decompressing and rendering) as well as for video and audio recording, editing, encoding, transcoding or network transmission of media. Interactive tasks such as DVD navigation may also be controlled by DirectShow.{{Citation needed|date=August 2010}}

Image:dsmp3graph.gif file, as rendered by the DirectShow sample in GraphEdit, an application with a GUI for DirectShow used to visually build and test filter graphs.{{cite web|url=https://msdn.microsoft.com/en-us/library/dd390950.aspx|title=Overview of GraphEdit|work=MSDN Library|publisher=Microsoft|access-date=2010-08-17}} In this picture the boxes represent filters and the grey dots appearing on the sides of the filters represent pins.]]

In the above example, from left to right, the graph contains a source filter to read an MP3 file, stream splitter and decoder filters to parse and decode the audio, and a rendering filter to play the raw audio samples. Each filter has one or more pins that can be used to connect that filter to other filters. Every pin functions either as an output or input source for data to flow from one filter to another. Depending on the filter, data is either "pulled" from an input pin or "pushed" to an output pin in order to transfer data between filters. Each pin can only connect to one other pin and they have to agree on what kind of data they are sending.{{Citation needed|date=August 2010}}

Most filters are built using a set of C++ classes provided in the DirectShow SDK, called the DirectShow Base Classes.{{Citation needed|date=August 2010}} These handle much of the creation, registration and connection logic for the filter.{{cite web|url=https://msdn.microsoft.com/en-us/library/ms783325(VS.85).aspx|title=DirectShow Base Classes|work=MSDN Library|date=7 March 2008 |publisher=Microsoft|access-date=2010-08-17}} For the filter graph to use filters automatically, they need to be registered in a separate DirectShow registry entry as well as being registered with COM. This registration can be managed by the DirectShow Base Classes. However, if the application adds the filters manually, they do not need to be registered at all.{{Citation needed|date=August 2010}} Unfortunately, it is difficult to modify a graph that is already running. It is usually easier to stop the graph and create a new graph from scratch. Starting with DirectShow 8.0, dynamic graph building, dynamic reconnection, and filter chains were introduced to help alter the graph while it was running.{{cite web|url=https://msdn.microsoft.com/en-us/library/ms783499(VS.85).aspx|title=Dynamic Graph Building|work=MSDN Library|date=7 March 2008 |publisher=Microsoft|access-date=2010-08-17}} However, some filter vendors ignore this feature, making graph modification problematic after a graph has begun processing.{{Citation needed|date=August 2010}}

Although DirectShow is capable of dynamically building a graph to render a given media type, in certain instances it is difficult for developers to rely on this functionality and they need to resort to manually building filter graphs if the resulting filter graph is variable.{{Citation needed|date=April 2008}} It is possible for filter graphs to change over time as new filters are installed on the computer.{{Citation needed|date=August 2010}}

Features

By default, DirectShow includes a number of filters for decoding some common media file formats such as MPEG-1, MP3, Windows Media Audio, Windows Media Video, MIDI, media containers such as AVI, ASF, WAV, some splitters/demultiplexers, multiplexers, source and sink filters, some static image filters, some video acceleration, and minimal digital rights management (DRM) support.{{cite web|url=https://msdn.microsoft.com/en-us/library/ms787745(VS.85).aspx|title=Formats supported by default in DirectShow|work=MSDN Library|publisher=Microsoft|access-date=2005-09-11}}{{cite web|url=http://retrakker.antville.org/stories/1548487/|title=Microsoft's next scapegoat - DirectShow!|work=retrakker|date=2007-01-13|access-date=2010-08-18}} DirectShow's standard format repertoire can be easily expanded by means of a variety of filters, enabling DirectShow to support virtually any container format and any audio or video codec. For example, filters have been developed for Ogg Vorbis, Musepack, and AC3, and some codecs such as MPEG-4 Advanced Simple Profile, AAC, H.264, Vorbis and containers MOV, MP4 are available from 3rd parties like ffdshow, K-Lite, and CCCP.{{cite web|url=http://www.illiminable.com/ogg/|title=illiminable Directshow Filters for Ogg Vorbis, Speex, Theora and FLAC|access-date=2006-03-11|url-status=dead|archive-url=https://web.archive.org/web/20060224081849/http://www.illiminable.com/ogg/|archive-date=2006-02-24}}{{cite web|url=http://blog.monogram.sk/janos/directshow-filters/|title=Monogram's DirectShow filters for Musepack, AAC and AMR|access-date=2008-03-08|archive-url=https://web.archive.org/web/20110926032811/http://blog.monogram.sk/janos/directshow-filters/|archive-date=2011-09-26|url-status=dead}}{{cite web|url=http://ac3filter.net/|title=AC3Filter|access-date=2010-08-13}} Incorporating support for additional codecs such as these can involve paying the licensing fees to the involved codec technology developer or patent holder.{{Citation needed|date=August 2010}} Finally, there are "bridge" filters that simultaneously support multiple formats, as well as functions like stream multiplexing, by exposing the functionality of underlying multimedia APIs such as VLC.{{cite web|url=http://www.sensoray.com/support/videoLan.htm|author1=Anderson, Dean |author2=Lamberson, Jim |title=Using VideoLan VLC in DirectShow|work=An open source bridge from VLC to DirectShow|year=2007|access-date=2008-02-15}}

The amount of work required to implement a filter graph depends on several factors. In the simplest case, DirectShow can create a filter graph automatically from a source such as a file or URL.{{cite web|url=http://www.flipcode.com/archives/DirectShow_For_Media_Playback_In_Windows-Part_III_Customizing_Graphs.shtml|title=DirectShow For Media Playback In Windows - Part III: Customizing Graphs|author=Thompson, Chris|work=FLIPCODE.COM|date=2000-09-13|access-date=2010-08-18}} If this is not possible, the developer may be able to manually create a filter graph from a source file, possibly with the addition of a custom filter, and then let DirectShow complete the filter graph by connecting the filters together. At the next level, the developer must build the filter graph from scratch by manually adding and connecting each desired filter. Finally, in cases where an essential filter is unavailable, the developer must create a custom filter before a filter graph can be built.{{Citation needed|date=August 2010}}

Unlike the main C API of QuickTime where it is necessary to call MoviesTask in a loop to load a media file, DirectShow handles all of this in a transparent way. It creates several background threads that smoothly play the requested file or URL without much work required from the programmer.{{Citation needed|date=August 2010}} Also in contrast to QuickTime, nothing special is required for loading a URL instead of a local file on disk{{snd}}DirectShow's filter graph abstracts these details from the programmer, although recent developments in QuickTime (including an ActiveX control) have reduced this disparity.{{Citation needed|date=August 2010}}

DirectShow Editing Services

DirectShow Editing Services (DES), introduced in DirectX 8.0/Windows XP is an API targeted at video editing tasks and built on top of the core DirectShow architecture. DirectShow Editing Services was introduced for Microsoft's Windows Movie Maker. It includes APIs for timeline and switching services, resizing, cropping, video and audio effects, as well as transitions, keying, automatic frame rate and sample rate conversion and such other features which are used in non-linear video editing allowing creation of composite media out of a number of source audio and video streams. DirectShow Editing Services allow higher-level run-time compositing, seeking support, and graph management, while still allowing applications to access lower-level DirectShow functions.

While the original API is in C++, DirectShow Editing Services is accessible in any Microsoft .NET compatible language including Microsoft Visual C# and Microsoft Visual Basic by using a third-party code library called "DirectShowNet Library".{{cite web|url=http://directshownet.sourceforge.net/about.html|title=About DirectShowNet Library|work=DirectShowNet SourceForge Website|publisher=SourceForge|access-date=2010-08-18}} Alternatively, the entire DirectShow API, including DirectShow Editing Services, can be accessed from Borland Delphi 5, 6 and 7, C++ Builder 6, and from later versions with a few minor modifications, using a third party software library called "DSPack".{{cite web|url=http://www.progdigy.com/?page_id=4|title=The DSPack Project|access-date=2010-08-18|archive-date=2010-06-14|archive-url=https://web.archive.org/web/20100614052106/http://www.progdigy.com/?page_id=4|url-status=dead}}

As of March, 2012{{cite web|url=https://msdn.microsoft.com/en-us/library/dd375458(v=vs.85).aspx|title=DirectShow Editing Services|access-date=2012-04-09}} (and, apparently as early as 2009{{cite web |url=http://social.msdn.microsoft.com/Forums/en-US/mediafoundationdevelopment/thread/0ca55781-d031-4786-938f-dda8372723c3/ |title=Video editing like "DirectShow Editing Services" |access-date=2012-04-09 |url-status=dead |archive-url=https://web.archive.org/web/20110805043921/http://social.msdn.microsoft.com/Forums/en-US/mediafoundationdevelopment/thread/0ca55781-d031-4786-938f-dda8372723c3 |archive-date=2011-08-05 }}), Microsoft has stated that the DirectShow Editing Services "API is not supported and may be altered or unavailable in the future."

Video rendering filters

Originally, in Windows 9x, DirectShow used the Video Renderer filter. This drew the images using DirectDraw 3, but could also fall back to GDI or overlay drawing modes in some circumstances (depending upon the visibility of the video window and the video card's capabilities).{{cite web|url=https://msdn.microsoft.com/en-us/library/aa916593.aspx|title=DirectShow Video Renderer Filter|work=MSDN Library|publisher=Microsoft|access-date=2010-08-17}} It had limited access to the video window.{{Citation needed|date=August 2010}} Video for Windows had been plagued with deadlocks caused by applications' incorrect handling of the video windows, so in early DirectShow releases, the handle to the playback window was hidden from applications. There was also no reliable way to draw caption text or graphics on top of the video.{{Citation needed|date=March 2010}}

DirectShow 6.0, released as part of DirectX Media introduced the Overlay Mixer renderer designed for DVD playback and broadcast video streams with closed captioning and subtitles.{{Citation needed|date=August 2010}} The Overlay Mixer uses DirectDraw 5 for rendering. Downstream connection with the Video Renderer is required for window management.{{Citation needed|date=August 2010}} Overlay Mixer also supports Video Port Extensions (VPE), enabling it to work with analog TV tuners with overlay capability (sending video directly to a video card via an analog link rather than via the PCI bus). Overlay Mixer also supports DXVA connections.{{Citation needed|date=August 2010}} Because it always renders in overlay, full-screen video to TV-out is always activated.

Starting with Windows XP, a new filter called the Video Mixing Renderer 7 (VMR-7 or sometimes just referred to as VMR) was introduced. The number 7 was because VMR-7 only used DirectDraw version 7 to render the video and did not have the option to use GDI drawing. The main new feature of VMR-7 was the ability to mix multiple streams and graphics with alpha blending, allowing applications to draw text and graphics over the video and support custom effects.{{cite web|url=https://msdn.microsoft.com/en-us/library/ms787917.aspx|title=Video Mixing Renderer 7 (VMR-7)|access-date=September 11, 2005}} It also featured a "windowless mode" (access to the composited image before it is rendered) which fixed the problems with access to the window handle.{{cite web|url=https://msdn.microsoft.com/en-us/library/ms788128.aspx|title=VMR Windowless Mode|work=MSDN Library|publisher=Microsoft|access-date=2005-09-11}}

DirectX 9 introduced VMR-9, which is included in Windows XP SP2 and newer.{{cite web |url=http://msdn.microsoft.com/en-gb/library/ee416979(VS.85).aspx |title=Programming Guide for the DirectX SDK |website=msdn.microsoft.com |access-date=11 January 2022 |archive-url=https://web.archive.org/web/20101018035741/http://msdn.microsoft.com/en-gb/library/ee416979(VS.85).aspx |archive-date=18 October 2010 |url-status=dead}} This version uses Direct3D 9 instead of DirectDraw, allowing developers to transform video images using the Direct3D pixel shaders.{{cite web|url=https://msdn.microsoft.com/en-us/library/ms787918.aspx|title=Video Mixing Renderer 9 (VMR-9)|work=MSDN Library|publisher=Microsoft|access-date=2005-09-11}} It is available for all Windows platforms as part of the DirectX 9 redistributable.{{Citation needed|date=August 2010}} As VMR-7 it provides a Windowless Mode. However, unlike Overlay mixer or VMR-7 it does not support video ports.{{cite web|url=https://msdn.microsoft.com/en-us/library/dd407344(VS.85).aspx|title=Video Mixing Renderer Filter 9|work=MSDN Library|publisher=Microsoft|access-date=2005-09-11}} Using the /3GB boot option may cause VMR-9 to fail.{{Cite web|url=http://forum.videohelp.com/threads/292160-Loss-of-DirectDraw-Overlay-and-VMR9-after-upgrade-update|title = Loss of DirectDraw Overlay and VMR9 after upgrade/Update}}

Windows Vista and Windows 7 ship with a new renderer, available as both a Media Foundation component and a DirectShow filter, called the Enhanced Video Renderer (EVR).{{cite web|url=https://msdn.microsoft.com/en-us/library/ms694916.aspx|title=Enhanced Video Renderer|work=MSDN Library|publisher=Microsoft|access-date=2007-02-28}} EVR is designed to work with Desktop Window Manager and supports DXVA 2.0, which is available on Windows Vista and Windows 7.{{cite web |url=http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2079713&SiteID=1 |title=DXVA 1.0 translator |author=Various |work=MSDN Media Foundation forum |publisher=Microsoft |access-date=2010-08-18 |url-status=dead |archive-url=https://web.archive.org/web/20090113003558/http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2079713&SiteID=1 |archive-date=2009-01-13 }}{{Citation needed|date=August 2010}} It offers better performance and better quality according to Microsoft.{{cite web|url=https://msdn.microsoft.com/en-us/library/dd374574(VS.85).aspx|title=Choosing the Right Video Renderer|work=MSDN Library|publisher=Microsoft|access-date=2005-09-11}}

Reception

=Awards=

On January 8, 2007. Microsoft received the Emmy award for Streaming Media Architectures and Components at the 58th Annual Technology & Engineering Emmy Awards.{{cite web|url=http://www.emmyonline.tv/releases/pdf/58th_Tech_Eng_winners.pdf |title=NATIONAL TELEVISION ACADEMY ANNOUNCES EMMY WINNING ACHIEVEMENTS: HONORS BESTOWED AT 58th ANNUAL TECHNOLOGY & ENGINEERING EMMY AWARDS |work=Emmy Award |publisher=National Television Academy |date=January 2007 |access-date=2007-01-08 |url-status=dead |archive-url=https://web.archive.org/web/20100922181223/http://emmyonline.tv/releases/pdf/58th_Tech_Eng_winners.pdf |archive-date=2010-09-22 }}

=Simplicity=

Commanding DirectShow to play a file is a relatively simple task. However, while programming more advanced customizations, such as commanding DirectShow to display certain windows messages from the video window or creating custom filters, multiple developers complain of difficulties.{{cite web |url=http://www.mperfect.net/mceDirectShow/ |title=Using DirectShow with Media Center Edition |work=/mceDirectShow |access-date=2010-08-18 |url-status=dead |archive-url=https://web.archive.org/web/20101121141842/http://www.mperfect.net/mceDirectShow/ |archive-date=2010-11-21 }}{{cite web|url=http://www.gamedev.net/reference/articles/article1345.asp|title=The Basics to using DirectShow|author=Roushu, Kurifu|work=Gamedev.net|date=2001-03-13|access-date=2010-08-18|url-status=dead|archive-url=https://web.archive.org/web/20120208101104/http://www.gamedev.net/page/resources/_/technical/directx-and-xna/the-basics-to-using-directshow-r1345|archive-date=2012-02-08}} It is regarded as one of Microsoft's most complex development libraries/APIs.{{cite web|first=Mark |last=Richards |url=http://www.mquter.qut.edu.au/mobile/ARTFilterDX/files/ARTFilterDX09-10.doc |title=Overview: What is the Augmented Reality Toolkit? |date=2008-08-26 |access-date=2009-01-25 |url-status=dead |archive-url=https://web.archive.org/web/20080719030713/http://www.mquter.qut.edu.au/mobile/ARTFilterDX/files/ARTFilterDX09-10.doc |archive-date=2008-07-19 }}{{Citation needed|date=August 2010}}

Developers rarely create DirectShow filters from scratch. Rather, they employ DirectShow Base Classes.{{Citation needed|date=August 2010}} The Base Classes can often simplify development, allowing the programmer to bypass certain tasks. However, the process may remain relatively complex;{{Citation needed|date=August 2010}} the code found in the Base Classes is nearly half the size of the entire MFC library.{{Citation needed|date=August 2010}} As a result, even with the Base Classes, the number of COM objects that DirectShow contains often overwhelms developers.{{Citation needed|date=August 2010}}{{Weasel inline|date=August 2010}} In some cases, DirectShow's API deviates from traditional COM rules, particularly with regard to the parameters used for methods.{{Citation needed|date=August 2010}}{{Weasel inline|date=August 2010}} To overcome their difficulties with DirectShow's unique COM rules, developers often turn to a higher level API that uses DirectShow, notably, Windows Media Player SDK, an API provides the developer with an ActiveX Control that has fewer COM interfaces to deal with.{{Citation needed|date=August 2010}}{{Weasel inline|date=August 2010}}

Although DirectShow is capable of dynamically building a graph to render a given media type, in certain instances it is difficult for developers to rely on this functionality and they need to resort to manually building filter graphs if the resulting filter graph is variable.{{Citation needed|date=April 2008}} It is possible for filter graphs to change over time as new filters are installed on the computer.{{Citation needed|date=August 2010}}

=Codec hell=

Codec hell (a term derived from DLL hell) is when multiple DirectShow filters conflict for performing the same task. A large number of companies now develop codecs in the form of DirectShow filters, resulting in the presence of several filters that can decode the same media type.{{cite web|url=http://www.homevideo101.com/codec-hell/|title=Codec Hell|work=HomeVideo101 Blog|date=2007-06-22|access-date=2010-08-18|url-status=dead|archive-url=https://web.archive.org/web/20120211125026/http://www.homevideo101.com/codec-hell/|archive-date=2012-02-11}}{{cite web |url=http://msmvps.com/blogs/chrisl/archive/2005/01/27/34039.aspx#34071 |title=New Age DLL Hell? Hell Yes |author=Lanier, Chris |work=Chris Lanier's Blog |publisher=MSMVPS.COM |date=2005-01-27 |access-date=2007-02-27 |url-status=dead |archive-url=https://web.archive.org/web/20070212213535/http://msmvps.com/blogs/chrisl/archive/2005/01/27/34039.aspx#34071 |archive-date=2007-02-12 }} This issue is further exacerbated by DirectShow's merit system, where filter implementations end up competing with one another by registering themselves with increasingly elevated priority.

Microsoft's Ted Youmans explained that "DirectShow was based on the merit system, with the idea being that, using a combination of the filter’s merit and how specific the media type/sub type is, one could reasonably pick the right codec every time. It wasn't really designed for a competing merit nuclear arms race."

A tool to help in the troubleshooting of "codec hell" issues usually referenced is the GSpot Codec Information Appliance, which can be useful in determining what codec is used to render video files in AVI and other containers.{{cite web|url=http://www.headbands.com/gspot/|title=The GSpot Codec Information Appliance|access-date=2010-08-18}} GraphEdit can also help understanding the sequence of filters that DirectShow is using to render the media file. Codec hell can be resolved by manually building filter graphs, using a media player that supports ignoring or overriding filter merits, or by using a filter manager that changes filter merits in the Windows Registry.

End-user tools

DirectShow, being a developer-centric framework and API, does not directly offer end-user control over encoding content, nor does it incorporate a user interface for encoding using installed codecs or to different formats; instead, it relies on developers to develop software using the API. In contrast, other multimedia frameworks such as QuickTime or Video for Windows allow end-users to perform basic video-related tasks such as re-encoding using a different codec and editing files and streams.{{Citation needed|date=August 2010}} The convenience offered by an end-user GUI is apparent since the AVI format and codecs used by Video for Windows still remain in use, for example VirtualDub.

See also

References

{{Reflist|colwidth=30em}}

  • {{cite book | author=Pesce, Mark D. | title=Programming Microsoft DirectShow for Digital Video and Television | publisher=Microsoft Press | year=2003 | isbn=0-7356-1821-6}}