RVCamera doesn't show video if VideoDeviceIndex is set and SetCamVideoMode(0) is called before PlayVideoStream

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
Post Reply
ya_vanka
Posts: 65
Joined: Tue Oct 22, 2019 6:24 pm

RVCamera doesn't show video if VideoDeviceIndex is set and SetCamVideoMode(0) is called before PlayVideoStream

Post by ya_vanka »

Found an issue with RVCamera.

In my project I should set RVCamera.VideoDeviceIndex and call RVCamera.SetCamVideoMode() just before RVCamera.PlayVideoStream.

The issue is that if I pass 0 to RVCamera.SetCamVideoMode() then video is not shown (and RVCameraGetImage() is not being called). If I pass any other value (> 0) then everything is ok.
This issue appeared in version 7. In version 6 there was no such a problem.

You can reproduce the issue by adding two lines in procedure TfrmMain.btnOnClick of the demo project "WebCamera":

Code: Select all

procedure TfrmMain.btnOnClick(Sender: TObject);
begin
  RVCamera1.VideoDeviceIndex := cmbCamera.ItemIndex;
  RVCamera1.SetCamVideoMode(cmbVideoResolution.ItemIndex);

  RVCamera1.PlayVideoStream;
end;
Could you please fix the issue.
ya_vanka
Posts: 65
Joined: Tue Oct 22, 2019 6:24 pm

Re: RVCamera doesn't show video if VideoDeviceIndex is set and SetCamVideoMode(0) is called before PlayVideoStream

Post by ya_vanka »

Have you reproduced the issue?
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: RVCamera doesn't show video if VideoDeviceIndex is set and SetCamVideoMode(0) is called before PlayVideoStream

Post by Sergey Tkachenko »

It looks like the problem occurs when you call SetCamVideoMode with the parameter equal to GetCamVideoModeIndex.
It can be reproduced in the original webcam demo by choosing a video mode in the combo box that is already selected.
While it can easily be fixed by checking for this case, I am still trying to understand why it happens...
ya_vanka
Posts: 65
Joined: Tue Oct 22, 2019 6:24 pm

Re: RVCamera doesn't show video if VideoDeviceIndex is set and SetCamVideoMode(0) is called before PlayVideoStream

Post by ya_vanka »

Great!
Going to upgrade and test.
Post Reply