Gstreamer videomixer-当一个来源失败时继续运行

时间:2018-10-12 16:34:29

标签: gstreamer gst-launch-1.0

我有一个管道,该管道使用videomixer在两行(到目前为止)中显示10个rtp / h264视频流,这些流大多数都按预期工作。

问题是,如果其中一个流当前未运行,或者更糟的是消失了(文件更改,网络问题等),那么混音器崩溃并且管道停滞,或者根本没有预滚动。 / p>

我使用的启动命令:

    /usr/local/bin/gst-launch-1.0 -vv -e videomixer name=mix background=2 \
    sink_0::alpha=1.0 \
    sink_0::ypos=0 \
    sink_0::xpos=0 \
    sink_1::alpha=1.0 \
    sink_1::ypos=80 \
    sink_1::xpos=40 \
    sink_2::alpha=1.0 \
    sink_2::ypos=80 \
    sink_2::xpos=410 \
    sink_3::alpha=1.0 \
    sink_3::ypos=80 \
    sink_3::xpos=780 \
    sink_4::alpha=1.0 \
    sink_4::ypos=80 \
    sink_4::xpos=1140 \
    sink_5::alpha=1.0 \
    sink_5::ypos=80 \
    sink_5::xpos=1550 \
    sink_6::alpha=1.0 \
    sink_6::ypos=500 \
    sink_6::xpos=40 \
    sink_7::alpha=1.0 \
    sink_7::ypos=500 \
    sink_7::xpos=410 \
    sink_8::alpha=1.0 \
    sink_8::ypos=500 \
    sink_8::xpos=780 \
    sink_9::alpha=1.0 \
    sink_9::ypos=500 \
    sink_9::xpos=1140 \
    sink_10::alpha=1.0 \
    sink_10::ypos=500 \
    sink_10::xpos=1550 \
    sink_11::alpha=0.4 \
    sink_11::ypos=935 \
    sink_11::xpos=1440 \
    sink_0::zorder=1 \
    sink_1::zorder=3 \
    sink_2::zorder=3 \
    sink_3::zorder=4 \
    sink_4::zorder=5 \
    sink_5::zorder=6 \
    sink_6::zorder=7 \
    sink_7::zorder=8 \
    sink_8::zorder=9 \
    sink_9::zorder=10 \
    sink_10::zorder=11 \
    sink_11::zorder=12 \
    ! clockoverlay auto-resize=false draw-shadow=false draw-outline=false halignment=left valignment=top \
    ! timeoverlay auto-resize=false draw-shadow=false draw-outline=false halignment=left valignment=bottom \
    ! queue \
        ! nvh264enc preset=1 bitrate=1500 rc-mode=2 gop-size=10 \
        ! h264parse config-interval=-1 \
        ! mpegtsmux ! rtpmp2tpay pt=33 \
        ! udpsink host=239.255.42.61 port=5004 multicast-iface=10g-1 ttl=4 ttl-mc=4 \
    multifilesrc location=/IMG/logo.jpg caps="image/jpeg,framerate=1/1" \
        ! jpegdec ! videoconvert ! videoscale \
            ! video/x-raw,width=1920,height=1080 \
        ! mix.sink_0 \
    udpsrc multicast-group=239.255.42.60 address=239.255.42.60 port=5004 multicast-iface=eth0 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33" \
            ! rtpjitterbuffer ! rtpmp2tdepay ! tsdemux ! h264parse config-interval=-1 \
        ! avdec_h264 skip-frame=1 output-corrupt=false ! videoconvert ! videoscale \
        ! video/x-raw,width=360,height=240 \
            ! mix.sink_1 \
    udpsrc multicast-group=239.255.42.57 address=239.255.42.57 port=5004 multicast-iface=eth0 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33" \
            ! rtpjitterbuffer ! rtpmp2tdepay ! tsdemux ! h264parse config-interval=-1 \
        ! avdec_h264 skip-frame=1 output-corrupt=false ! videoconvert ! videoscale \
        ! video/x-raw,width=360,height=240 \
        ! mix.sink_2 \
    udpsrc multicast-group=239.255.42.62 address=239.255.42.62 port=5004 multicast-iface=eth0 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33" \
            ! rtpjitterbuffer ! rtpmp2tdepay ! tsdemux ! h264parse config-interval=-1 \
        ! avdec_h264 skip-frame=1 output-corrupt=false ! videoconvert ! videoscale \
        ! video/x-raw,width=360,height=240 \
        ! mix.sink_3 \
    udpsrc multicast-group=239.255.42.46 address=239.255.42.46 port=5004 multicast-iface=eth0 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33" \
            ! rtpjitterbuffer ! rtpmp2tdepay ! tsdemux ! h264parse config-interval=-1 \
            ! avdec_h264 skip-frame=1 output-corrupt=false ! videoconvert ! videoscale \
            ! video/x-raw,width=360,height=240 \
            ! mix.sink_4 \
   udpsrc multicast-group=239.255.42.59 address=239.255.42.59 port=5004 multicast-iface=eth0 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33" \
            ! rtpjitterbuffer ! rtpmp2tdepay ! tsdemux ! h264parse config-interval=-1 \
            ! avdec_h264 skip-frame=1 output-corrupt=false ! videoconvert ! videoscale \
            ! video/x-raw,width=360,height=240 \
            ! mix.sink_5 \
    udpsrc multicast-group=239.255.42.56 address=239.255.42.56 port=5004 multicast-iface=eth0 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33" \
            ! rtpjitterbuffer ! rtpmp2tdepay ! tsdemux ! h264parse config-interval=-1 \
        ! avdec_h264 skip-frame=1 output-corrupt=false ! videoconvert ! videoscale \
        ! video/x-raw,width=360,height=240 \
            ! mix.sink_6 \
    udpsrc multicast-group=239.255.42.57 address=239.255.42.57 port=5004 multicast-iface=eth0 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33" \
            ! rtpjitterbuffer ! rtpmp2tdepay ! tsdemux ! h264parse config-interval=-1 \
        ! avdec_h264 skip-frame=1 output-corrupt=false ! videoconvert ! videoscale \
        ! video/x-raw,width=360,height=240 \
        ! mix.sink_7 \
    udpsrc multicast-group=239.255.42.62 address=239.255.42.62 port=5004 multicast-iface=eth0 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33" \
            ! rtpjitterbuffer ! rtpmp2tdepay ! tsdemux ! h264parse config-interval=-1 \
        ! avdec_h264 skip-frame=1 output-corrupt=false ! videoconvert ! videoscale \
        ! video/x-raw,width=360,height=240 \
        ! mix.sink_8 \
    udpsrc multicast-group=239.255.42.46 address=239.255.42.46 port=5004 multicast-iface=eth0 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33" \
            ! rtpjitterbuffer ! rtpmp2tdepay ! tsdemux ! h264parse config-interval=-1 \
            ! avdec_h264 skip-frame=1 output-corrupt=false ! videoconvert ! videoscale \
            ! video/x-raw,width=360,height=240 \
            ! mix.sink_9 \
   udpsrc multicast-group=239.255.42.59 address=239.255.42.59 port=5004 multicast-iface=eth0 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33" \
            ! rtpjitterbuffer ! rtpmp2tdepay ! tsdemux ! h264parse config-interval=-1 \
            ! avdec_h264 skip-frame=1 output-corrupt=false ! videoconvert ! videoscale \
            ! video/x-raw,width=360,height=240 \
            ! mix.sink_10 \
    videotestsrc pattern="snow" \
            ! video/x-raw, framerate=1/1, width=464, height=120 \
            ! mix.sink_11 \

我的问题是,当流不可用时,是否可以让udpsrc或videomixer忽略,以便它继续显示并混合其余部分?

此刻,我有点困惑,我尝试了几种不同的方法来实现剪辑画面来监视我们的流(包括pygtk libvlc脚本也可以工作,但还有其他问题)。使用gstreamer进行的这种视频混合和转播很棒,因为a)这是我们在室内处理其他大多数流的方式,b)我可以轻松地在接收器上查看整个剪辑画面。

我一直在尝试使用c中的gstreamer api。到目前为止,我已经设法使用gst_parse_launch()命令获得了相同的蒙太奇,但这并不是创建元素,将它们添加到bin并进行链接的完整方法(到目前为止,我是新概念C代码去)。 gst_parse_launch()版本具有在任何源出现故障时停止的相同问题。

我已经尝试过在开发人员的IRC网络上提问,但我似乎从未得到他们的关注:(

有什么想法吗?

0 个答案:

没有答案