Delphi-PRAXiS
Seite 3 von 3     123   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Software-Projekte der Mitglieder (https://www.delphipraxis.net/26-software-projekte-der-mitglieder/)
-   -   WebCam mit DirectShow (https://www.delphipraxis.net/70813-webcam-mit-directshow.html)

Gutelo 14. Feb 2014 04:51

AW: WebCam mit DirectShow
 
Liste der Anhänge anzeigen (Anzahl: 1)
Hallo Grizzly,

noch eine weitere Frage. Ich verwende Version 3.0, da ich nicht diese Graphik lib einbinden moechte. Allerdings wuerde ich gerne die doppelten Eintraege bei der Liste der Aufloesung entfernen (korrigiert in version 3.2).

Nun habe ich Unterschiede in FUNCTION TVideoSample.LoadListOfResolution: HResult; zwischen Ver. 3.0 und 3.2 gesucht und die Zeile

IF not(IsEqualGUID(ppmt^.formattype, KSDATAFORMAT_SPECIFIER_VIDEOINFO2)) then

gefunden. Diese habe ich bei Version 3.0 hinzugefuegt. Allerdings aendert das nichts an der Menge der aufgelisteten Aufloesungswerte. Ich bin mir nicht sicher on meine doppelten Eintraege ueberhaupt doppelt sind. Jede Aufloesung kommt zwar doppelt vor, aber jeweils endend mit ...(RGB) oder ...(xyz) wobei xyz chinesische Character sind (siehe Anhang). Ich vermute dass es zwei unterschiedliche Graphikformate sind.

Gutelo

grizzly 14. Feb 2014 12:12

AW: WebCam mit DirectShow
 
Hallo!

In der 3.2 ist in TFormatInfo der Typ von FourCC geändert: Von ARRAY[0..3] OF char zu ARRAY[0..3] OF ansichar.
Vielleicht behebt das schon das Problem mit der ulkigen Angabe zum verwendeten Kompressor.

Welche Grafik lib meinst Du? GDI+?
Falls das das Problem ist: In Unit VFrames.pas einfach die Unit UGDIPLus rauswerfen. Beim Kompilieren wird dann ein Fehler in der Methode UnpackFrame moniert. An dieser Stelle ist aber der alte Code noch drinnen. Einfach den GDI+ Zweig auskommentieren, und die 3.2 läuft ohne GDI+:
Delphi-Quellcode:
{
 IF GDIPlusAvailable // GDI+ version is faster than Delphi's JPEG library
   then begin
     if fGray8Bit
       then GDIPlus_LoadBMPStream2(MemStream, FBitmapGray)
       else GDIPlus_LoadBMPStream2(MemStream, FBitmap);
   end
   else begin}
     JPG.Grayscale := fGray8Bit;
     JPG.LoadFromStream(MemStream);
     if fGray8Bit
       then FBitmapGray.Canvas.Draw(0, 0, JPG)
       else FBitmap.Canvas.Draw(0, 0, JPG);
   {end;}

Hätte ich einen Compiler-Switch machen sollen...

Gruß
Michael

grizzly 14. Feb 2014 12:19

AW: WebCam mit DirectShow
 
Ups, jetzt sehe ich erst die anderen Posts.

@Drumbo: 64-bit habe ich noch keinerlei Erfahrung, da werde ich so bald keine Antwort liefern können. Aber unterstützen die neuen Delphis (X2, X3, X4, X5 etc) nicht schon von Haus aus Video, so dass man meinen Code hier gar nicht braucht?

@Gutelo: Das mit dem fVideoRunning hört sich nach einem Fehler an. Muss ich bei Gelegenheit prüfen. Momentan ist nur mal wieder die Zeit knapp :cry:

Gruß
Michael

wamkuipers 24. Mai 2014 13:57

AW: WebCam mit DirectShow
 
Bitte entshudige mich, i rede nicht sehr gut Deutsch.

I have a problem with vsample.pas. Basicly i like the software.

I my application
procedure TVideoImage.WndProc(var Msg: TMessage);

calls in fOnNewFrame(self, fWidth, fHeight, fImagePtr[fImagePtrIndex]);

multiple times in a re-entrant way.

That causes even program crashes.

It is not clear why that happens.
I assume that errors occur not caught by
Application.HandleException(Self); // the wrong Thread?

Actually my callback procedure is called in the VCL (mainform) thread which is ok.

I can get clear how it can occur that my call procedure is called again before is has finished!
A posible reason could be improperly handled errors.
Also the DSPACK have a similar behaviour, but even a lot worse.

My callback procedure use (mainform).update calls, which should be allowed in the VCL thread. (With DSPACK the callback procedure does is NOT called in the VCL thread ...)

Further more the video picture blocks with moving the mainwindow with a leftmouse down.

Any sugestions what could cause my trouble?

Kind regards
William


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:51 Uhr.
Seite 3 von 3     123   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz