本文介绍了如何使用gstreamer与tcpserversink流音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要Internet上的实时流音频.在互联网上快速搜索,我决定使用Gstreamer.我已经成功地使用udpsink进行了流传输,但是它只能在LAN上运行.我用tcpserversink进行了测试,但无法正常工作:
I need live-stream audio over Internet. Quick search in internet and I decide using Gstreamer. I has streamed successfully using udpsink, but it only work on LAN. I test with tcpserversink but it not working:
服务器(IP:113.160.166.87)
Server (IP: 113.160.166.87)
gst-launch-1.0 filesrc location="G:/Project/Gstreamer/TestContent/Em-Gai-Mua-Huong-Tram.mp3" ! decodebin ! mulawenc ! tcpserversink port=7001 host=0.0.0.0
客户:
gst-launch-1.0 tcpclientsrc host=113.160.166.87 port=7001 ! "audio/x-mulaw, channels=1, depth=16, width=16, rate=44100" ! mulawdec ! autoaudiosink
有人帮助我!谢谢.
推荐答案
您为什么再次在发件人中编码?您可以尝试以下管道吗?
why are you encoding in the sender again ? can you try the following pipeline,
发件人:
gst-launch-1.0 -v filesrc location="G:/Project/Gstreamer/TestContent/Em-Gai-Mua-Huong-Tram.mp3" ! audioparse ! tcpserversink port=7001 host=0.0.0.0
接收器:
gst-launch-1.0 tcpclientsrc port=7001 host=113.160.166.87 ! decodebin ! autoaudiosink
这篇关于如何使用gstreamer与tcpserversink流音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!