After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 611273 - get caps from rtpmp4vpay element
get caps from rtpmp4vpay element
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-python
0.10.25
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-02-27 12:13 UTC by Nicola
Modified: 2010-03-01 22:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Nicola 2010-02-27 12:13:56 UTC
Hi

I launch a pipeline from cli and in verbose mode I get the following output:

/GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0.GstPad:src: caps = 
application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-
name=(string)MP4V-ES, profile-level-id=(string)3, 
config=(string)000001b003000001b509000001000000012000c4f8305d8ba9851604241463000001b2200001010201, 
payload=(int)96, ssrc=(guint)1719703035, clock-base=(guint)3228674565, seqnum-
base=(guint)57615

I use the same pipeline in my python code and it works, but when I try to get 
the caps I have the following:

In [276]: for i in pipeline.elements():
    if 'rtpmp4vpay' in str(i.get_name()):
        sink=i
   .....:

In [279]: sink
Out[279]: <__main__.GstRtpMP4VPay object (rtpmp4vpay1) at 0x26b1230>

In [280]: for j in sink.src_pads():print str(j.get_caps())
   .....:
application/x-rtp, media=(string)video, payload=(int)[ 96, 127 ], clock-
rate=(int)[ 1, 2147483647 ], encoding-name=(string)MP4V-ES

these returned caps are the allowed caps and not the actual caps, the expected results is something like this:
 
application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-
name=(string)MP4V-ES, profile-level-id=(string)3, 
config=(string)000001b003000001b509000001000000012000c4f8305d8ba9851604241463000001b2200001010201, 
payload=(int)96

as report but the gst-launch

thanks
Nicola
Comment 1 Thiago Sousa Santos 2010-03-01 11:07:30 UTC
AFAIK this is how it is expected to be. To get the actual caps that is being used you should get the 'caps' property from the pad. Should be something like:

j.get_property("caps")
Comment 2 Tim-Philipp Müller 2010-03-01 11:27:54 UTC
Tried .get_negotiated_caps() ?
Comment 3 Wim Taymans 2010-03-01 11:48:52 UTC
This is not a bug. Use the caps property (and the notify so that you know when they are set).
Comment 4 Nicola 2010-03-01 20:35:20 UTC
I'm sorry but your suggestions didn't work:

>>> import pygst                                                      
>>> pygst.require("0.10")                                             
>>> import gst                                                        
>>> import gobject                                                    
>>> pipeline = gst.Pipeline("rtp-pipeline")                    
>>> source=gst.element_factory_make("udpsrc")
>>> source.set_property("port",2546)                   
>>> source.set_property("timeout",5000000)
>>> caps=gst.Caps("application/x-rtp, media=(string)video, payload=(int)121, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1")                                                                  
>>>depay=gst.element_factory_make("rtpmp4vdepay")                                 
>>>pay=gst.element_factory_make("rtpmp4vpay")
>>>destination=gst.element_factory_make("multiudpsink")
>>>destination.set_property("clients",'192.168.2.102:6000')
>>>pipeline.add(source,depay,pay,destination)
>>>gst.element_link_many(source,depay,pay,destination)              
True                                                                            
>>> pipeline.set_state(gst.STATE_PLAYING)
>>> pipeline.get_state()[1].value_name
'GST_STATE_PLAYING'
>>> for i in pipeline.elements():
...    if 'rtpmp4vpay' in str(i.get_name()):
...        pay=i                            
...
>>> pay
<__main__.GstRtpMP4VPay object (rtpmp4vpay0) at 0x1515d20>
>>> for j in pay.src_pads(): print str(j.get_property('caps'))
...
None
>>> for j in pay.src_pads(): print str(j.get_caps())
...
application/x-rtp, media=(string)video, payload=(int)[ 96, 127 ], clock-rate=(int)[ 1, 2147483647 ], encoding-name=(string)MP4V-ES
>>> for j in pay.src_pads(): print str(j.get_negotiated_caps())
...
None


If I use the caps from gst-lauch to build the sdp I can see the video, so the pipeline really works

thanks
Nicola
Comment 5 Tim-Philipp Müller 2010-03-01 22:40:27 UTC
gst-launch does exactly that (.get_property('caps')) when it gets a notify::caps signal from the pad (which happens when the first buffer is output.