Page 1 of 1

RVCamRecorder hangs on RVCamRecorder.Active := false;

Posted: Sat Nov 02, 2019 1:57 pm
by ya_vanka
I have a problem with RVCamRecorder (version 6.1).

I connect to an rtsp stream via following lines:

RVCamera.DeviceType := rvdtRTSP;
RVCamera.URL := 'rtsp://127.0.0.1:8554/stream.sdp';

and then start recording:

RVCamRecorder.OutputFileName := 'out1.avi'';
RVCamRecorder.Active := true;


Then I disconnect via:

if (RVCamRecorder.Active) then RVCamRecorder.Active := false;
if (RVCamera.IsVideoPlaying) then RVCamera.Abort;


If rtsp stream exists ('rtsp://127.0.0.1:8554/stream.sdp) then everything works. But If there is no rtsp stream and connection is not established then applications hangs on the line RVCamRecorder.Active := false;

I've traced the problem and it hangs in TRVMFFMPEG.VideoEncodeDeinit; at line glCriticalSection.SafeEnter;
And then
while not TryEnter_ do
RVMWait(RV_AbortWaitTime);


So, why does it hang and what can I do to avoid it?

Re: RVCamRecorder hangs on RVCamRecorder.Active := false;

Posted: Sat Nov 02, 2019 2:04 pm
by ya_vanka
The similar problem exists in demo project VideoRecorder.

If I try to connect to non existing stream and then press Start recording button it hangs as well in TRVMFFMPEG.VideoEncodeFile at the same line glCriticalSection.SafeEnter;

Re: RVCamRecorder hangs on RVCamRecorder.Active := false;

Posted: Sat Nov 02, 2019 3:19 pm
by Sergey Tkachenko
Does this problem exist in version 7.0?

Re: RVCamRecorder hangs on RVCamRecorder.Active := false;

Posted: Sat Nov 02, 2019 8:29 pm
by ya_vanka
Partially.

The application hangs for 15-20 seconds if I press Start recording button while it tries to connect.
Once it shows an error "Video stream error" the applications starts to respond.

Re: RVCamRecorder hangs on RVCamRecorder.Active := false;

Posted: Tue Nov 05, 2019 10:36 am
by ya_vanka
I moved line RVCamRecorder.Active := true;

inside RVCamera1GetImage(Sender: TObject; img: TRVMBitmap); event handler.


It looks like that it solved a problem.

Is this a correct work-around?

Re: RVCamRecorder hangs on RVCamRecorder.Active := false;

Posted: Tue Nov 05, 2019 11:56 am
by Sergey Tkachenko
Well, if it makes things faster, it's ok.