【问题标题】:Combining an audio and video stream using gstreamer [closed]使用 gstreamer 组合音频和视频流 [关闭]
【发布时间】:2015-11-19 20:49:54
【问题描述】:

我正在使用 gstreamer over RTP 流将 mp4(mpeg-4) 文件从一台设备流式传输到另一台设备。基本上,我将 mp4 文件拆分为其音频和视频文件,然后将其全部发送到流式传输的其他设备。现在,我想将mp4文件保存到另一台设备的磁盘,但我的问题是我可以将音频和视频文件分开保存,不能单独播放。

我对如何将音频和视频 rtp 流组合成我的 mp4 文件并将其保存到其他设备中的文件感到困惑。

下面是命令行代码:

发件人(服务器)

gst-launch-0.10 -v filesrc location=/home/kuber/Desktop/sample.mp4 \
             ! qtdemux name=d \
             ! queue \
             ! rtpmp4vpay \
             ! udpsink port=5000 \
             d. \
             ! queue \
             ! rtpmp4gpay \
             ! udpsink port=5002

接收者(客户端)

gst-launch-0.10 udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)243, config=(string)000001b0f3000001b50ee040c0cf0000010000000120008440fa282fa0f0a21f, payload=(int)96, ssrc=(uint)4291479415, clock-base=(uint)4002140493, seqnum-base=(uint)57180" \
             ! rtpmp4vdepay \
             ! ffdec_mpeg4 \
             ! xvimagesink sync=false \
             udpsrc port=5002 caps="application/x-rtp, media=(string)audio, clock-rate=(int)32000, encoding-name=(string)MPEG4-GENERIC, encoding-params=(string)2, streamtype=(string)5, profile-level-id=(string)2, mode=(string)AAC-hbr, config=(string)1290, sizelength=(string)13, indexlength=(string)3, indexdeltalength=(string)3, payload=(int)96, ssrc=(uint)501975200, clock-base=(uint)4248495069, seqnum-base=(uint)37039"\
             ! rtpmp4gdepay \
             ! faad \
             ! alsasink sync=false

【问题讨论】:

  • 我想到的一个解决方案是删除接收方和发送方中的编码器,即:rtpmp4gpay 和 rtpmp4gdepay 和 faad。这将导致音频和视频文件的流式传输而不是编码流,然后在接收器中使用 qtmux 来合并音频和视频流,但是我收到关于 qtmux 与 udpsrc 不兼容的错误。我究竟应该在哪里进行更改?
  • gst-launch-0.10 udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V -ES, profile-level-id=(string)243, config=(string)000001b0f3000001b50ee040c0cf0000010000000120008440fa282fa0f0a21f, payload=(int)96, ssrc=(uint)4291479415, clock-base=(uint)400211eq40 )57180" ! rtpmp4vdepay !队列 ! qtmux name=muxer udpsrc port=5002 caps = "application/x-rtp, media=(string)audio, clock-rate=(int)32000, encoding-name=(string)MPEG4-GENERIC, encoding-params=(string )2,
  • streamtype=(string)5, profile-level-id=(string)2, mode=(string)AAC-hbr, config=(string)1290, sizelength=(string)13, indexlength =(字符串)3,indexdeltalength=(字符串)3,有效载荷=(int)96,ssrc=(uint)501975200,时钟基数=(uint)4248495069,seqnum-base=(uint)37039“!rtpmp4gdepay!队列! muxer.muxer.!queue !filesink location=/home/Desktop/finaldemo.mp4
  • 所以我使用上面的但它现在显示内部数据流错误。 ?

标签: streaming video-streaming gstreamer rtp audio-video-sync


【解决方案1】:

您可以尝试以下管道将音频和视频混合到一个文件中。 管道如下:

gst-launch-0.10 udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)243, config=(string)000001b0f3000001b50ee040c0cf0000010000000120008440fa282fa0f0a21f, payload=(int)96, ssrc=(uint)4291479415, clock-base=(uint)4002140493, seqnum-base=(uint)57180" \
             ! rtpmp4vdepay \
             ! ffdec_mpeg4 \
             ! mux. \
         udpsrc port=5002 caps="application/x-rtp, media=(string)audio, clock-rate=(int)32000, encoding-name=(string)MPEG4-GENERIC, encoding-params=(string)2, streamtype=(string)5, profile-level-id=(string)2, mode=(string)AAC-hbr, config=(string)1290, sizelength=(string)13, indexlength=(string)3, indexdeltalength=(string)3, payload=(int)96, ssrc=(uint)501975200, clock-base=(uint)4248495069, seqnum-base=(uint)37039"\
             ! rtpmp4gdepay \
             ! faad \
             ! mux. 
         matroskamux name=mux 
             ! filesink location=video.mp4 

【讨论】:

  • 我无法从这个 syntex 构建管道
猜你喜欢
  • 1970-01-01
  • 2012-11-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多