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: 65
Joined: Tue Oct 22, 2019 6:24 pm

RVCamRecorder hangs on RVCamRecorder.Active := false;

Post 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?
Last edited by ya_vanka on Sat Nov 02, 2019 8:31 pm, edited 1 time in total.
ya_vanka
Posts: 65
Joined: Tue Oct 22, 2019 6:24 pm

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

Post 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;
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

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

Post by Sergey Tkachenko »

Does this problem exist in version 7.0?
ya_vanka
Posts: 65
Joined: Tue Oct 22, 2019 6:24 pm

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

Post 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.
ya_vanka
Posts: 65
Joined: Tue Oct 22, 2019 6:24 pm

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

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

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

Post by Sergey Tkachenko »

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