简体   繁体   English

"在 Gstreamer 管道中重新连接 RTSP 流"

[英]Reconnect RTSP stream in Gstreamer pipeline

I have a working Gstreamer pipeline using RTSP input streams.我有一个使用 RTSP 输入流的工作 Gstreamer 管道。 To handle these given RTSP input streams, the uridecobin element is used.为了处理这些给定的 RTSP 输入流,使用了 uridecobin 元素。

My goal is to reconnect to the RTSP input streams when internet connection is unstable.我的目标是在互联网连接不稳定时重新连接到 RTSP 输入流。 When the internet connection is down for only few seconds and then it is up, then the pipeline starts to receive the frames again and everything is ok.当互联网连接仅关闭几秒钟然后又启动时,管道再次开始接收帧,一切正常。 When the internet connection is down for >20 seconds I get GST_MESSAGE_EOS.当互联网连接中断 > 20 秒时,我会收到 GST_MESSAGE_EOS。 I tried to find some timeout<\/strong> variable in every element generated by uridecodebin, but I did not find it.我试图在 uridecodebin 生成的每个元素中找到一些超时<\/strong>变量,但我没有找到。 Do you have any hint which element has this timeout<\/strong> variable and how to set it?您是否有任何提示哪个元素具有此超时<\/strong>变量以及如何设置它?

If it is not possible to set such timeout<\/strong> variable, is there any way to block GST_MESSAGE_EOS?如果无法设置这样的超时<\/strong>变量,有没有办法阻止 GST_MESSAGE_EOS? Because when I receive GST_MESSAGE_EOS in bus, I try to remove uridecodebin from the pipeline and create a new one.因为当我在总线上收到 GST_MESSAGE_EOS 时,我尝试从管道中删除 uridecodebin 并创建一个新的。 But it does not work for me when GST_MESSAGE_EOS is received (When I try to remove uridecodebin from the pipeline and create a new one during normal state, it works).但是当收到 GST_MESSAGE_EOS 时它对我不起作用(当我尝试从管道中删除 uridecodebin 并在正常状态下创建一个新的时,它可以工作)。

"

I found the way how to block GST_MESSAGE_EOS.我找到了阻止 GST_MESSAGE_EOS 的方法。

Create the following function to drop GST_EVENT_EOS:创建以下函数以删除 GST_EVENT_EOS:

GstPadProbeReturn eos_probe_cb(GstPad *pad, GstPadProbeInfo *info, gpointer u_data)
{
    if (GST_EVENT_TYPE(GST_PAD_PROBE_INFO_DATA(info)) == GST_EVENT_EOS)
    {
        return GST_PAD_PROBE_DROP;
    }
    return GST_PAD_PROBE_OK;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM