Page 1 of 1

RVCamera

Posted: Wed Mar 25, 2020 2:45 pm
by opereyrag
We are trying the FMX DEMO version with Delphi 10.3.2. We wrote 3 version of the application, VCL/FMX version that works fine, a CONSOLE and a SERVICE version, we are having the following problem with the last two; the RVCamera component does not complete the SearchCamera function if we are in the CONSOLE or SERVICE version, independently of using rvsmWait or rvsmNoWait.
We need to save videos in fixed length (Example 8 minutes files), we have an RVCamera and two RVCamRecorder components, we switch from one Recorder to the other to create the videos, when we switch to the second recorder the video sort of stops for at least 10 seconds and then starts recording again.

Re: RVCamera

Posted: Sat Mar 28, 2020 12:26 pm
by Sergey Tkachenko
Sorry for delay, I only yesterday returned from a hospital.

RVMedia uses threads that call Synchronize method from time to time.
This method works correctly only if the main process calls CheckSyncronize regularly. GUI applications do it themselves, when an application is idle.
But if you use the components in console or DLL, it becomes a problem.

There are workarounds.
The simplest is creating TTimer and call CheckSyncronize in it.
Another solution is assigning WakeMainThread, like it is shown here: https://edn.embarcadero.com/article/32756, at the first part of the article. But you need some class to provide a method for assigning to WakeMainThread, and you need some window (maybe hidden one) to send PostMessage. And I think it does not work in console, because in console the main thread always do something and never idle. Not sure about a service.


As for the second question, does the video stop, or does recording stop?

Re: RVCamera

Posted: Mon Mar 30, 2020 12:45 pm
by opereyrag
Thanks for the response, and hoping you get well. I will work with the your suggestions and keep you inform. About the recording problem, is there something I can do. We really like your product and the prototypes we made work beautifully so we would like to complete the project.

Re: RVCamera

Posted: Mon Mar 30, 2020 1:34 pm
by Sergey Tkachenko
Please send me a simple sample project reproducing this problem.

Re: RVCamera

Posted: Mon Mar 30, 2020 8:30 pm
by opereyrag
This project simulates the situation with the Camera and the two recorders. You will press Connect and when the camera is ready press Record and every 1 minute a avi file will be generated, the second one after a couple of second will show some distortions for about 10 seconds.

Re: RVCamera

Posted: Mon Apr 06, 2020 12:59 pm
by Sergey Tkachenko
I cannot reproduce the problem on your project. In my test, there are no omissions between files typically, or it is about 1 second. The maximal omission was about 4 sec.
But I'll try to investigate further...

Re: RVCamera

Posted: Mon Apr 06, 2020 1:12 pm
by Sergey Tkachenko
The maximal omission is between the first and the second video fragments.
It is because of VideoAutoSize property. The recorder starts recording video with VideoWidth x VideoHeight. But when the first frame is received, it restarts recording with the frame size (and updates VideoWidth and VideoHeight properties, so subsequent restarts are faster).

It can be avoided if you set the proper VideoWidth and VideoHeight initially. In this example, they are 320 x 240, you can get them in RVCamera1.OnGetImage, as img.Width and img.Height.

Re: RVCamera

Posted: Mon Apr 06, 2020 1:46 pm
by Sergey Tkachenko
In the next update, I'll add a new event to TRVCamRecorder: OnFirstFrame. It will occur after recording the first video frame. You will be able to stop the previous recorder after this event in the new recorder.

Re: RVCamera

Posted: Mon Apr 06, 2020 9:02 pm
by opereyrag
We updated with your latest announced RVMedia version and activated RVCamRecorder VideoAutoSize property and worked way better. Thanks.

Re: RVCamera

Posted: Sat May 16, 2020 11:11 am
by jimhawkins2
Using TTimer in a Service is very problematic. A service does not have a normal message pump, because it does not have a main form. That issue has tripped me up a few times!

Re: RVCamera

Posted: Tue May 19, 2020 4:41 pm
by opereyrag
Thanks, we created a thread just for time control and synchronization