Forum > Audio and Video
Is it possible to Capture video and modify it before display in Windows (SOLVED)
Dzandaa:
Hi,
To @af0815
Lazarus Crash at loading.
I don't have FPC 3.2.3 (I have 3.2.2), so I presume that is a compatibility problem.
I rewrote the main form in a new project, add tst_prffrmvideo unit and form
set -dEINEKAMERA in Options
But when I select KameraOnExecute, I just have a message in the log, No opening Form:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---A: Search Cam=LifeCam Num=1A: Cam=Webcam C110A: Select Cam =31msA: No configured Camera found -> exitA: Play =0msA: Stop =0ms--- Startup=2543ms ------
I uncommented KameraA.Show; Now I see the form.
I suppose I miss something :)
Thanks anyway.
B->
af0815:
yes, you must know the name of the device or the correct devicenum.
The version of fpc and Lazarus is normal not the problem, the actual system here works for 7 years. So it was an older version too.
I'll look for a camera.
gidesa:
Attached an example of using DSPack and TVideoControl, adapted for Lazarus (2.2.6)/FPC (3.2.2).
I think that you cannot directly modify image in VideoWindow control, but have to capture as bitmap, and show on a separate area, for example a TImage.
af0815:
I wor with the GraphStudioNext https://github.com/cplussharp/graph-studio-next to find out the internal working of the filters. And ther you find the Correct name and other information to deal later in Lazarus. And nearly all you can do with this tool you can also do with Lazarus. But the hardest thing is to connect the correct ports of the filters and the parameters.
I have the software running an get pictures
a) You have to configure the correct name of the camera
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- KameraA.NameKamera:= 'Integrated Webcam';//MyNameKamera; KameraA.NameFormat:= 'Major Type: Video - Sub Type: YUY2 Format: VideoInfo YUY2 640X480, 16 bits';//MyNameFormat; b ) After the camera is found you see the possible modes and this you have to configure too
c ) in tst_prffrmvideo remove the check for the correct width and heigh (or correct this value)
d) with toggle you can make snapshot
After this it is running for me :-)
Dzandaa:
Hi,
@af0815
Working now for:
Major Type: Video - Sub Type: MJPG Format: VideoInfo2 MJPG 1024X768, 24 bits
I also had to change:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- if IsEqualGUID(VideoMediaTypes.Items[i].majortype,MEDIATYPE_Video) AND IsEqualGUID(VideoMediaTypes.Items[i].subtype, MEDIASUBTYPE_MJPG) AND IsEqualGUID(VideoMediaTypes.Items[i].formattype,FORMAT_VideoInfo) then begin if (VideoMediaTypes.Items[i].AMMediaType^.cbFormat > 0) and assigned(VideoMediaTypes.Items[i].AMMediaType^.pbFormat) then with PVideoInfoHeader(VideoMediaTypes.Items[i].AMMediaType^.pbFormat)^.bmiHeader do begin if SameText(GetFOURCC(biCompression),'MJPG') AND (biWidth = 1024) AND (biHeight = 768) AND (biBitCount = 24) then begin {$Ifdef KAMERADEBUG}DoMessage('Media selected='+MediaStr); {$EndIf} SelMedia:= i; break; end; end; end
Thank you very much.
I'll examine the code deeper later.
B->
Navigation
[0] Message Index
[#] Next page
[*] Previous page