gpt4 book ai didi

streaming - 使用 gstreamer 合并音频和视频流

转载 作者:行者123 更新时间:2023-12-04 12:55:19 26 4
gpt4 key购买 nike

关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。












想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。

7年前关闭。




Improve this question




我正在使用 gstreamer 通过 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

最佳答案

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

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

关于streaming - 使用 gstreamer 合并音频和视频流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13904975/

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