TRVCamRecorder.VideoAutoSize not working

New product: VCL components for displaying and controlling IP cameras, webcams, video conferencing, video chats
Post Reply
oliver
Posts: 30
Joined: Mon Aug 28, 2017 4:42 am

TRVCamRecorder.VideoAutoSize not working

Post by oliver » Sun Jul 29, 2018 9:00 pm

When the TRVCamRecorder is connected to a TRVCamera with DeviceTpe=rvdtDesktop the TRVCamRecorder does not set its VideoWidth and VideoWidth automatically.

I figured out a workaround when using DesktopMode=vrdmWindow by using GetWindowRect() to get the size of the window I am capturing, but how can I get the size of the monitor(s) or desktop when I use DestopMode=rvdmFull?

Is there a way to get the video size from TRVCamera?

Sergey Tkachenko
Site Admin
Posts: 14034
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRVCamRecorder.VideoAutoSize not working

Post by Sergey Tkachenko » Tue Jul 31, 2018 4:11 pm

VideoAutosize must work in any mode. It does not depend on the video source: when the recorder gets a video frame, it sets video size according to this frame size.
I'll check the desktop mode after we will fix the problem with file sending via server (this is a problem we are currently working on)

oliver
Posts: 30
Joined: Mon Aug 28, 2017 4:42 am

Re: TRVCamRecorder.VideoAutoSize not working

Post by oliver » Fri Aug 03, 2018 11:07 pm

I wanted to let you know, when the DesktopWindowHandle is set to a form's control (e.g. a TPanel), the VideoAutoSize seems to work fine, but when setting the handle to the form itself it does not.

Sergey Tkachenko
Site Admin
Posts: 14034
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRVCamRecorder.VideoAutoSize not working

Post by Sergey Tkachenko » Sat Aug 04, 2018 10:01 am

Maybe the autosize work, but the video frame size is influenced by RVCamera.DesktopZoomPercent property?

oliver
Posts: 30
Joined: Mon Aug 28, 2017 4:42 am

Re: TRVCamRecorder.VideoAutoSize not working

Post by oliver » Sun Aug 05, 2018 7:21 am

No it is not.

When setting the DestopWindowHandle to an application's main form window handle, the VideoHeight and VideoWidth properties do not change in reference to the Camera's video source.

When setting the DesktopWindowHandle to a control within the main form everything works as expected.

Using DeviceType=webcamera, everything works as expected as well.

Sergey Tkachenko
Site Admin
Posts: 14034
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRVCamRecorder.VideoAutoSize not working

Post by Sergey Tkachenko » Sun Aug 05, 2018 3:22 pm

I tried but I was not able to reproduce the problem. Please send me a source code of a simple project to reproduce.

However, I found a problem in recording, if source video width is not a multiple of 8, lines in the resulting video may be shifted. We will fix it in the next update. I hope it will be released soon, since we finally fixed the bug we hunted for in last weeks.

oliver
Posts: 30
Joined: Mon Aug 28, 2017 4:42 am

Re: TRVCamRecorder.VideoAutoSize not working

Post by oliver » Sun Aug 05, 2018 8:21 pm

While I was creating the sample project you requested, I figured out the actual issue. It seems to be a timing issue. When I execute the following code, the first line reports the original video size of the RVCamRecorder, but the second one (after 1 second pause) reports the correct one.
RVCamRecorder1->VideoAutoSize = true;
RVCamRecorder1->Active = false;
RVCamera1->DeviceType = rvdtWebCamera;
RVCamera1->VideoDeviceIndex = 0;
RVCamera1->PlayVideoStream();
RVCamRecorder1->Active = true;
Memo1->Lines->Add("Recorder: " + String (RVCamRecorder1->VideoWidth) + " x " + String (RVCamRecorder1->VideoHeight));
Sleep (1000);
Memo1->Lines->Add("Recorder: " + String (RVCamRecorder1->VideoWidth) + " x " + String (RVCamRecorder1->VideoHeight));

Waiting 1 second does work when the DeviceType=rvdtWebCamera. Unfortunately, when the DeviceType=rvdtDesktop this workaround doesn't work. Increasing the wait time has no effect either. However, when I check the video size with a button click, the correct size does get reported.

I am attaching my sample project so you can see for yourself, but I had to remove the FMeg dlls to upload.
Attachments
Recorder Autosize.zip
(133.76 KiB) Downloaded 4 times

Sergey Tkachenko
Site Admin
Posts: 14034
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRVCamRecorder.VideoAutoSize not working

Post by Sergey Tkachenko » Mon Aug 06, 2018 3:47 pm

For desktop, video will not be started until you hold the main process, i.e. till the end of this procedure. Sleep does not help, because it just pauses the main process.
I suggest to get video size as I described in viewtopic.php?f=17&t=9233

Post Reply