使用gstreamer通过RTSP进行mp3流播放

时间:2010-09-30 09:13:37

标签: streaming udp mp3 gstreamer rtp

我正在使用gstreamer,主要是播放音乐播放功能。

我目前正在尝试使用RTP通过LAN发送mp3流,但直到现在都没有成功。

在发件人方面,我使用以下管道:

gst-launch -v filesrc location =。/ my_music_file.mp3! ffdemux_mp3! rtpmpapay! udpsink port = 6969 host = 192.168.0.200

在接收方,我使用以下管道:

gst-launch -v udpsrc port = 6969 caps =“application / x-rtp,media =(string)audio,clock-rate =(int)90000,encoding-name =(string)MPA,payload =(int )96,ssrc =(guint)1951256090,clock-base =(guint)1711290778,seqnum-base =(guint)24773“! rtpmpadepay! flump3dec! pulsesink

接收方的输出显然没有错误:

将管道设置为PAUSED ...

管道已上线,不需要PREROLL ......

将管道设置为PLAYING ...

新时钟:GstSystemClock

......但声音听起来很奇怪,就好像它播放得太快了。

我已经通过在本地播放mp3文件测试了音频的工作原理。我还通过流式传输wav /μLaw文件测试了rtp。这一切都运作良好。

我也试过以其他方式面对问题,例如,我使用了以下管道,taht与audiotestsrc / amrnb编解码器配合得很好:

gst-launch gstrtpbin name = rtpbin audiotestsrc! amrnbenc! rtpamrpay! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0! udpsink host = 192.168.0.200 port = 5002 rtpbin.send_rtcp_src_0! udpsink port = 5003 host = 192.168.0.200 sync = false async = false udpsrc port = 5005! rtpbin.recv_rtcp_sink_1

但是当使用相同的管道和lame时,再次在接收器端没有错误但是输出“太快”:

发信人: gst-launch gstrtpbin name = rtpbin audiotestsrc! lamemp3enc! rtpmpapay! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0! udpsink host = 192.168.0.200 port = 5002 rtpbin.send_rtcp_src_0! udpsink port = 5003 host = 192.168.0.200 sync = false async = false udpsrc port = 5005! rtpbin.recv_rtcp_sink_1

接收机: gst-launch -v udpsrc port = 5002 caps =“application / x-rtp,media =(string)audio,clock-rate =(int)90000,encoding-name =(string)MPA,payload =(int)96” ! rtpmpadepay! flump3dec! pulsesink

有人可以知道我的管道出了什么问题吗?

非常感谢您的支持,

豪尔赫

1 个答案:

答案 0 :(得分:1)

对于那些对此主题感兴趣的人,我对问题有部分答案。

在fatc中,它是fluendo解码器,它丢失了来自rtp depay的优秀mp3帧。

当我使用疯狂的解码器时,我可以接收和听到所有的流。

以下是我用来通过RTP进行mp3流媒体的管道:

发信人: gst-launch -v filesrc location =。/ my_file.mp3! ffdemux_mp3! rtpmpapay! udpsink port = 6969 host = 192.168.0.200

接收机: gst-launch -v udpsrc port = 6969 caps =“application / x-rtp,media =(string)audio,clock-rate =(int)90000,encoding-name =(string)MPA,payload =(int)96” ! rtpmpadepay!疯了! pulsesink

问题已发布到fluendo团队。

希望得到这个帮助。

相关问题