TRVCamRecorder.VideoAutoSize not working

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
Post Reply
oliver
Posts: 30
Joined: Mon Aug 28, 2017 4:42 am

TRVCamRecorder.VideoAutoSize not working

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17236
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRVCamRecorder.VideoAutoSize not working

Post 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)
oliver
Posts: 30
Joined: Mon Aug 28, 2017 4:42 am

Re: TRVCamRecorder.VideoAutoSize not working

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17236
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRVCamRecorder.VideoAutoSize not working

Post by Sergey Tkachenko »

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 »

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: 17236
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRVCamRecorder.VideoAutoSize not working

Post 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.
oliver
Posts: 30
Joined: Mon Aug 28, 2017 4:42 am

Re: TRVCamRecorder.VideoAutoSize not working

Post 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.
Attachments
Recorder Autosize.zip
(133.76 KiB) Downloaded 1185 times
Sergey Tkachenko
Site Admin
Posts: 17236
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRVCamRecorder.VideoAutoSize not working

Post 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
Post Reply