GStreamer,将4个流合并为一个并重新调整

时间:2015-03-10 09:40:37

标签: windows-7 merge streaming gstreamer rtsp

我试图一次读取4个ip摄像头,然后将它们合并为一个马赛克视频并将其重新发送给客户端。到目前为止,我设法接收了4个流并显示马赛克,但无法确定下一步该做什么。

gst-launch-1.0 -e \
videomixer name=mix \
        sink_0::xpos=0   sink_0::ypos=0  sink_0::alpha=0\
        sink_1::xpos=0   sink_1::ypos=0 \
        sink_2::xpos=640 sink_2::ypos=0 \
        sink_3::xpos=0   sink_3::ypos=360 \
        sink_4::xpos=640 sink_4::ypos=360 \
    ! autovideosink \
videotestsrc pattern="black" \
    ! video/x-raw,format=AYUV,width=1280,height=720 \
    ! mix.sink_0 \
uridecodebin uri=rtsp://10.0.0.121:554/video.h264 \
    ! videoconvert ! videoscale \
    ! video/x-raw,format=AYUV,width=640,height=360 \
    ! mix.sink_1 \
uridecodebin uri=rtsp://10.0.0.122:554/video.h264 \
    ! videoconvert ! videoscale \
    ! video/x-raw,format=AYUV,width=640,height=360 \
    ! mix.sink_2 \
uridecodebin uri=rtsp://10.0.0.123:554/video.h264 \
    ! videoconvert ! videoscale \
    ! video/x-raw,format=AYUV,width=640,height=360 \
    ! mix.sink_3 \
uridecodebin uri=rtsp://10.0.0.124:554/video.h264 \
    ! videoconvert ! videoscale \
    ! video/x-raw,format=AYUV,width=640,height=360 \
    ! mix.sink_4 \

我在Win7上使用最新的Gstreamer。任何建议将不胜感激!

1 个答案:

答案 0 :(得分:-1)

如果你愿意使用RTP而不是RTSP,你可以使用这样的东西。

发信人:

gst-launch-1.0 -e \
videomixer name=mix \
 sink_0::xpos=0   sink_0::ypos=0 \
 sink_1::xpos=640   sink_1::ypos=0 \
 ! queue ! videoconvert ! x264enc ! h264parse ! rtph264pay ! udpsink host=localhost port=5200 \
videotestsrc \
 ! video/x-raw,format=AYUV,width=640,height=360 \
 ! mix.sink_0 \
videotestsrc pattern="ball" \
 ! videoconvert ! videoscale \
 ! video/x-raw,format=AYUV,width=640,height=360 \
 ! mix.sink_1 \

接收器:

gst-launch-1.0 udpsrc port=5200 ! \
application/x-rtp,media=video,payload=96,encoding-name=H264 ! \
rtph264depay ! h264parse ! avdec_h264 ! \
videoconvert ! ximagesink