Einzelnen Beitrag anzeigen

hathor
(Gast)

n/a Beiträge
 
#9

AW: Mediaplayer spielt keine .MOV und keine .MP4-Datein

  Alt 23. Mai 2015, 19:36
Dieses Progrämmchen spielt auch VIDEOs:
http://www.delphipraxis.net/182667-d...ermeldung.html

Delphi-Quellcode:
program DirectShow_PLAYER;
// FFDSHOW, LAV VIDEODECODER

{$APPTYPE CONSOLE}
uses
WinApi.DirectShow9,
WinApi.Windows,
WinApi.ActiveX;

var
pGraph : IGraphBuilder;
pControl : IMediaControl;
pEvent : IMediaEvent;
hr : HRESULT;
evCode : integer = 0;
begin
hr := CoInitialize(nil);

if FAILED(hr) then
begin
Writeln('ERROR - Could not initialize COM library');
Halt(0);
end;

// Create the filter graph manager and query for interfaces.
hr := CoCreateInstance(CLSID_FilterGraph, nil, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, pGraph);
if FAILED(hr) then
begin
Writeln('ERROR - Could not create the Filter Graph Manager.');
Halt(0);
end;

pGraph.QueryInterface(IID_IMediaControl, pControl);
pGraph.QueryInterface(IID_IMediaEvent, pEvent);

// IMPORTANT: Change this string to a file on your system.
//hr := pGraph.RenderFile('Alarm01.mp3', nil); // Build the graph
//hr := pGraph.RenderFile('DOTW.flac', nil); // Build the graph
hr := pGraph.RenderFile('Film.dvr', nil); // Build the graph
if SUCCEEDED(hr) then
begin
hr := pControl.Run(); // Run the graph
if SUCCEEDED(hr) then
begin
pEvent.WaitForCompletion(3600000, evCode); // 60 Min wait for completion
//pEvent.WaitForCompletion(INFINITE, evCode);
// Note: Do not use INFINITE in a real application, because it
// can block indefinitely.
end;
end;
pControl:=nil;
pEvent:=nil;
pGraph:=nil;
CoUninitialize;
end.
Angehängte Dateien
Dateityp: zip DS_PLAYER.zip (866,9 KB, 28x aufgerufen)

Geändert von hathor (23. Mai 2015 um 19:53 Uhr)
  Mit Zitat antworten Zitat