【问题标题】:GStreamer, merging 4 streams into one and restreamGStreamer,将 4 个流合并为一个并重新流
【发布时间】:2015-03-10 09:40:36
【问题描述】:

我正在尝试一次读取 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。任何建议将不胜感激!

【问题讨论】:

  • 您要创建什么类型的流?
  • 我有通过 rtsp 协议的带有 h264 视频的 IP 摄像机。我需要做的是创建这些视频的马赛克并通过 rtsp 将其作为一个流重新传输到客户端应用程序。你能帮我吗?
  • 您需要先对视频进行编码,可能使用 x264enc 插件。如果您必须使用 RTSP 进行流式传输,则需要调查 gst-rtsp-server。不过,我没有针对 RTSP 的单行代码。
  • 实际上只播放视频我不需要编码,但可能需要重新流式传输。我的问题是,为了使用 rtsp 服务器,我需要将其写成代码并编译 rtsp 服务器,而我现在无法做到这一点。有什么帮助吗?
  • 您必须重新编码,因为您正在创建一个新图像。

标签: windows-7 merge streaming gstreamer rtsp


【解决方案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

【讨论】:

  • 不幸的是,我需要 RTSP 协议。 Aby 的想法,所以我可以把它写成代码,还有什么要在 Windows 机器上编译 RTSP 服务器?最好是视觉工作室上的某种“操作方法”
  • 这超出了我的域,抱歉。我建议查看 gst-rtsp-server。
  • 告诉我,你能帮我把我的oneliner改写成C代码吗?
  • 这可以在 Windows 机器上工作吗?我在 Windows 7 机器上试过。不幸的是对我不起作用:(
猜你喜欢
  • 2019-04-16
  • 2020-03-20
  • 1970-01-01
  • 2019-12-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-18
  • 2017-01-15
相关资源
最近更新 更多