Page 1 of 1

OnEndVideoStream Event to detect a disconnection

Posted: Thu Dec 14, 2023 3:39 am
by yonie1990
I use the OnEndVideoStream Event to detect a disconnection. but the OnEndVideoStream event will respond by providing feedback within 1 minute, when the network is disconnected.
how to set the duration of time / feedback so that it is faster.

Re: OnEndVideoStream Event to detect a disconnection

Posted: Fri Dec 15, 2023 12:39 pm
by Sergey Tkachenko
Do you play video stream using FFmpeg?
Try to assign RVCamera.FFMPEGProperty.TimeOut = timeout in seconds

Re: OnEndVideoStream Event to detect a disconnection

Posted: Tue Dec 19, 2023 9:33 am
by yonie1990
i use GStreamer, not play using FFmpeg

Re: OnEndVideoStream Event to detect a disconnection

Posted: Sat Dec 23, 2023 12:31 pm
by Sergey Tkachenko
RVMedia does not set timeout properties for GStreamer video sources, so default timeouts are used.

I can suggest changes in RVMedia source code to set timeout. But these changes are different for different protocols (HTTP(S) / RTSP / UDP)
What video protocol do you use?

Re: OnEndVideoStream Event to detect a disconnection

Posted: Thu Jan 04, 2024 1:44 am
by yonie1990
i use rstp protocol

Re: OnEndVideoStream Event to detect a disconnection

Posted: Wed Jan 10, 2024 11:49 am
by Sergey Tkachenko
For rtsp, RVMedia uses 'rtspsrc' GStreamer object.
For new version of GStreamer, a launch string for rtspsrc is constructed in the function GetRTSPSourceStr_1_0 (MRVGSTObject unit for VCL and LCL, or fmxMRVGSTObject unit for FireMonkey)

A list of rtspsrc properties can be found here:
https://gstreamer.freedesktop.org/docum ... properties

From these properties, I can see the following:

tcp-timeout
Fail after timeout microseconds on TCP connections (0 = disabled)
Default value : 20000000
As I can see from description, this timeout value is used only when RTSP is based on TCP (it may also be based on UDP). The default value is 20 sec.

timeout

Code: Select all

Retry TCP transport after UDP timeout microseconds (0 = disabled)
Default value : 5000000
As I understand, this timeout is used for RTSP on UDP, the default value is 5 sec.

You can play with these properties by adding their value to the end of GetRTSPSourceStr_1_0, for example:

Code: Select all

AddParam(Result, 'tcp-timeout=10000000');
If you use Delphi and Windows 32-bit platform, you can simply rebuild your project after making changes in RVMedia source code.
However, in the following cases you need to rebuild RVMedia packages:
- you use Windows 64-bit or Linux platform
- you use C++Builder
- your project uses runtime packages
- when installing, you set the option of adding a path to precompiled units instead of a path to a source code.

You can rebuild packages using Windows Start menu shortcut "Install RVMedia * in Delphi IDE"