OnEndVideoStream Event to detect a disconnection

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
Post Reply
yonie1990
Posts: 3
Joined: Thu Dec 14, 2023 3:14 am

OnEndVideoStream Event to detect a disconnection

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

Re: OnEndVideoStream Event to detect a disconnection

Post by Sergey Tkachenko »

Do you play video stream using FFmpeg?
Try to assign RVCamera.FFMPEGProperty.TimeOut = timeout in seconds
yonie1990
Posts: 3
Joined: Thu Dec 14, 2023 3:14 am

Re: OnEndVideoStream Event to detect a disconnection

Post by yonie1990 »

i use GStreamer, not play using FFmpeg
Sergey Tkachenko
Site Admin
Posts: 17520
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: OnEndVideoStream Event to detect a disconnection

Post 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?
yonie1990
Posts: 3
Joined: Thu Dec 14, 2023 3:14 am

Re: OnEndVideoStream Event to detect a disconnection

Post by yonie1990 »

i use rstp protocol
Sergey Tkachenko
Site Admin
Posts: 17520
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: OnEndVideoStream Event to detect a disconnection

Post 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"
Post Reply