Delphi Webcam Simple Program

2019-02-07 12:53发布

问题:

Can anyone help me to create a simple viewing of cam using just a simple TVideo component in delphi having a vid size of 160x120 only as default (no resize). Just a simple one. Please. Badly needed for my new project.

thanks.

回答1:

There are many ways to do it , I couldn't understand what do you mean by TVideo component but my solution can show image on a paintbox(any TCanvas)

use

http://www.delphibasics.info/home/delphibasicsprojects/directxdelphiwebcamcaptureexample/DirectXDelphiWebcamCapture.rar

this is a directX conversion to pascal made by michael@grizzlymotion.com

add VSample.pas and VFrames.pas to your project

uses  VFrames;

procedure TForm6.Button1Click(Sender: TObject);

var
cam:TVideoImage;
strlst:TStringList;
begin

   strlst := TStringList.Create ;

   cam := TVideoImage.Create;
   cam.GetListOfDevices(strlst);

   cam.SetDisplayCanvas(PaintBox1.Canvas);
   cam.VideoStart(strlst.Strings[0])    ;//specify your cam by number
end;


回答2:

I don't know what TVideo is, but if you can use another component, for non-commercial projects, the Mitov Video library is free. It works with DirectX video, which is what most (all?) webcams use. It comes with excellent example programs, including one that plays back videos.

You can accomplish your goal with almost no programming. You simply drag and drop his components and connect them in his GUI component editor (named OpenWire)in the IDE.

We have used their components for years and are very happy with them. Highly recommended.

They also have great real-time plotting and audio processing tools that all work together with threading built-in to make it fast, fast, fast.

http://www.mitov.com/.



标签: delphi webcam