Help translating gst-launch to the gst api? app-src, "not-negotiated"
wuss puss via gstreamer-devel <[email protected]>
| Newsgroups | gmane.comp.video.gstreamer.devel |
|---|---|
| Message-ID | <[email protected]> |
I'm trying to get the equivalent of this command: `gst-launch-1.0 udpsrc address=127.0.0.1 port=5000 caps="application/x-rtp" ! queue ! rtppcmudepay ! queue ! autoaudiosink` using the Gst api, except passing the rtp frames via a function instead of udp. What I figured so far:
```
source = Gst.ElementFactory.make("appsrc", "mysource")
source.props.caps=Gst.Caps.from_string('application/x-rtp')
sink = Gst.parse_bin_from_description('queue ! rtppcmudepay ! queue ! autoaudiosink', True)
pipeline = Gst.Pipeline()
source.link(sink)
pipeline.add(source)
pipeline.add(sink)
pipeline.set_state(Gst.State.PLAYING)
```
I then try to feed it rtp packets like: `source.emit('push-buffer', Gst.Buffer.new_wrapped(rtp_bytes))`, it produces no error, but neither can I hear any sound. With `pipeline.get_bus().add_signal_watch()` etc I am able to get the following Gst message:
GstMessageError, gerror=(GError)NULL, debug=(string)"../gstreamer/subprojects/gstreamer/libs/gst/base/gstbasesrc.c\(3132\):\ gst_base_src_loop\ \(\):\ /GstPipeline:pipeline1/GstAppSrc:appsrc-140141698531664:\012streaming\ stopped\,\ reason\ not-negotiated\ \(-4\)", details=(structure)"details\,\ flow-return\=\(int\)-4\;";