Changing RVCamView source while streaming

New product: VCL components for displaying and controlling IP cameras, webcams, video conferencing, video chats
Post Reply
RogerioUK
Posts: 7
Joined: Mon May 02, 2016 2:39 pm
Location: Brazil

Changing RVCamView source while streaming

Post by RogerioUK » Sat Aug 26, 2017 2:29 pm

I am trying to use a RVCamView in the configuration window of my system so the user can preview the image of each camera while selecting one

Configuracao.png
Configuracao.png (11.8 KiB) Viewed 841 times

The problem is:

If I change the camera with the Mostrar Imagem checkbox checked, the stream stops and don´t restart.
If I uncheck the checkbox, change the camera and check the checkbox the stream start.
I believe is a timing problem and I would prefer not to force the user stop the preview streaming before change the camera.

Is there a solution for this behavior ?

obs. The extra parameter in the CamListLoader.Select prevents the procedure to execute RunCamera if it is false.

The OnChange event of the Camera dropbox contain

Code: Select all

  if ckMostraImagem.Checked then begin
    RVCamera.Abort;
    RVCamera.WaitForVideo
  end;
  
  CamListLoader.Select(cmbCameras.ItemIndex, RVCamera,False);
  
  if ckMostraImagem.Checked then begin
    RVCamera.PlayVideoStream;
  end;
and the checkbox OnClick event contains

Code: Select all

  if ckMostraImagem.Checked then begin
    RVCamera.PlayVideoStream;
  end
  else begin
    RVCamera.Abort;
    RVCamera.WaitForVideo
  end

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

Re: Changing RVCamView source while streaming

Post by Sergey Tkachenko » Sun Aug 27, 2017 10:13 am

First question: which kind of cameras? If this is IP camera specified by CameraHost:CameraPort, you need to call SearchCamera, and call PlayVideoStream when the search is finished.

RogerioUK
Posts: 7
Joined: Mon May 02, 2016 2:39 pm
Location: Brazil

Re: Changing RVCamView source while streaming

Post by RogerioUK » Sun Aug 27, 2017 3:35 pm

The two cameras I am using are webcam.

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

Re: Changing RVCamView source while streaming

Post by Sergey Tkachenko » Mon Aug 28, 2017 5:57 pm

Can you create a simple project reproducing this problem and send its source code to me (or attach to the forum)

RogerioUK
Posts: 7
Joined: Mon May 02, 2016 2:39 pm
Location: Brazil

Re: Changing RVCamView source while streaming

Post by RogerioUK » Thu Aug 31, 2017 12:29 pm

Here is the example project.

Having two webcam in the computer, first let's try what work.

1. Select first camera
2. Check the preview checkbox (the image is displayed)
3. Uncheck the preview
4. Select second camera
5. Check the preview and the image is displayed.

You can continue with this process and it work everytime

Now let's try what NOT work.

1. Select first camera
2. Check the preview checkbox (the image is displayed)
3. Select second camera. The code uncheck the preview, change the camera and recheck the preview but the image don´t display.
Attachments
Main.zip
(15.27 KiB) Downloaded 20 times

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

Re: Changing RVCamView source while streaming

Post by Sergey Tkachenko » Thu Nov 02, 2017 10:26 pm

This problem is fixed in RVMedia 5.2 BETA (available for registered users)

Post Reply