PDA

View Full Version : Python and Gstreamer Problem



regomodo
November 3rd, 2009, 06:00 PM
#

SledgeHammer_999
November 3rd, 2009, 07:39 PM
I don't know python but I think I can follow your logic. I suggest you do this in load() :
1.After you have set the file-location on file-src, you should put file-src in paused mode. After that put decoderbin in paused mode(this will emit the pad-added signal.
2.In OnDynamicPad first put the converter and the sink in paused mode. Then connect the pad to the converter src-pad.

After that it should start playing on play()

regomodo
November 3rd, 2009, 09:08 PM
#

SledgeHammer_999
November 3rd, 2009, 10:35 PM
Dont forget that a pipeline is a gstelement itself. So I supposed you should do something like this for the file-src

self.filesrc.set_state(gst.STATE_PAUSED)

If this doesn't work, can you point me to the python-gst docs?

regomodo
November 3rd, 2009, 10:56 PM
#

regomodo
November 3rd, 2009, 11:03 PM
#

SledgeHammer_999
November 3rd, 2009, 11:11 PM
Does the print "OnDynamicPad called!" ever get called?

SledgeHammer_999
November 3rd, 2009, 11:16 PM
I think I spotted the actual problem.


file_now = "file://%s" % fname

get rid of the "file://"

regomodo
November 3rd, 2009, 11:26 PM
#

SledgeHammer_999
November 3rd, 2009, 11:40 PM
I suppose you are getting the same segfault now, with the changes I proposed right?

How about first setting the location of filesrc, then PAUSING it and then linking it to decodebin?

regomodo
November 4th, 2009, 05:53 PM
#

SledgeHammer_999
November 5th, 2009, 12:46 AM
This works because you're using a mainloop as I suggested on the other thread.

I don't know how you can interact with that. I suppose you should investigate how you can connect signal handlers.(eg on pressing "p" it should call a function in your code that pauses the pipeline).

Or maybe you can create another thread(B). On thread B create the mainloop(is that possible?) and the pipeline. Use the first thread to control thread B.

regomodo
November 5th, 2009, 11:04 AM
#

regomodo
November 6th, 2009, 07:42 PM
#

SledgeHammer_999
November 7th, 2009, 01:34 AM
Well I was right for one thing: you don't need file:// :p

Glad to hear you worked it out. (although thread_init may start a mainloop... just a guess).

Anywayz, if you have other questions about gstreamer I may be able to help you.(I am writing my own hobby app).