Wenn dies Ihr erster Besuch hier ist,
lesen Sie bitte zuerst die Hilfe - Häufig gestellte Fragen
durch. Sie müssen sich vermutlich registrieren,
bevor Sie Beiträge verfassen können. Klicken Sie oben auf 'Registrieren', um den Registrierungsprozess zu
starten. Sie können auch jetzt schon Beiträge lesen. Suchen Sie sich einfach das Forum aus, das Sie am meisten
interessiert.
das Topic ist leider nicht so aussagekräftig, wie du denken magst ;-)
<pre>
File.Open("film.avi");
</pre>
Wenn es etwas mehr sein soll, als lediglich "öffnen", dann kommst du sicherlich um DirectShow nicht herum.
Anbei ein bisschen Copy&Paste von dem, was ich auf die schnelle gefunden habe:
DirectShow is what you want (part of DirectX, so you'd better get the DirectX SDK).
With DirectShow, you can play/pause more or less any file type WindowsMediaPlayer supports in a few lines of code: http://msdn.microsoft.com/library/en-us/directshow/htm/howtoplayafile.asp
Of course you can embed the video window in your own window: http://msdn.microsoft.com/library/en-us/directshow/htm/ivideowindowinterface.asp
If you need to grab a snapshot and display that elsewhere, you can use the MediaDet object instead of a playback graph: http://msdn.microsoft.com/library/en-us/directshow/htm/mediadetector.asp
DirectShow is mostly meant to be used from C/C++ but you can find some free .NET wrappers for it or write your own (not as easy as it sounds).
For example, DirectShow provides an automation-compatible wrapper for the basic playback functionality you need so that you can generate a wrapper for it using tlbimp.exe against quartz.dll: http://msdn.microsoft.com/library/en-us/directshow/htm/usingdirectshowwithvisualbasic.asp
There is an automation wrapper for the MediaDet object as well: http://msdn.microsoft.com/library/en-us/directshow/htm/mediadetobject.asp=
Last, there is a very limited managed wrapper provided with the DirectX SDK, which may be enough to just display the first frame: http://msdn.microsoft.com/library/en-us/directx9_m/directx/ref/microsoft.directx.audiovideoplayback.asp
Comment