Debian x64 Lazarus and RVMedia 7.x not working with camera

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
Post Reply
af0815
Posts: 7
Joined: Mon Dec 09, 2019 5:13 am

Debian x64 Lazarus and RVMedia 7.x not working with camera

Post by af0815 »

I have setup a new Debian Buster (10.x = x64), installed Lazarus fixes 2.0 with FPC fixes 3.2. FFMpeg, v4l2 and gestreamer1.x is installed (gstreamer0.1 is not more available in Debian and Ubuntu).

Then i copied the files from a windows installation to the PC. I have tried the Lazarus Demo SwitchCamLaz, compiled and start but the programms freeze and nothing is shown.
The same Demo is running in windows out of the box, with the same camera.

Camera: Testing with a Logitech WebCam C930e
The camera is found under Debian as /dev/video2 and working with other software.

What is the best practice to bring the software working on linux.
af0815
Posts: 7
Joined: Mon Dec 09, 2019 5:13 am

Re: Debian x64 Lazarus and RVMedia 7.x not working with camera

Post by af0815 »

I was diving into the code and found out, in TRVWebCam.PlayVideoStream the part where the camera is openend is never reached because State of the thread is set to run in the execute method, so the camera is not able to start.
i use this for testing (and it is selecting video0)

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  zus : string;
begin
  zus := '';
  RVCamera1.DeviceType:= rvdtWebCamera;
  RVCamera1.VideoDeviceIndex:=0;
  if RVCamera1.IsSupportedGStreamer then zus := zus + ' GStreamer';
  if RVCamera1.IsSupportedFFMPEG then zus := zus + ' FFMpeg';
  Label1.Caption := RVCamera1.VideoDeviceList[0] + zus;
  RVCamera1.PlayVideoStream;
end;
BTW:My cameras are on /dev/video0 (internal webcam) and /dev/video2 (external Logitech)
Sergey Tkachenko
Site Admin
Posts: 17520
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Debian x64 Lazarus and RVMedia 7.x not working with camera

Post by Sergey Tkachenko »

Thank you for the information. There were last-time changed in our thread code for Linux, probably they affect web cameras. We are studying the problem.
af0815
Posts: 7
Joined: Mon Dec 09, 2019 5:13 am

Re: Debian x64 Lazarus and RVMedia 7.x not working with camera

Post by af0815 »

Is it possible to get the older version (before the - i think - untested last-time change), because i need a working solution for a project with a v4l usb camera.
Sergey Tkachenko
Site Admin
Posts: 17520
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Debian x64 Lazarus and RVMedia 7.x not working with camera

Post by Sergey Tkachenko »

We fixed this problem in our working version.
Should I send fixed pas-files to you by email?
af0815
Posts: 7
Joined: Mon Dec 09, 2019 5:13 am

Re: Debian x64 Lazarus and RVMedia 7.x not working with camera

Post by af0815 »

Sergey Tkachenko wrote: Fri Dec 20, 2019 7:34 pm Should I send fixed pas-files to you by email?
You're welcome. I'll test it as soon as possible. :D

THX
af0815
Posts: 7
Joined: Mon Dec 09, 2019 5:13 am

Re: Debian x64 Lazarus and RVMedia 7.x not working with camera

Post by af0815 »

THX, i have tested, it works (basically).

*) The picture is flipped by 180 deg.
Mabe a wrong calculation in procedure TRVWebCam.GetFrame();

Code: Select all

          cur_p := Img.bitmap.ScanLine({Img.bitmap.height -} Y {- 1});
works for me.

*) There is a something going wrong in procedure TRVWebCam.SetVideoDeviceIndex(Value: integer);
Because only the first device is adressable. I think it should be

Code: Select all

procedure TRVWebCam.SetVideoDeviceIndex(Value: integer);
begin
  FVideoDeviceIndex := Min(Value, VideoDeviceCount - 1);
  SetVideoDevice(FVideoDeviceIndex);
end;
the 'Value' was ignored.

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

Re: Debian x64 Lazarus and RVMedia 7.x not working with camera

Post by Sergey Tkachenko »

You fixes are correct, thank you!
Post Reply