https://de.wikipedia.org/w/api.php?action=feedcontributions&feedformat=atom&user=221.128.180.136Wikipedia - Benutzerbeiträge [de]2025-05-15T09:36:53ZBenutzerbeiträgeMediaWiki 1.44.0-wmf.28https://de.wikipedia.org/w/index.php?title=Benutzer:Ichwerdennsonstthebest/DirectShow&diff=210726863Benutzer:Ichwerdennsonstthebest/DirectShow2007-04-27T19:01:34Z<p>221.128.180.136: </p>
<hr />
<div>[[Image:dxmlogomsmall.gif|thumb|right|150px|Logo of the DirectX Media SDK - the first time DirectShow was distributed under its current name.]]<br />
<br />
'''DirectShow''' (sometimes abbreviated as '''DS''' or '''DShow'''), codename ''Quartz'', is a [[multimedia framework]] and [[application programming interface|API]] produced by [[Microsoft]] for [[software developer]]s to perform various operations with media files. It is a replacement for Microsoft's earlier [[Video for Windows]] technology. Based on the [[Microsoft Windows]] [[Component Object Model]] (COM) framework, DirectShow provides a common interface for media across many of Microsoft's [[programming language]]s, and is an extensible, filter-based framework that can render or record media files on demand at the behest of the user or developer. The DirectShow development tools and documentation are distributed as part of the [[Microsoft Platform SDK]]. DirectShow additionally contains [[DirectX plugin]]s for [[audio signal processing]] and [[DXVA|DirectX Video Acceleration]] for accelerated video playback.<br />
<br />
Most video-related applications on Windows, such as Microsoft's [[Windows Media Player]], as well as most third-party applications use DirectShow or a variation thereof to manage multimedia content.{{Fact|date=March 2007}} DirectShow's most notable competition is [[Apple Computer]]'s [[QuickTime]] framework. Microsoft plans to replace DirectShow with [[Media Foundation]] in future Windows versions beginning with [[Windows Vista]].<br />
<br />
== History ==<br />
The direct predecessor of DirectShow, [[ActiveMovie]] (codenamed Quartz), was originally chartered to provide MPEG-1 file playback support for Windows. It was also intended as a future replacement for media processing frameworks like [[Video for Windows]], which had never been designed to handle codecs that put video frames into a different order during the compression process, and the [[Media Control Interface]], which had never been fully ported to a 32-bit environment and did not utilize COM.<ref>{{cite web | url=http://msdn.microsoft.com/msdnmag/issues/02/07/DirectShow/ | title=Core Media Technology in Windows XP Empowers You to Create Custom Audio/Video Processing Components | author=MSDN Magazine | date=July, 2002 | work=Microsoft PressPass | accessdate=2007-04-02}}</ref><br />
<br />
The Quartz team started with an existing project called Clockwork. Clockwork was a modular media processing framework in which semi-independent components worked together to process digital media streams, and had previously been used in several projects, including the Microsoft Interactive Television (MITV) project and another project named Tiger.<ref>{{cite web | url=http://research.microsoft.com/~mbj/papers/mitv/tr-97-18.html | title=The Microsoft Interactive TV System: An Experience Report| author=Michael B. Jones | date=July, 1997 | accessdate=2007-04-02}}</ref><br />
<br />
After ActiveMovie was announced in March 1996,<ref>{{cite web | url=http://www.microsoft.com/presspass/press/1996/mar96/actmovpr.mspx | title=Microsoft Announces ActiveMovie | author=Microsoft | date=March 5, 1996 | work=Microsoft PressPass | accessdate=2006-12-31}}</ref> it was released in May 1996 bundled with the beta version of [[Internet Explorer|Internet Explorer 3.0]].<ref>{{cite web | url=http://www.microsoft.com/presspass/press/1996/may96/ie3btapr.mspx | title=Microsoft Internet Explorer 3.0 Beta Now Available | author=Microsoft | date=May 29, 1996 | work=Microsoft PressPass | accessdate=2006-12-31}}</ref> In March 1997, Microsoft announced that ActiveMovie would become part of the [[DirectX|DirectX 5]] suite of technologies,<ref>{{cite web | url=http://www.microsoft.com/presspass/press/1997/mar97/mmapipr.mspx | title=Microsoft Unveils First Unified Multimedia API Strategy | author=Microsoft | date=March 31, 1997 | work=Microsoft PressPass | accessdate=2006-12-31}}</ref> and around July started referring to it as DirectShow,<ref>{{cite web | url=http://www.microsoft.com/presspass/press/1997/Jul97/pronetpr3_95.mspx | title=Microsoft and Progressive Networks Collaborate on Streaming Media | author=Microsoft | date=July 21, 1997 | work=Microsoft PressPass | accessdate=2006-12-31}}</ref> reflecting Microsoft's efforts at the time to consolidate technologies that worked "directly" with hardware under a common naming scheme. DirectShow became a standard component of all Windows operatings systems starting with Windows 98. In version 7 of DirectX, DirectShow became part of the mainline distribution of the DirectX SDK and was placed alongside other DirectX APIs such as [[DirectInput]]. <br />
<br />
In October of 2004, DirectShow was removed from the main DirectX distribution and relocated to the DirectX Extras download. In April of 2005, DirectShow was removed entirely from DirectX and moved to the Microsoft Platform SDK. The DirectX SDK was, however, still required to build DirectShow samples.<ref name="dsmustdx>{{cite web | title=DirectX FAQ | url=http://msdn.microsoft.com/directx/sdk/readmepage/default.aspx | accessdate=September 11 | accessyear=2005 }}</ref><br />
<br />
== Architecture ==<br />
<br />
DirectShow divides the processing of multimedia tasks such as video playback into a set of steps known as filters. Each filter represents a stage in the processing of the data. Filters have a number of input and output pins which connect them together. The generic design of the connection mechanism means that filters can be connected in many different ways for different tasks to build a ''filter graph'', and developers can add custom effects or other filters at any stage in the graph, then render the file, URL or camera. For building and testing filter graphs, [[GraphEdit]] can be used. During the rendering process, the filter graph searches the [[Windows Registry]] for registered filters and builds its graph of filters based on the location provided. After this, it connects the filters together, and, at the developer's request, plays/pauses etc. the created graph. DirectShow filter graphs are widely used in video playback (in which the filters will provide steps such as file parsing, video and audio de-multiplexing, decompressing and rendering) as well as being used for video and audio recording and editing. Interactive tasks such as DVD navigation are also successfully based on DirectShow.<br />
<br />
[[image:dsmp3graph.gif|thumb|center|600px|Filter graph of an [[mp3]] file, as rendered by the DirectShow sample [[GraphEdit]]. In this picture the big boxes represent filters and the tiny boxes on the horizontal ends of the filters represent pins.]]<br />
<br />
In the above example for instance, 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 a number of pins that represent connection points on the filter that can be attached to other filters. Pins can be either output or input. Depending on the filter, data is either "pulled" from an output pin or "pushed" to an input pin in order to transfer data between filters.<br />
<br />
Most filters are built using a set of C++ classes provided in the DirectShow SDK, called the DirectShow Base Classes. These handle much of the creation, registration and connection logic for the filter. 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. <br />
<br />
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. However, many filter vendors ignore this feature, making graph modification problematic after a graph has begun processing.<br />
<br />
== Features ==<br />
There are several levels of abstraction available in rendering sources in DirectShow, and doing any of these is fairly simple to do as long as a custom filter is not needed. At the most basic level, the procedure is for the developer to build a filter graph from scratch by manually adding and connecting each desired filter in the graph. The procedure for the next level of complexity is for the developer to create his or her own filter graph, for example from a ''source filter'' that contains information about a file or website address ([[URL]]) and possibly some custom filter that the user would desire, and then to let DirectShow complete the filter graph for the user and connect the filters together. Finally, the developer could just let DirectShow create a filter graph for him or her automatically from a source such as a file or URL.<br />
<br />
By default, DirectShow supports several common media file formats, such as [[MPEG1]] (no encoding support out of the box), [[MP3]],<ref name="mp3note">While older versions of the DirectShow MPEG Layer 3 decoder can play [[variable bitrate|VBR]] MP3s, they cannot seek accurately or perform many other functions correctly in them due to incorrect parsing of the file (possibly due to incorrect parsing of the [[XING]] header). The Windows Media Player 10 SDK and later versions of Windows Media Player do this correctly, however.</ref> and [[Windows Media Video]] as well as several more mundane formats, such as plain static images.<ref name="formats">{{cite web|url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/supportedformatsindirectshow.asp |title=formats supported by default in DirectShow | accessdate=September 11 | accessyear=2005}}</ref> Since the technology is licensed in Windows, no payout to [[Fraunhofer Society|Fraunhofer]] is required for, say, an MP3 license. DirectShow, however is completely extensible, and extensions allow DirectShow to be extended to support any container format available including any audio or video codec; for example, there have been filters made for [[Ogg Vorbis]] files<ref name="ovfilter">{{cite web | title=illiminable Directshow Filters for Ogg Vorbis, Speex, Theora and FLAC | url=http://www.illiminable.com/ogg/ | accessdate=March 11 | accessyear=2006 }}</ref> and [[AC3]], and quite a lot of other formats.<br />
<br />
Unlike the main C [[application programming interface|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. Also in contrast to QuickTime, nothing special is required for loading a URL instead of a local file on disk - DirectShow's filter graph abstracts these details from the programmer. Recent developments in QuickTime (including an [[ActiveX]] Control) have lessened this, however.<br />
<br />
== DirectShow Editing Services ==<br />
<br />
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 (graphics)|keying]], automatic frame rate and sampling 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.<br />
<br />
== Criticism ==<br />
<br />
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, many developers complain of difficulties. It is often regarded as one of Microsoft's most complex development libraries/APIs.<br />
<br />
Developers rarely create DirectShow filters "from scratch", rather, they employ a set of [[Microsoft Foundation Classes|MFC]]-like (although not requiring MFC) classes called the "DirectShow Base Classes." The Base Classes can often simplify development, allowing the programmer to bypass certain tasks. However, the process may remain relatively complex; the code found in the Base Classes is nearly half the size of the entire MFC library. As a result, even with the Base Classes, the number of COM objects that DirectShow contains overwhelms many developers. In some cases, DirectShow's API deviates from traditional COM rules, particularly in regards to the parameters used for [[Method (computer science)|methods]]. 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''. This API provides the developer with an ActiveX Control that has fewer COM interfaces to deal with. <br />
<br />
DirectShow has also been criticized for its support of [[digital rights management]] (DRM). However, this criticism appears misplaced, as DirectShow itself has minimal support for DRM in its API. The Windows Media Player SDK more significantly reflects Microsoft's adherence to DRM.<br />
<br />
DirectShow has also been scrutinized for compatibility problems with third-party media players (media displaying software not belonging to Microsoft). After a settlement with the European Union, Microsoft started shipping a version of Windows that excluded Windows Media Player. While all of DirectShow's default formats<ref name="formats"/> appeared to be supported, Microsoft suggested that the stripped-down versions of the [[operating system]] may not have supported all of those formats.<ref name="EU ruling 1">{{cite web|url=http://www.newscientist.com/article.ns?id=dn4818|title=EU ruling will break websites, says Microsoft | accessdate=March 20 | accessyear=2006}}</ref><br />
<br />
{{divbox|navy|Technical details follow|The following sections contain technical references and assume the reader has knowledge of the APIs being discussed. Readers not interested in those details may skip this part.}}<br />
=== Video Renderer vs. VMR7 vs. VMR9 ===<br />
Case in point to the complexity argument &ndash; originally the way to play video was to use the ''Video Renderer'' filter. This drew the images using [[DirectDraw]], but could also fall back to [[Graphics Device Interface|GDI]] drawing in some circumstances. One problem with it was limited access to the window: Video for Windows had been plagued with [[deadlock]]s caused by applications' incorrect handling of the video window, so in early DirectShow releases, the handle to the playback window was hidden from applications. This of course made it very difficult for sophisticated applications to handle Windows messages, such as WM_SETCURSOR.<ref name="ivwhandlenote">This is not entirely true, as some clever people found that the EnumChildWindows API could be called on the owner window of the IVideoWindow and then steal its WndProc messages directly.</ref> There was also no reliable way to draw caption text or graphics on top of the video.<br />
<br />
DirectShow 6.0 has introduced Overlay Mixer renderer designed for DVD playback and broadcast video streams with closed captioning and subtitles. The Overlay Mixer uses DirectDraw for rendering, downstream connection with Video Renderer is required for window management. Overlay Mixer also supports Video Port Extensions (VPE), enabling to work with analog TV tuners with overlay capability (sending video directly to a video card via analog link rather than via PCI bus). Overlay Mixer also supports [[DXVA]] connections.<br />
<br />
[[Windows XP]] introduced a new filter called ''VMR-7''<ref name="VMR-7">{{cite web|url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/videomixingrendererfilter.asp |title=Video Mixing Renderer 7 (VMR-7) | accessdate=September 11 | accessyear=2005}}</ref> (Abbreviation for ''Video Mixing Renderer 7'', sometimes just referred to as plain ''VMR''). 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, so allowing applications to draw text and graphics over the video. VMR7 also featured a "windowless mode"<ref name="windowless mode">{{cite web|url=http://msdn.microsoft.com/library/en-us/directshow/htm/windowlessmode.asp?frame=true|title=windowless mode | accessdate=September 11 | accessyear=2005}}</ref> which fixed the problems with access to the window handle; however it required a bit of extra initialization code. For non-technical reasons, it was released only on Windows XP.<ref name="VMR7note">Some people have noted that it "unofficially" works on [[Windows 2000]] also: owing to a build error, some of the DirectX runtime packages for Windows 2000 accidentally included VMR-7.</ref><br />
<br />
DirectX 9 included yet another renderer, dubbed ''VMR-9''.<ref name="VMR-9">{{cite web|url=http://msdn.microsoft.com/library/en-us/directshow/htm/videomixingrendererfilter9.asp?frame=true|title=Video Mixing Renderer 9 (VMR-9) | accessdate=September 11 | accessyear=2005}}</ref> This version depends on DirectX9-style graphics (also known as [[Direct3D]]). Unlike the VMR-7, it also would work on any system that supported DirectX9, provided that the graphics adapter could support the required Direct3D modes. However, this caused even further splintering on an already extremely involved API.<br />
<br />
[[Windows Vista]] ships with yet ''another'' renderer, available as both a [[Media Foundation]] component and a DirectShow filter, called ''EVR'', or the Enhanced Video Renderer.<ref name="EVR">{{cite web|url=http://msdn2.microsoft.com/en-us/library/ms694916.aspx|title=Enhanced Video Renderer | accessdate=February 28 | accessyear=2007}}</ref> EVR supports [[DXVA]] 2.0. DXVA 2.0 is also exclusive to Windows Vista, however the [[.NET Framework 3.0]] redistributable installs EVR on Windows XP.<ref> [http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1273892&SiteID=1 EVR.dll installed by WPF/.NET 3.0 Runtime on Windows XP] </ref><br />
<br />
===Codec hell===<br />
Codec hell (a term derived from [[DLL hell]]) is when multiple DirectShow filters exist on a given PC for encoding or decoding the same media type. Many companies now develop codecs in the form of DirectShow filters, resulting in the presence of several filters that can decode the same media type. 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.<br />
<br />
Microsoft's Ted Youmans explained that "(DirectShow) was based on the merit system (pun intended) 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."<ref name="Arms Race">{{cite web|url=http://msmvps.com/blogs/chrisl/archive/2005/01/27/34039.aspx#34071 |title=New Age DLL Hell? Hell Yes | accessdate=February 27 | accessyear=2007}}</ref><br />
<br />
DirectShow is capable of dynamically building a graph to render a given media type, but it becomes difficult for developers to rely on this functionality when the resulting filter graph is variable.{{Fact|date=February 2007}} Furthermore, it is possible for filter graphs to change over time as new filters are introduced to the computer, which can result in a support nightmare for developers and businesses. Developers often resort to manually building filter graphs to be certain of their contents, which cripples one of DirectShow's more appealing features.<br />
<br />
===Lack of tools and codecs===<br />
DirectShow is also criticised for its lack of built-in authoring tools, GUI and standard codecs. Although DirectShow is extensible and supports third-party formats through "filters", it focusses more on playback and less on authoring/encoding. Unlike its predecessor [[Video for Windows]] (which also includes [[Audio Compression Manager]]) or its competitor [[QuickTime]], DirectShow provides no direct means ''for end-users'' to encode/create/export files but requires ''developers'' to build end to end filter graphs for encoding content. So while DirectShow is equally flexible for authoring/encoding, using filters for muxing/file writers, only developers can use these features. End users, non-technical users who require GUI tools for encoding content cannot use DirectShow, without the use of third-party tools. Microsoft's free offering, Windows Media Encoder, although using DirectShow, only encodes to [[Advanced Systems Format|ASF/WMV]] and consequently proprietary Microsoft codecs. Windows Movie Maker, although based upon DirectShow and DirectShow Editing Services, limits the export of files to WMV and does not even allow import of all commonly found third-party codecs. Thus, third-party container formats and codecs are supported on Windows only if third-party software tools as well as the necessary codecs are installed on the computer. Video for Windows-based tools or QuickTime, on the contrary, have a common GUI which populates all installed codecs, allows end users to use third-party codecs, QuickTime even allowing third-party container formats. This is also probably why [[Audio Video Interleave|AVI]] (the format used by Video for Windows) continues to be used on the Windows platform in spite of its obsolescence.<br />
<br />
== See also ==<br />
* [[DirectX plugin]]s<br />
* [[DXVA|DirectX Video Acceleration]]<br />
<br />
== References ==<br />
* {{cite web | title=MSDN DirectShow documentation | url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/directshow.asp | accessdate=August 17 | accessyear=2005 }}<br />
* {{cite book | author=Pesce, Mark D. | title=Programming Microsoft® DirectShow® for Digital Video and Television | publisher=Microsoft Press | year=2003 | id=ISBN 0-7356-1821-6}} ([http://www.microsoft.com/mspress/books/sampchap/6381.asp#SampleChapter Sample Chapter])<br />
* Various posts from the "Microsoft.public.win32.programmer.directx.video" newsgroup<br />
<br />
== Notes ==<br />
<div class="references-small"><br />
<references/><br />
</div><br />
<br />
== External links ==<br />
<br />
* [http://msdn2.microsoft.com/en-us/library/ms783323.aspx MSDN] - 'Official DirectShow documentation from MSDN'<br />
* [http://www.microsoft.com/downloads/results.aspx?productID=&freetext=directshow&DisplayLang=en MSDN] - 'DirectShow Downloads from MSDN'<br />
* [http://www.gdcl.co.uk Home page of Geraint Davies] - 'Creator of DirectShow and a DirectShow [[Microsoft Most Valuable Professional|MVP]] &ndash; Contains several [[FAQ]]s and examples.'<br />
* [http://tmhare.mvps.org/ The March Hare] - 'Prolific DirectShow MVP &ndash; Contains several FAQs'<br />
* [http://www.chrisnet.net/code.htm Chris P's code] - 'Another DirectShow MVP &ndash; Some samples focused on audio.'<br />
* [http://www.avdevforum.com/AV/ AV Programming Forum] - 'Articles and Forum for DirectShow and Format SDK.'<br />
* [http://www.radlight.org/products/filters/filter.php?filter=5 RadLight] - 'Theora DirectShow filter enables Microsoft Windows Media Player to play [[Theora]] videos.' The author has unfortunately disappeared, but you can download the (unsupported) codec here [http://www.free-codecs.com/download/RadLight_MPC_DirectShow_Filter.htm Codec download at free-codecs.com]<br />
* [http://www.illiminable.com/ogg Illiminable] - 'Open source Directshow filter for Ogg Vorbis, Speex, Theora and FLAC for Windows Media Player. The [http://svn.xiph.org/trunk/oggdsf source code], available from the [http://www.xiph.org xiph.org] [[Subversion (software)|Subversion]] repository, contains implementations of more than 15 different DirectShow filters.'<br />
* [http://www.medialooks.com/products/directshow_sdk.html MediaLooks DirectShow SDK] - 'An alternative DirectShow SDK, a replacement for DirectShow Base Classes.'<br />
* [http://www.standardmpeg.com/products/encoder-sdk Standard Mpeg DirectShow SDK] - 'DirectShow SDK for encoding to Mpeg.'<br />
* [http://directshow.wonderu.com/ DirectShow in Russian] - 'DirectShow Tutorial (Russian)'<br />
* [http://www.MontiVision.com/en/products MontiVision Development Kit] - 'A DirectShow based image and video processing SDK for use in machine vision, surveillance and multimedia.'<br />
* [http://www.progdigy.com/modules.php?name=DSPack DSPack] - 'A DirectShow library for Borland DELPHI.'<br />
<br />
[[Category:Microsoft APIs]]<br />
[[Category:Multimedia frameworks]]<br />
[[Category:DirectX]]<br />
<br />
[[lt:DirectShow]]<br />
[[pl:DirectShow]]<br />
[[pt:DirectShow]]<br />
[[sv:DirectShow]]<br />
[[zh:DirectShow]]</div>221.128.180.136