GNOME Bugzilla – Bug 611273
get caps from rtpmp4vpay element
Last modified: 2010-03-01 22:40:27 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
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")
Tried .get_negotiated_caps() ?
This is not a bug. Use the caps property (and the notify so that you know when they are set).
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
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.