I am new to gstreamer and its development. I am trying to mix RTP streams using Gstreamer Python. The client sends the different videotest sources and the mixing of these streams should happen on the receiver side using RTP. This should be possible for atleast four participants.
The receiver side will have a videotestbackground already linked with it which will be displayed first. When the receiver will receive the videotest sources then the mixing of the videotest sources should take place and displayed on the videotestbackground.
Here is the code for the receiver side “receiver.py”: http://pastebin.com/dM2LcNM2
And
Here is the code for the client side “send_client.py”: http://pastebin.com/33edcQ40
I am getting ERROR message like:
ankit@fh:~/$ ./receiver4.py
Started...
Running...
new ssrc
session 0
ssrc 3217594798
3217594798
filter: /GstPipeline:server/GstCapsFilter:filter (__main__.GstCapsFilter) || Type:: <class '__main__.__main__.GstCapsFilter'>
srcpad1: /GstPipeline:server/GstUDPSrc:udpsrc0.GstPad:src (gst.Pad) || Type::: <type 'gst.Pad'>
sinkpad1: None
Traceback (most recent call last):
File "./receiver4.py", line 132, in on_new_ssrc
lres = gst.Pad.link(srcpad1, sinkpad1)
TypeError: GstPad.link() argument 1 must be gst.Pad, not None
I am not able to understand why I am getting ‘None’ on request for ‘sinkpad1’. In the documentation, it is stated that updsrc sinkpad are ‘on request’.
PS: Please refer code for referring the syntax and logic I used for getting ‘sinkpad1’
I am not able to get it running. I Struggled a lot to find the solution. Please somebody help me in finding the logical error. Thanks in advance.
Here is the solution finally I found. 🙂
I forgot to keep in mind that I have to use ‘rtpbin’ which I am receiving it from client. The Pad properties of ‘gstrtpbin’ (
$gst-inspect gstrtpbin) are as follows.Looking on the above Pad properties, I have to use ‘recv_rtp_sink_%d’ pad which is available only on request.
I replaced/modified the source ‘receiver.py’ file:
And many minor bugs when I go on fixing it. But my main goal for this question posted here is fulfilled. So, I decided to provide answer in case other people like me get stuck on this silly negligence and logical problem.