Forum > Audio and Video

Is it possible to Capture video and modify it before display in Windows (SOLVED)

<< < (2/8) > >>

Dzandaa:
Hi,

If you like "Old Stuffs", here is a Camera Capture Skeleton using Video For Windows from a Delphi Conversion.

Just a test, feel free to modify.

B->

gidesa:
Hello, there is the also the Laz_Win_DsPack, a series of components for Directshow,
the successor of Video for Windows. In its repository there is one example for
capturing video source frames as BMP /TBitmap. Having the BMP, of course the choice
of library depends on what type of modification you want to do on image.
See https://forum.lazarus.freepascal.org/index.php/topic,16797.0.html
By the way,  Opencv official binaries for Windows, downloadable from their site,
has support for OpenCL, that is more general GPU library. Because Cuda is only for Nvidia
cards, instead OpenCL is for Nvidia, AMD, and more GPUs. 

Dzandaa:
Hi,

@Gidesa,

I know Laz_Win_DsPack, but I don't know how to capture a frame and modify it or how to select the camera and resolution.

I tried the VMRBitmap example but it plays just the video from the camera and when I click on Text, it crashes with Message:

--- Quote ---Canvas does not allow drawing
--- End quote ---

As always, using a camera on lazarus with Windows is not as easy as in Linux :)

B->

gidesa:

--- Quote from: Dzandaa on June 12, 2024, 02:02:39 pm ---As always, using a camera on lazarus with Windows is not as easy as in Linux :)

--- End quote ---

You are totally right! I went crazy :-) Because Opencv was lacking camera tuning (contrast, etc.),
and DSPack was very low level.
But now things are a (bit) different.
In Laz Win Dspack the relevant examples are missing. You can download from Delphi DSPack Github
the Demos/D6-D7/SampleGrabber. Maybe it has to be adapted a bit to Lazarus.
More, I attach a Delphi unit I wrote. There is a class that, using DSPack, exposes some useful functions. For example
list all Directshow video sources,  select one of them, change parameters (contrast, brightness, ..),
capture a frame, show the video source native dialogs.
Also this unit probably has to be adapted to Lazarus.

af0815:
Try to use https://github.com/afriess/LazarusVideoUtilities.git and Branch WIP_andi, there are more samples

Edit: Compilable sample with Lazarus 3.4 (rev unknown) FPC 3.2.3 i386-win32-win32/win64 , but i have actual no camera installed

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version