I try to create a little rtp server with gstreamer in C or in ruby.
Where can I find a translation of this line "gst-launch-0.10 -v gstrtpbin name=rtpbin \
filesrc location="/data/file.mp3" ! mad ! audioconvert ! rtpL16pay !
rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink port=5000 "
in C or in ruby.
pipeline")
filesrc=Gst::ElementFactory.make("filesrc","filesrc")
filesrc.location=FILE_ONE
mad=Gst::ElementFactory.make("mad")
audioconvert=Gst::ElementFactory.make("audioconvert")
pay=Gst::ElementFactory.make("rtpL16pay")
@rtpbin=Gst::ElementFactory.make('gstrtpbin','rtpbin')
puts @rtpbin.public_methods.inspect
udpsink=Gst::ElementFactory.make('udpsink')
pipeline.add( filesrc, mad, audioconvert, pay, @rtpbin, udpsink)
@rtpbin.signal_connect("pad-added") do | source, pad |
puts "in pad-added #{
pad.name}"
if pad.name.include?('send_rtp_src')
pad.link(udpsink.get_pad('sink'))
end
end
filesrc >> mad >> audioconvert >> pay #Link the pads
# send_rtp_sink=@rtpbin.get_request_pad('send_rtp_sink_%d')
send_rtp_sink=@rtpbin.get_request_pad('send_rtp_sink_0')
pay.get_pad('src').link(send_rtp_sink)
return pipeline
end
the pipeline work but it don't send music
Thanks a lot
Guillaume