How to stream audio in network using RTP

Stefano D'Aronco jagger88 at hotmail.it
Sat Jul 16 00:20:00 PDT 2011


Hi,


you hear a sound because you are using audiotestsrc, this elements generates a sin wave, and with the property freq you can vary the frequency of the signal.

If you want to use the microphone substitute the AELEM with "autoaudiosrc" or "alsasrc" or "pulsesrc"...
I hope it works.


cheers
Stefano



Date: Fri, 15 Jul 2011 22:06:07 -0700
Subject: How to stream audio in network using RTP
From: reachtoarpi at gmail.com
To: gstreamer-devel at lists.freedesktop.org

How to stream the audio which will be recorded from microphone and will be encoded in AAC codec format and will be send using RTP packetization? 


I have used this code for server: 
-------------------------------------- 
#!/bin/sh 
# 
# A simple RTP server 

# change this to send the RTP data and RTCP to another host 
DEST=127.0.0.1 


AELEM=audiotestsrc 

#AAC encode from the source 
ASOURCE="$AELEM ! audioconvert" 
AENC="faac ! rtpmp4gpay " 


gst-launch -v gstrtpbin name=rtpbin \ 
$ASOURCE ! $AENC ! rtpbin.send_rtp_sink_0  \ 

rtpbin.send_rtp_src_0 ! udpsink port=5002 host=$DEST     \ 
rtpbin.send_rtcp_src_0 ! udpsink port=5003 host=$DEST sync=false async=false \ 
udpsrc port=5007 ! rtpbin.recv_rtcp_sink_0 
--------------------- 


Client code : 

#!/bin/sh 
# 
# A simple RTP receiver 

AUDIO_CAPS="application/x-rtp,media=(string)audio,clock-rate=(int)44100,encoding-name=(string)MPEG4-GENERIC,encoding-params=(string)1,streamtype=(string)5,profile-level-id=(string)2,mode=(string)AAC-hbr,config=(string)1208,sizelength=(string)13,indexlength=(string)3,indexdeltalength=(string)3,ssrc=(uint)853015980,payload=(int)96,clock-base=(uint)2040203639,seqnum-base=(uint)52067" 

#AUDIO_CAPS="application/x-rtp, media=(string)audio, clock-rate=(int)44100, encoding-name=(string)MPEG4-GENERIC, encoding-params=(string)1, streamtype=(string)5, profile-level-id=(string)2, mode=(string)AAC-hbr, config=(string)1208, sizelength=(string)13, indexlength=(string)3, indexdeltalength=(string)3, ssrc=(uint)853015980, payload=(int)96, clock-base=(uint)2040203639, seqnum-base=(uint)52067" 


AUDIO_DEC="rtpmp4gdepay ! faad" 

AUDIO_SINK="alsasink" 

# the destination machine to send RTCP to. This is the address of the sender and 
# is used to send back the RTCP reports of this receiver. If the data is sent 

# from another machine, change this address. 
DEST=127.0.0.1 
                            
gst-launch -v gstrtpbin name=rtpbin                            \ 
udpsrc caps=$AUDIO_CAPS port=5002 ! rtpbin.recv_rtp_sink_0              \ 

rtpbin. ! $AUDIO_DEC ! $AUDIO_SINK                                \ 
udpsrc port=5003 ! rtpbin.recv_rtcp_sink_0                              \ 
rtpbin.send_rtcp_src_0 ! udpsink port=5007 host=$DEST sync=false async=false 


I am not getting any error, but what I am talking in my Microphone is not streaming.I can hear only beep sound. Please reply. 
Thanks in advance.

_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110716/f6737471/attachment.html>


More information about the gstreamer-devel mailing list