RVCamera

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
Post Reply
opereyrag
Posts: 18
Joined: Wed Mar 25, 2020 2:10 pm

RVCamera

Post 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.

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

Re: RVCamera

Post 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?

opereyrag
Posts: 18
Joined: Wed Mar 25, 2020 2:10 pm

Re: RVCamera

Post 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.

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

Re: RVCamera

Post by Sergey Tkachenko »

Please send me a simple sample project reproducing this problem.

opereyrag
Posts: 18
Joined: Wed Mar 25, 2020 2:10 pm

Re: RVCamera

Post 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.
Attachments
Survillance.zip
(63.67 KiB) Downloaded 92 times

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

Re: RVCamera

Post 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...

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

Re: RVCamera

Post 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.

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

Re: RVCamera

Post 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.

opereyrag
Posts: 18
Joined: Wed Mar 25, 2020 2:10 pm

Re: RVCamera

Post by opereyrag »

We updated with your latest announced RVMedia version and activated RVCamRecorder VideoAutoSize property and worked way better. Thanks.

jimhawkins2
Posts: 10
Joined: Thu Dec 03, 2009 11:58 am
Location: HUll, UK
Contact:

Re: RVCamera

Post 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!

opereyrag
Posts: 18
Joined: Wed Mar 25, 2020 2:10 pm

Re: RVCamera

Post by opereyrag »

Thanks, we created a thread just for time control and synchronization

Post Reply