gpt4 book ai didi

Gstreamer 管道将 2 个 udp 源合并到 rtmp?

转载 作者:行者123 更新时间:2023-12-02 01:26:40 26 4
gpt4 key购买 nike

我不知道如何合并 2 个 udp 源(1 个用于音频,1 个用于视频),单独来说这很简单,但作为菜鸟不知道如何合并它们,我知道我已经很接近了

gst-launch-1.0 rtpbin name=rtpbin rtpbin.recv_rtp_sink_ \
! udpsrc port=6004 caps="application/x-rtp, media=(string)video,clock-rate=(int)90000,payload=(int)96,encoding-name=VP8-DRAFT-IETF-01" \
! rtpvp8depay \
! queue \
! mux. rtpbin.recv_rtp_sink_ \
! udpsrc port=6005 caps="application/x-rtp, media=audio, clock-rate=48000, encoding-name=X-GST-OPUS-DRAFT-SPITTKA-00, payload=111,channels=2" \
! rtpopusdepay \
! queue \

...?

最佳答案

我不知道确切的答案,但我会这样做(我们可以通过评论协商一些解决方案 :)):

gst-launch-1.0 flvmux name=mux ! rtmpsink udpsrc port=6004 caps="application/x-rtp, media=(string)video,clock-rate=(int)90000,payload=(int)96,encoding-name=VP8-DRAFT-IETF-01" ! rtpvp8depay ! vp8dec ! queue ! x264enc ! mux.  udpsrc port=6005 caps="application/x-rtp, media=audio, clock-rate=48000, encoding-name=X-GST-OPUS-DRAFT-SPITTKA-00, payload=111,channels=2" ! rtpopusdepay ! queue ! opusdec ! voaacenc ! aacparse ! queue ! mux.

为什么这个管道:

  • there are three parts of pipeline which are later linked together,

1, first is flvmux linked to rtmpsink, notice there is no ! signbetween this part and next udpsrc part

2, udpsrc video part whichneeds to be first decoded from vp8 and then reencoded to h264 asflvmux does understand only h264 (I guess no support for vp8, you cancheck this)

3, udpsrc audio part which is decoded from opus resultingin raw pcm audio and then encoded in aac as flvmux does not seem to understand raw audio

  • after mux this can go to rtpmsink which will stream it to given location (I am not very familiar with this format)

请记住,元素出现的顺序只是创建的顺序,而不是链接的顺序。但是我认为如果要链接它们,元素必须首先存在,因此我将 flvmux 放在开始能够使用多路复用器。稍后命名(类似于别名)。我创建了管道的这 3 个部分,然后将它们与 mux 的使用联系起来。别名..

关于Gstreamer 管道将 2 个 udp 源合并到 rtmp?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36783817/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com