[gst-devel] GnlOperation help

Brandon Lewis brandon_lewis at berkeley.edu
Mon Feb 11 19:56:02 CET 2008


Edward Hervey wrote:
> Hi,
> 
>   What version of gstreamer/gst-plugins-base/gst-plugins-ugly/gnonlin do
> you have ?
> 
>   Does it output any warnings while playing (GST_DEBUG=2 python
> myscript.py) ?
> 
>      Edward
> 
> On Sat, 2008-02-09 at 18:29 -0500, Mike MacHenry wrote:
>> Bellow I've pasted a python script which I expect to play a mp3 I have
>> for 100 seconds. I expect that it should play from 10 seconds in to
>> 110 seconds. but it seems to be ignoring my media-start property. The
>> second issue is that the gnloperation seems to do nothing at all. I
>> want it to mute the stream from 1 second in for 20 seconds but the
>> audio just plays as normal. Anyone know what I'm doing wrong?
>>
>> Thanks for the help,
>> -mike
>>
>> import gobject
>> gobject.threads_init()
>> import pygst
>> pygst.require("0.10")
>> import gst
>>
>> pipeline = gst.Pipeline()
>> gnlcomposition = gst.element_factory_make("gnlcomposition")
>> audioconvert = gst.element_factory_make("audioconvert")
>> alsasink = gst.element_factory_make("alsasink")
>>
>> filesrc = gst.element_factory_make("gnlfilesource")
>> filesrc.set_property("location","/home/dskippy/17years.mp3")
>> filesrc.set_property("start", 0 * gst.SECOND)
>> filesrc.set_property("duration", 100 * gst.SECOND)
>> filesrc.set_property("media-start", 10 * gst.SECOND)
>> filesrc.set_property("media-duration", 100 * gst.SECOND)
>> filesrc.set_property("priority", 2)
>> gnlcomposition.add(filesrc)
>>
>> op = gst.element_factory_make("gnloperation")
>> op.set_property("start", 1 * gst.SECOND)
>> op.set_property("duration", 20 * gst.SECOND)
>> op.set_property("priority", 1)
>> v = gst.element_factory_make("volume")
>> v.set_property("mute", True)
>> op.add(v)
>> gnlcomposition.add(op)
>>
>> pipeline.add(gnlcomposition, audioconvert, alsasink)
>> gst.element_link_many(audioconvert, alsasink)
>> def OnPad (comp, pad):
>>         convpad = audioconvert.get_compatible_pad(pad, pad.get_caps())
>>         pad.link(convpad)
>> gnlcomposition.connect("pad-added", OnPad)
>>
>> def get_message(src, message):
>>         print message
>> bus = pipeline.get_bus()
>> bus.add_signal_watch()
>> watch_id = bus.connect("message", get_message)
>>
>> pipeline.set_state(gst.STATE_PLAYING)
>>
>> gobject.MainLoop().run()
>>

I ran a slightly modified version of his demo (uses sys.argv[1] instead
of hard-coded file path, and I disabled his message-handler callback).
Ran the program with the GST_DEBUG=2 on a .flac file, and this the
output that showed up.

$ GST_DEBUG=2 python test.py Music/Albums/flac/Beatles\ -\ Abbey\
Road/01\ -\ Come\ Together.flac
0:00:00.511432000  5637 0x81c9ed8 WARN        gnlcomposition
gnlcomposition.c:625:get_current_position:<gnlcomposition0> No current
stack, can't send query
0:00:00.584581000  5637 0x81c9ed8 WARN        gnlcomposition
gnlcomposition.c:625:get_current_position:<gnlcomposition0> No current
stack, can't send query
0:00:00.693505000  5637 0x81c9ed8 WARN             gnlsource
gnlsource.c:526:gnl_source_change_state:<gnlfilesource0> Couldn't find a
valid source pad
0:00:00.926743000  5637 0x835c118 ERROR       gnlcomposition
gnlcomposition.c:1391:no_more_pads_object_cb:<gnlcomposition0> Sending
seek event failed!
Traceback (most recent call last):
   File "test.py", line 45, in <module>
     gobject.MainLoop().run()

As mike said, he file does play normally, but the muting gnloperation
does nothing.

>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel






More information about the gstreamer-devel mailing list