[gst-devel] Audio over udp

Michael Smith msmith at fluendo.com
Fri Apr 21 01:56:05 CEST 2006


On Thu, 2006-04-20 at 15:52 -0700, M M wrote:
> Hi,
> I am quite new to gstreamer, and I have been struggling to transmit
> video and audio over udp, with this pipeline
> 
> Sender-----
> gst-launch filesrc location=MovieTra1950_3.mpeg ! decodebin name=d  !
> ffmpegcolorspace ! ffenc_mpeg4 ! udpsink  port=4000 -v d. !
> audioconvert ! lame ! udpsink  port=4010 -v
> 
> Reciever----
> gst-launch udpsrc port=4000 caps="video/mpeg" ! ffdec_mpeg4 !
> ffmpegcolorspace ! xvimagesink -v & gst-launch udpsrc port=4010 !
> mad ! audioconvert ! osssink -v
> 
> But no audio is received  only video.

Well, whilst this might be useful for testing, raw UDP isn't a very good
solution in practice. Anyway, you should figure out why the second one
isn't working on its own, without worrying about the video for now. At a
guess: nothing here states that this stream is mpeg audio. You probably
want to put a capsfilter in there: udpsrc ! "audio/mpeg, ... " !
mad ! ... (I'm not sure precisely what caps mp3 have)

> 
> I also tried using rtp, it worked for video with this pipeline

A much better idea. Of course, this is still only really useful for
testing - you want a proper RTP stack in practice, which gst-launch
doesn't provide.

> 
> gst-launch videotestsrc ! video/x-raw-yuv,width=176,height=144 !
> ffenc_mpeg4 ! rtpmp4vpay ! rtpmp4vdepay ! ffdec_mpeg4 ! xvimagesink

Note that here, you're not actually doing ANY network transmission at
all!

> 
> But for Audio with this pipeline
> gst-launch audiotestsrc ! audioconvert  ! audio/x-raw-int, width=16,
> channels=2, rate=48000 ! lame ! rtpmpapay ! rtpmpadepay  ! ffdec_mp3 !
> osssink
> 

Nor here. Two things to fix: use mad, not ffdec_mp3 (does that even
work?), and put an audioconvert after it, before the audio sink. That
might work, if not there's something else that needs fixing, and you
should use GST_DEBUG to find out what it is.

Mike






More information about the gstreamer-devel mailing list