Sending audio video through a network using rtpbin in java.

271 views
Skip to first unread message

Raphael

unread,
Apr 7, 2012, 7:57:40 PM4/7/12
to gstreamer-java
So I've got a pipeline working and I can get the pipelines to work
through the terminal. However, when i try to run it through java the
client code does not work.

my pipelines are as follows.
Server code:
gst-launch -v gstrtpbin name=rtpbin \
videotestsrc ! video/x-raw-yuv,width=640,height=480,framerate=20/1 !
ffenc_mpeg4 ! rtpmp4vpay ! rtpbin.send_rtp_sink_0 \
rtpbin.send_rtp_src_0 ! udpsink host=127.0.0.1 port=5000 \
audiotestsrc ! audio/x-raw-int,rate=8000 ! speexenc ! rtpspeexpay !
rtpbin.send_rtp_sink_1 \
rtpbin.send_rtp_src_1 ! udpsink host=127.0.0.1 port=5002

Client code:
gst-launch -v gstrtpbin name=rtpbin \
udpsrc caps='application/x-rtp, media=(string)video, clock-
rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-
id=(string)1,
config=(string)000001b001000001b58913000001000000012000c48d8800a514043c1463000001b24c61766335322e37322e32,
ssrc=(uint)1688346679, payload=(int)96, clock-base=(uint)4284799762,
seqnum-base=(uint)13733' port=5000 ! rtpbin.recv_rtp_sink_0 \
rtpbin. ! rtpmp4vdepay ! ffdec_mpeg4 ! ffmpegcolorspace !
ximagesink \
udpsrc caps='application/x-rtp, media=(string)audio, clock-
rate=(int)8000, encoding-name=(string)SPEEX, encoding-
params=(string)1, ssrc=(uint)2097462082, payload=(int)110, clock-
base=(uint)1936446758, seqnum-base=(uint)30513' port=5002 !
rtpbin.recv_rtp_sink_1 \
rtpbin. ! rtpspeexdepay ! speexdec ! audioconvert !
audioresample ! alsasink


I'm using Pipeline.launch in order to run these through java.
Both work through the terminal. I'm able to run the server code in
java with the client code through the terminal, but not vice versa.
So I'm pretty sure the client code is what is not working through
java.


I get an error saying "lock: No locks available" when i run the client
code. but I get that in the terminal too.

Does anyone have any Ideas ?

Tal Shalif

unread,
Apr 8, 2012, 12:33:17 PM4/8/12
to gstream...@googlegroups.com
You could try to add some more queue elements here and there.


--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To post to this group, send email to gstream...@googlegroups.com.
To unsubscribe from this group, send email to gstreamer-jav...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gstreamer-java?hl=en.


Raphael

unread,
Apr 8, 2012, 3:55:13 PM4/8/12
to gstreamer-java
could you be a little more specific ?

to clarify, I have 2 separate pipelines. One to run the server that is
sending the audio/video using rtpbin, one to run the client that is
receiving the audio/video.

running these separate pipelines on different terminals works.
running the server through java's Pipeline.launch() and the client
through the terminal works.
running both through java doesn't work.
running the server through the terminal and the client through java
does not work.

Is there a reason why the client pipeline code might not work through
java's Pipeline.launch() ?


On Apr 8, 11:33 am, Tal Shalif <tsha...@gmail.com> wrote:
> You could try to add some more queue elements here and there.
>

Tal Shalif

unread,
Apr 8, 2012, 11:27:42 PM4/8/12
to gstream...@googlegroups.com
'queue' elements insert threading into your pipelines. I can not be more specific because I don't always know why or where to insert them. In the past some pipelines that would not start playing otherwise started working by placing a queue somewhere. It is was a trial and error type of success for me. 

Tal Shalif

unread,
Apr 8, 2012, 11:30:13 PM4/8/12
to gstream...@googlegroups.com
So, when you run your client pipeline inside Java, it may be that threading priorities and different hierarchies are what make the pipeline choke on a threading issue. Queues could help - or not..
Reply all
Reply to author
Forward
0 new messages