Strange behaviour

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange behaviour

jouke hijlkema

Hello all,

First of all a big thank you for developing such a great tool !

That being said ... I have a problem with the following. On a remote machine I have an audio source with a udpsink on my local machine using port 8001

using :

gst-launch-1.0 -ev udpsrc port=8001 caps=application/x-rtp,media=audio,clock-rate=90000,encoding-name=MPA,payload=14,ssrc=2608690421,timestamp-offset=3965000461,seqnum-offset=25383 ! decodebin ! autoaudiosink

works perfectly and sound flows out of the speakers.

Using the following python code yields nothing, no errors but no sound either

import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstVideo', '1.0')
from gi.repository import GObject, Gst, GstVideo
GObject.threads_init()
Gst.init(None)

self.pipeline = Gst.Pipeline("audioPipeline")
self.src      = Gst.ElementFactory.make("udpsrc","src")
self.dec      = Gst.ElementFactory.make("decodebin","dec")
self.sink     = Gst.ElementFactory.make("autoaudiosink","sink")

self.src.set_property("port",self.portIn)
self.src.set_property("caps",Gst.Caps.from_string("application/x-rtp,media=audio,clock-rate=90000,encoding-name=MPA,payload=14,ssrc=2608690421,timestamp-offset=3965000461,seqnum-offset=25383"))

self.pipeline.add(self.src,self.dec,self.sink)

self.src.link(self.dec)
self.dec.link(self.sink)

self.pipeline.set_state(Gst.State.PLAYING)


The question is thus, what am I doing wrong ?

Thanks in advance for your help

Jouke


--
Jouke Hijlkema - Ingénieur de recherche
Laboratoire de Propulsion
Département Modèles pour l'Aérodynamique et l'Energétique
Tél : + 33 5 61 56 63 93  -  Fax : + 33 5 61 56 63 87

ONERA - The French Aerospace Lab - Centre du Fauga-Mauzac
31410 Mauzac
www.onera.fr  |  jouke.hijlkema@...

Avertissement/disclaimer http://www.onera.fr/onera-en/emails-terms


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Strange behaviour

Holger
I think you know it, but just to be sure... Do you wait after calling self.pipeline.set_state(Gst.State.PLAYING)? This is not a blocking call and the program will exit immediately.
Reply | Threaded
Open this post in threaded view
|

Re: Strange behaviour

Arjen Veenhuizen
Couple of things:
1. decodebin has 'sometimes' src pads so you should not hard link decodebin to any element a-priori.
2. You have to connect to the 'pad-added' signal on decodebin and in its callback connect the remainder of your pipeline elements. (e.g. self.dec.connect("pad-added", self.cbDecPadAdded))
3. You need an event loop (e.g. GObject.Mainloop.run()) after you set the pipeline to PLAYING.