Page 1 of 1
					
				Debian x64 Lazarus and RVMedia 7.x not working with camera
				Posted: Tue Dec 10, 2019 9:08 am
				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.
			 
			
					
				Re: Debian x64 Lazarus and RVMedia 7.x not working with camera
				Posted: Thu Dec 12, 2019 9:00 pm
				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)
 
			 
			
					
				Re: Debian x64 Lazarus and RVMedia 7.x not working with camera
				Posted: Fri Dec 13, 2019 12:22 pm
				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.
			 
			
					
				Re: Debian x64 Lazarus and RVMedia 7.x not working with camera
				Posted: Thu Dec 19, 2019 7:44 am
				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.
			 
			
					
				Re: Debian x64 Lazarus and RVMedia 7.x not working with camera
				Posted: Fri Dec 20, 2019 7:34 pm
				by Sergey Tkachenko
				We fixed this problem in our working version.
Should I send fixed pas-files to you by email?
			 
			
					
				Re: Debian x64 Lazarus and RVMedia 7.x not working with camera
				Posted: Sun Dec 22, 2019 7:40 am
				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.  
 
THX
 
			 
			
					
				Re: Debian x64 Lazarus and RVMedia 7.x not working with camera
				Posted: Sun Dec 22, 2019 2:38 pm
				by Sergey Tkachenko
				Sent
			 
			
					
				Re: Debian x64 Lazarus and RVMedia 7.x not working with camera
				Posted: Sun Dec 22, 2019 8:39 pm
				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
 
			 
			
					
				Re: Debian x64 Lazarus and RVMedia 7.x not working with camera
				Posted: Mon Dec 23, 2019 5:35 pm
				by Sergey Tkachenko
				You fixes are correct, thank you!