Benutzer:Ichwerdennsonstthebest/DirectShow
Vorlage:Infobox software DirectShow (manchmal auch abgekürzt als DS oder DShow), unter dem Decknamen Quartz entwickelt, ist ein von Microsoft für Softwareentwickler entwickeltes Multimedia-Framework und API für das Arbeiten mit Foto- und Videoformaten. Es ist Microsofts Nachfolger von Video for Windows.[1] Auf dem Microsoft Windows Component Object Model (COM) Framework fußend bietet DirectShow eine gemeinsame Schnittstelle für Medien von unterschiedlichen Programmiersprachen und ist ein erweiterbares, auf Filter basierendes Framework, das je nach Bedarf des Entwicklers oder Endbenutzers Mediendateien rendern oder erfassen kann. Die DirectShow Entwicklerwerkzeuge und die Dokumentation wurden ursprünglich als Teil des DirectX SDK zur Verfügung gestellt.[2] Zur Zeit werden sie als Teil des Windows SDK bereitgestellt.[3]
Microsoft plant, Directshow mit Media Foundation in zukünftigen Windows-Versionen nach und nach vollständig zu ersetzenen. Als ein Grund wird von Microsoft angegeben, "much more robust support for content protection systems", also "deutlich mehr Unterstützung geschützte Inhalte"zu Verfügung zu stellen. [4] (siehe auch digitale Rechteverwaltung).
Geschichte
BearbeitenDer direkte Vorgänger von DirectShow, Active Movie (Deckname "Quartz"), wurde entworfen, um MPEG-1-Unterstützung für Windows zu schaffen, war aber auch als zukünftiger Ersatz für Medienverarbeitende Frameworks wie Video for Windows und das Media Control Interface vorgesehen, welches niemals vollständig in 32-Bitumgebungen übertragen wurde und COM nicht verwendet. [5][1]
Das Entwicklerteam nahm einen schon existierendem modularen digitalen Medienprozessor (mit dem Decknamen "Clockwork" also "Uhrwerk") als Grundlage für Directshow. Clockwork wurde vorher im Microsoft Interactive Television Project benutzt.[6]
Das Projekt wurde anfänglich "ActiveMovie" genannt und im Mai 1996 zusammen mit der Beta-Version des Internet Explorers herausgegeben.[7][8] Im März 1997 kündigte Microsoft an, dass Active Movie Teil des DirectX 5 suite of technologies sein soll und begann etwa im Juni damit es einfach DirectShow zu nennen, um die Bemühungen von Microsoft Technik, die gleich auf Hardwarebene, mit einem gemeinsamen Benennungsschema arbeitet, aufzuzeigen.[9][10][11] DirectShow wurde Standard in allen Windowsbetriebssystemen seit Windows 98,[12] wobei es auch in Windows 95 verfügbar ist, wenn man die zuletzt verfügbare DirectX Redistributable installiert.[13] In der DirectX-Version 8.0, wurde Direct Show Teil des DirectX SDK Kernels zusammen mit anderen DirectX APIs.[14]
Im Oktober 2004 wurde DirectShow aus der Hauptdistribution entfernt und nach Extras download verschoben.[15] Im April 2005 wurde Direct Show ganz aus Direct X entfernt und zur Windows SDK verlegt, angefangen mit dem 2003 Service Pack für Windows Server der SDK.[3] Die DirectX SDK war jedoch noch immer nötig, um einige der Direct Show Samples zu erstellen.[16]
Von November 2007 an sind Direct Show APIs Teil der Windows SDK. Das schließt mehrere neuere Erweiterungen, Codecs und Filterupdates, wie den Enhanced Video Renderer (EVR) und den DXVA 2.0 (DirectX Video Acceleration) mit ein.[17]
Architektur
BearbeitenDirectShow teilt einen vielschichtigen multimedialen Arbeitsablauf (z.B. Video-Wiedergabe) in eine Folge grundlegender als Filter bezeichneter Arbeitschritte.[18][19] Jeder Filter - er stellt einen Schritt bei der Datenverarbeitung dar - hat Eingabe- und bzw. oder Ausgabekontakte (Pins), die verwendet werden können, die Filter miteinander zu verbinden. Die Eigenart dieses Verbindungsmechanismus ermöglicht es, Filter auf verschiedene Weise zu verbinden, um verschiedene komplexe Funktionen zu implementieren.[20] Um solch eine zu implementieren muss man dann einen Filtergraphen, also eine Serie Instanzen der benötigten Filter erstellen, und diese dann verbinden.[21]
Es gibt drei Hauptarten von Filtern:
- Quellfilter
- Stellen die Quellstreams der Daten bereit. Zum Beispiel die zu verarbeitenden Daten aus den Mediendateien.
- Umwandlungsfilter
- Wandeln die Daten aus den Ausgaben anderer Filter um. Zum Beispiel, wenn Text in Videos eingefügt wird oder ein MPEG-Frame dekomprimiert wird.
- Verarbeitungsfilter
- Verarbeiten die Daten. Senden beispielweise audio zur Soundkarte, zeichnen ein Video auf den Bildschirm oder schreiben Daten in eine Datei.
Während des Verarbeitungsvorgans durchsucht der Filtergraph die Windows Registry für regristierte Filter und erstellt seine Filter and den verfügbaren Stellen. Dannach werden die Filter verbunden und können ausgeführt werden.Vorlage:Citation needed DirectShow-Filter werden viel bei der Wiedergabe von Videos (wobei die Filter verschiedene Funktionen wie Dateien parsen, Videos und Ton demultiplexen, dekomprimieren und rendern implementieren) sowie beim Aufnehmen, Bearbeiten, Verschlüsseln oder Umschlüsseln von Video und Ton oder der Datenübertragung in Netzwerken verwendet. Interaktive Aufgaben wie DVD-Navigation können auch von Direct-Show kontrolliert werden.Vorlage:Citation needed
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.Vorlage:Citation needed
Most filters are built using a set of C++ classes provided in the DirectShow SDK, called the DirectShow Base Classes.Vorlage:Citation needed These handle much of the creation, registration and connection logic for the filter.[23] 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.Vorlage:Citation needed 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.[24] However, many filter vendors ignore this feature, making graph modification problematic after a graph has begun processing.Vorlage:Citation needed
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.Vorlage:Citation needed It is possible for filter graphs to change over time as new filters are installed on the computer.Vorlage:Citation needed
Features
BearbeitenBy 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, and minimal digital rights management (DRM) support.[25][26] 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.[27][28][29] Incorporating support for additional codecs such as these can involve paying the licensing fees to the involved codec technology developer or patent holder.Vorlage:Citation needed 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.[30]
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.[31] 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.Vorlage:Citation needed
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.Vorlage:Citation needed Also in contrast to QuickTime, nothing special is required for loading a URL instead of a local file on diskVorlage:SndDirectShow's filter graph abstracts these details from the programmer, although recent developments in QuickTime (including an ActiveX control) have reduced this disparity.Vorlage:Citation needed
DirectShow Editing Services
BearbeitenDirectShow 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.[1] 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".[32] 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".[33]
As of March, 2012[34] (and, apparently as early as 2009[35]), Microsoft has stated that the DirectShow Editing Services "API is not supported and may be altered or unavailable in the future."
Video rendering filters
BearbeitenOriginally, 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).[13][36] It had limited access to the video window.Vorlage:Citation needed 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.Vorlage:Citation needed
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.Vorlage:Citation needed The Overlay Mixer uses DirectDraw 5 for rendering.[13] Downstream connection with the Video Renderer is required for window management.Vorlage:Citation needed 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.Vorlage:Citation needed 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.[37] 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.[38]
DirectX 9 introduced VMR-9, which is included in Windows XP SP2 and newer.[39] This version uses Direct3D 9 instead of DirectDraw, allowing developers to transform video images using the Direct3D pixel shaders.[40] It is available for all Windows platforms as part of the DirectX 9 redistributable.Vorlage:Citation needed As VMR-7 it provides a Windowless Mode. However, unlike Overlay mixer or VMR-7 it does not support video ports.[41] Using the /3GB boot option may cause VMR-9 to fail.[42]
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).[43] EVR is designed to work with Desktop Window Manager and supports DXVA 2.0, which is available on Windows Vista and Windows 7.[44]Vorlage:Citation needed It offers better performance and better quality according to Microsoft.[45]
Rezeption
BearbeitenAuszeichnungen
BearbeitenAm 8. Januar 2007 erhielt Microsoft den "Emmy award for Streaming Media Architectures and Components" auf der 58. jährlichen Preisverleihung.Technology & Engineering Emmy Awards.[46]
Unkompliziertheit
BearbeitenCommanding 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.[47][48] It is regarded as one of Microsoft's most complex development libraries/APIs.[49]Vorlage:Citation needed
Developers rarely create DirectShow filters from scratch. Rather, they employ DirectShow Base Classes.Vorlage:Citation needed The Base Classes can often simplify development, allowing the programmer to bypass certain tasks. However, the process may remain relatively complex;Vorlage:Citation needed the code found in the Base Classes is nearly half the size of the entire MFC library.Vorlage:Citation needed As a result, even with the Base Classes, the number of COM objects that DirectShow contains often overwhelms developers.Vorlage:Citation neededVorlage:Weasel inline In some cases, DirectShow's API deviates from traditional COM rules, particularly with regard to the parameters used for methods.Vorlage:Citation neededVorlage:Weasel inline 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.Vorlage:Citation neededVorlage:Weasel inline
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.Vorlage:Citation needed It is possible for filter graphs to change over time as new filters are installed on the computer.Vorlage:Citation needed
Codec hell
BearbeitenCodec 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.[50][51] 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.[51]
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."[51]
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.[52] 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.[22]
Endbenutzertools
BearbeitenDa Direct Show ein hauptsächlich für Entwickler konstruiertes Framework und API ist, stellt es keine direkte Endnutzerkontrolle über das Kodieren von Inhalt, weder beinhaltet es ein Interface für den Benutzer mittels vorinstallierter Codecs oder zu verschieden Formaten hin zu kodieren. Stattdessen ist den Entwicklern überlassen, Software mithilfe des API zu entwickeln. Die Benutzerfreundlichkeit einer Endbenutzer-GUI ist ersichtlich, seit das AVI Format und Codecs, von Video for Windows verwendet, noch gebräuchlich sind, zum Beispiel VirtualDub.
Siehe auch
BearbeitenEinzelnachweise
Bearbeiten- Pesce, Mark D.: Programming Microsoft DirectShow for Digital Video and Television. Microsoft Press, 2003, ISBN 0-7356-1821-6.
Weblinks
Bearbeiten- DirectShow on MSDNVorlage:Sndofficial documentation
- JRiver DirectShow Playback GuideVorlage:Snda tutorial on DirectShow with general-purpose information
- VideoLabVorlage:Snda video processing library with DirectShow support (free for non commercial purposes)
- AC3 Directshow FilterVorlage:SndAC3 audio filters with DirectShow support
- Using the DirectShow Video Mixing Renderer 9 filterVorlage:Sndan article on using DirectShow VMR9 by Sameer Ahmed
[[Category:Microsoft application programming interfaces]]
[[Category:Multimedia frameworks]]
[[Category:DirectX|Show DirectShow]]
- ↑ a b c Core Media Technology in Windows XP Empowers You to Create Custom Audio/Video Processing Components In: MSDN Magazine, Microsoft, July 2002. Abgerufen am 2. April 2007
- ↑ DirectShow. MSDN, 1. Dezember 2012, abgerufen am 21. Januar 2013.
- ↑ a b DirectShow documentation. In: MSDN Library. Microsoft, 1. Januar 2006, abgerufen am 1. Januar 2006.
- ↑ http://social.msdn.microsoft.com/Forums/en-US/36661a0b-fefa-4719-8134-6956e505e6f7/is-the-new-media-foundation-a-replacement-of-direct-show?forum=mediafoundationdevelopment MSFT Becky Weiss
- ↑ DirectShow: Core Media Technology in Windows XP Empowers You to Create Custom Audio/Video Processing Components. In: docs.microsoft.com. Abgerufen am 31. März 2021 (amerikanisches Englisch).
- ↑ B. Jones, Michael: The Microsoft Interactive TV System: An Experience Report. In: Microsoft Research. Microsoft, Juli 1997, archiviert vom am 16. Mai 2007; abgerufen am 2. April 2007.
- ↑ Vorlage:Cite press release
- ↑ Vorlage:Cite press release
- ↑ Vorlage:Cite press release
- ↑ Vorlage:Cite press release
- ↑ Eisler, Craig: DirectX Then and Now. In: Craig's Musings. 20. Februar 2006, archiviert vom am 11. Juli 2012; abgerufen am 17. August 2010.
- ↑ Vorlage:Cite press release
- ↑ a b c DirectShow FAQ. In: MSDN Library. Microsoft, 6. Juli 2010, abgerufen am 17. August 2010.
- ↑ FAQs about the DirectShow and Windows Media SDKs. In: MSDN Library. Microsoft, Dezember 2001, abgerufen am 17. August 2010.
- ↑ Vorlage:Citation needed
- ↑ DirectX Samples. In: MSDN Library. Microsoft, 11. September 2005, abgerufen am 11. September 2005.
- ↑ What's New in DirectShow Windows Vista. In: MSDN Library. Microsoft, 8. November 2006, abgerufen am 8. November 2006.
- ↑ Introduction to DirectShow application programming
- ↑ DirectShow system overview
- ↑ About DirectShow filters. In: MSDN Library. Microsoft, abgerufen am 17. August 2010.
- ↑ Overview of graph building. In: MSDN Library. Microsoft, abgerufen am 17. August 2010.
- ↑ a b Overview of GraphEdit. In: MSDN Library. Microsoft, abgerufen am 17. August 2010.
- ↑ DirectShow Base Classes. In: MSDN Library. Microsoft, abgerufen am 17. August 2010.
- ↑ Dynamic Graph Building. In: MSDN Library. Microsoft, abgerufen am 17. August 2010.
- ↑ Formats supported by default in DirectShow. In: MSDN Library. Microsoft, abgerufen am 11. September 2005.
- ↑ Microsoft's next scapegoat - DirectShow! In: retrakker. 13. Januar 2007, abgerufen am 18. August 2010.
- ↑ illiminable Directshow Filters for Ogg Vorbis, Speex, Theora and FLAC. Archiviert vom am 24. Februar 2006; abgerufen am 11. März 2006.
- ↑ Monogram's DirectShow filters for Musepack, AAC and AMR. Archiviert vom am 26. September 2011; abgerufen am 8. März 2008.
- ↑ AC3Filter. Abgerufen am 13. August 2010.
- ↑ Anderson, Dean, Lamberson, Jim: Using VideoLan VLC in DirectShow. In: An open source bridge from VLC to DirectShow. 2007, abgerufen am 15. Februar 2008.
- ↑ Thompson, Chris: DirectShow For Media Playback In Windows - Part III: Customizing Graphs. In: FLIPCODE.COM. 13. September 2000, abgerufen am 18. August 2010.
- ↑ About DirectShowNet Library. In: DirectShowNet SourceForge Website. SourceForge, abgerufen am 18. August 2010.
- ↑ The DSPack Project. Abgerufen am 18. August 2010.
- ↑ DirectShow Editing Services. Abgerufen am 9. April 2012.
- ↑ Video editing like "DirectShow Editing Services". Archiviert vom am 5. August 2011; abgerufen am 9. April 2012.
- ↑ DirectShow Video Renderer Filter. In: MSDN Library. Microsoft, abgerufen am 17. August 2010.
- ↑ Video Mixing Renderer 7 (VMR-7). Abgerufen am 11. September 2005.
- ↑ VMR Windowless Mode. In: MSDN Library. Microsoft, abgerufen am 11. September 2005.
- ↑ https://web.archive.org/web/20101018035741/http://msdn.microsoft.com/en-gb/library/ee416979(VS.85).aspx
- ↑ Video Mixing Renderer 9 (VMR-9). In: MSDN Library. Microsoft, abgerufen am 11. September 2005.
- ↑ Video Mixing Renderer Filter 9. In: MSDN Library. Microsoft, abgerufen am 11. September 2005.
- ↑ http://forum.videohelp.com/threads/292160-Loss-of-DirectDraw-Overlay-and-VMR9-after-upgrade-update
- ↑ Enhanced Video Renderer. In: MSDN Library. Microsoft, abgerufen am 28. Februar 2007.
- ↑ Various: DXVA 1.0 translator. In: MSDN Media Foundation forum. Microsoft, archiviert vom am 13. Januar 2009; abgerufen am 18. August 2010.
- ↑ Choosing the Right Video Renderer. In: MSDN Library. Microsoft, abgerufen am 11. September 2005.
- ↑ NATIONAL TELEVISION ACADEMY ANNOUNCES EMMY WINNING ACHIEVEMENTS: HONORS BESTOWED AT 58th ANNUAL TECHNOLOGY & ENGINEERING EMMY AWARDS. (pdf) In: Emmy Award. National Television Academy, Januar 2007, archiviert vom am 22. September 2010; abgerufen am 8. Januar 2007.
- ↑ Using DirectShow with Media Center Edition. In: /mceDirectShow. Archiviert vom am 21. November 2010; abgerufen am 18. August 2010.
- ↑ Roushu, Kurifu: The Basics to using DirectShow. In: Gamedev.net. 13. März 2001, archiviert vom am 8. Februar 2012; abgerufen am 18. August 2010.
- ↑ Mark Richards: Overview: What is the Augmented Reality Toolkit? 26. August 2008, archiviert vom am 19. Juli 2008; abgerufen am 25. Januar 2009.
- ↑ Codec Hell. In: HomeVideo101 Blog. 22. Juni 2007, archiviert vom am 11. Februar 2012; abgerufen am 18. August 2010.
- ↑ a b c Lanier, Chris: New Age DLL Hell? Hell Yes. In: Chris Lanier's Blog. MSMVPS.COM, 27. Januar 2005, archiviert vom am 12. Februar 2007; abgerufen am 27. Februar 2007.
- ↑ The GSpot Codec Information Appliance. Abgerufen am 18. August 2010.