Page 1 of 1
Adding text to video
Posted: Sun Dec 01, 2024 8:15 am
by kennyJeon
Hello
I am recording a web camera with text information using the OnGetImage event
When I used RVMediaVCLSetupVer8.exe, it was recorded well
But when I try to record using RVMediaVCLSetup_v11.exe
The web screen is overlapping with text on the screen when Camera On
What is wrong? Please advise
Thank you!

- V11.png (129.28 KiB) Viewed 101530 times

- V8.png (151.12 KiB) Viewed 101530 times
Re: Adding text to video
Posted: Sun Dec 01, 2024 10:30 am
by Sergey Tkachenko
What's your code for writing text?
Most probably, it should be protected by a critical section.
Re: Adding text to video
Posted: Mon Dec 02, 2024 1:46 am
by kennyJeon
Code: Select all
procedure TfrmMain.RVCamera1GetImage(Sender: TObject; img: TRVMBitmap);
var
bmp: TBitmap;
sDisplayStemp : Array[0..20] of String;
iSZ: TSize;
rDT, rTS : Real;
iTH, iTM, iDY : Integer;
i, iBtCnt : Integer;
sTS : String;
begin
rDT := Now;
iDY := Trunc(rDT);
rDT := rDT - iDY;
iTH := Trunc(rDT * 24);
iTM := Trunc(rDT * 24 * 60) - (iTH * 60);
rTS := (rDT * 24 * 60 * 60) - (iTH * 60 * 60) - (iTM * 60);
if rTS > 10 then sTS := Format('%2.1f', [rTS])
else sTS := '0' + Format('%2.1f', [rTS]);
bmp := img.GetBitmap;
with bmp.Canvas do
begin
Lock;
try
if CFG.bBkView then
begin
Brush.Style := bsSolid;
Brush.Color := CFG.iBkCR;
Rectangle(cfg.iSX, cfg.iSY, CFG.iEX, CFG.iEY);
end;
Brush.Style := bsClear;
Font.PixelsPerInch := 96;
iBtCnt := 0;
IND.sVal[0] := FormatDateTime('yyyy.mm.dd.', now);
IND.sVal[1] := Format('%2d:%.2d:', [iTH, iTM]) + sTS;
IND.sVal[2] := Format('%8.2f', [IND.rTM]);
for i := 0 to 20 do
begin
if CFG.bView[i] then
begin
Font.Name := CFG.sFtNm[i];// 'Tahoma';
Font.Color := CFG.iFtCR[i]; // clWhite;
Font.Size := CFG.iFtSZ[i]; // 32
if not CFG.bStyle[i, 0] and not CFG.bStyle[i, 1] then Font.Style := [];
if not CFG.bStyle[i, 0] and CFG.bStyle[i, 1] then Font.Style := [fsItalic];
if CFG.bStyle[i, 0] and not CFG.bStyle[i, 1] then Font.Style := [fsBold];
if CFG.bStyle[i, 0] and CFG.bStyle[i, 1] then Font.Style := [fsBold,fsItalic];
sDisplayStemp[i] := CFG.sTitle[i] + IND.sVal[i] + ' ' + CFG.sUnit[i];
TextOut(CFG.iX[i], CFG.iY[i], sDisplayStemp[i]);
end;
end;
finally
Unlock;
end;
end;
img.UpdateData;
end;
Re: Adding text to video
Posted: Mon Dec 02, 2024 1:50 am
by kennyJeon
Written in Delphi 7.0 (Build8.1)
Re: Adding text to video
Posted: Mon Dec 02, 2024 9:10 am
by Sergey Tkachenko
I confirm the problem.
Quick fix:
Open MRVWinWebCamera.pas.
Find the line:
bmp.Modified := TRUE;
Add after:
bmp.ModifiedData := TRUE;
A critical section is not needed.
Re: Adding text to video
Posted: Tue Dec 03, 2024 11:06 pm
by kennyJeon
Resolved
bmp.ModifiedData := TRUE;
Added and confirmed no issues
Thank you