RVCamRecorder hangs on RVCamRecorder.Active := false;

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
Post Reply
ya_vanka
Posts: 16
Joined: Tue Oct 22, 2019 6:24 pm

RVCamRecorder hangs on RVCamRecorder.Active := false;

Post by ya_vanka » Sat Nov 02, 2019 1:57 pm

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?
Last edited by ya_vanka on Sat Nov 02, 2019 8:31 pm, edited 1 time in total.

ya_vanka
Posts: 16
Joined: Tue Oct 22, 2019 6:24 pm

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

Post by ya_vanka » Sat Nov 02, 2019 2:04 pm

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;

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

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

Post by Sergey Tkachenko » Sat Nov 02, 2019 3:19 pm

Does this problem exist in version 7.0?

ya_vanka
Posts: 16
Joined: Tue Oct 22, 2019 6:24 pm

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

Post by ya_vanka » Sat Nov 02, 2019 8:29 pm

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.

ya_vanka
Posts: 16
Joined: Tue Oct 22, 2019 6:24 pm

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

Post by ya_vanka » Tue Nov 05, 2019 10:36 am

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?

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

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

Post by Sergey Tkachenko » Tue Nov 05, 2019 11:56 am

Well, if it makes things faster, it's ok.

Post Reply