Querying caps

Andrey Nechypurenko andreynech at googlemail.com
Fri Jul 8 07:17:23 UTC 2016


Hi Folks,

I am writing small python script to transmit rtp stream with
appsink/appsrc using following pipelines:

Sender:
videotestsrc is-live=true ! video/x-raw, width=640, height=480,
framerate=(fraction)30/1 ! videoconvert ! theoraenc ! rtptheorapay
name=payloader ! appsink name=sink

Receiver:
appsrc name=src ! rtptheoradepay ! decodebin ! videoconvert !
ximagesink sync=false

To playback the stream, as I understand, I need to set caps properly.
I.e. read them from sender payloader source pad and add caps filter
with ssrc, seqnum-offset, configuration, etc. between appsrc and
depayloader on receiver side. When I am running sender pipeline with
gst-launch -v, I can see all these caps. However, attempts to read
them from my python script always fails and this is where I hope to
get some help or hints from gstreamer Gurus.

Here is the code snipped where I am attempting to read caps in bus
message callback:

    if type == Gst.MessageType.STATE_CHANGED:
        prev, new, pending = message.parse_state_changed()
        if new == Gst.State.PAUSED:
            print('printing...')
            element = pipeline.get_by_name("payloader")
            for pad in element.srcpads:
                caps = pad.query_caps(None)
                print(caps.to_string())

Running this code generates the following output repeated seven times:
printing...
application/x-rtp, media=(string)video, payload=(int)[ 96, 127 ],
clock-rate=(int)90000, encoding-name=(string)THEORA

Attempt to read caps from appsink sink pad results in seven ANY outputs.

I would really appreciate if someone can shed the light why there are
seven state changes to the PAUSED state and what is more important for
me how to find missing caps such as ssrc, seqnum-offset,
configuration, etc.


Thanks,
Andrey.


More information about the gstreamer-devel mailing list