Page 1 of 1

TRVCamRecorder.VideoAutoSize not working

Posted: Sun Jul 29, 2018 9:00 pm
by oliver
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?

Re: TRVCamRecorder.VideoAutoSize not working

Posted: Tue Jul 31, 2018 4:11 pm
by Sergey Tkachenko
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)

Re: TRVCamRecorder.VideoAutoSize not working

Posted: Fri Aug 03, 2018 11:07 pm
by oliver
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.

Re: TRVCamRecorder.VideoAutoSize not working

Posted: Sat Aug 04, 2018 10:01 am
by Sergey Tkachenko
Maybe the autosize work, but the video frame size is influenced by RVCamera.DesktopZoomPercent property?

Re: TRVCamRecorder.VideoAutoSize not working

Posted: Sun Aug 05, 2018 7:21 am
by oliver
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.

Re: TRVCamRecorder.VideoAutoSize not working

Posted: Sun Aug 05, 2018 3:22 pm
by Sergey Tkachenko
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.

Re: TRVCamRecorder.VideoAutoSize not working

Posted: Sun Aug 05, 2018 8:21 pm
by oliver
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.

Re: TRVCamRecorder.VideoAutoSize not working

Posted: Mon Aug 06, 2018 3:47 pm
by Sergey Tkachenko
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 https://www.trichview.com/forums/viewto ... =17&t=9233