Search code examples
gstreameraudio-streamingtcpserver

how to stream audio with tcpserversink using gstreamer


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:

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

Client:

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

Someone help me! Thanks you.


Solution

  • why are you encoding in the sender again ? can you try the following pipeline,

    Sender:

    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
    

    Receiver:

    gst-launch-1.0 tcpclientsrc port=7001 host=113.160.166.87 ! decodebin ! autoaudiosink