Gnonlin and media-start

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

Gnonlin and media-start

Mike MacHenry
I am wondering if anyone can help me work around what I'm pretty sure
is a bug. In this program the first filesource plays the first two
seconds of my audio file (passed in the first argument) and the second
plays the next two seconds. The start time of the second filesource is
2, which means that it should start right after the first filesource
but it does not, it waits for 2 more seconds and starts 4 seconds in.
When I make the media-start property of the second filesource 0, it
does start right after the first filesource with not pause. Of course
it then plays the first two seconds of the file over again, rather
than the next two. Is there maybe a trick I might employ? I tried to
set my start for the second clip to zero so it starts two seconds back
but then it just is not heard at all.

Thanks,
-mike

#!/usr/bin/python
import pygst
pygst.require("0.10")
import gst
import gobject
import sys

def OnPad(comp, pad):
        convpad = compconvert.get_compatible_pad(pad, pad.get_caps())
        pad.link(convpad)

pipeline = gst.Pipeline()
comp = gst.element_factory_make("gnlcomposition")
pipeline.add(comp)
comp.connect("pad-added", OnPad)

compconvert = gst.element_factory_make("audioconvert")
pipeline.add(compconvert)

sink = gst.element_factory_make("alsasink")
pipeline.add(sink)
compconvert.link(sink)

audio1 = gst.element_factory_make("gnlfilesource")
comp.add(audio1)
audio1.set_property("location", sys.argv[1])
audio1.set_property("start", 0 * gst.SECOND)
audio1.set_property("duration", 2 * gst.SECOND)
audio1.set_property("media-start", 0 * gst.SECOND)
audio1.set_property("media-duration", 2 * gst.SECOND)

audio2 = gst.element_factory_make("gnlfilesource")
comp.add(audio2)
audio2.set_property("location", sys.argv[1])
audio2.set_property("start", 2 * gst.SECOND)
audio2.set_property("duration", 2 * gst.SECOND)
audio2.set_property("media-start", 2 * gst.SECOND)
audio2.set_property("media-duration", 2 * gst.SECOND)

pipeline.set_state(gst.STATE_PLAYING)
gobject.MainLoop().run()

-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gnonlin and media-start

Brandon Lewis-2
Oh, one more thing:
>
> #!/usr/bin/python
> import pygst
> pygst.require("0.10")
> import gst
> import gobject
> import sys
>

The above isn't quite right. This is the proper way to initialize pygst:

#!/usr/bin/python
import gobject
gobject.threads_init()
import pygst
pygst.require("0.10")
import gst
.....

-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gnonlin and media-start

Mike MacHenry
Brandon,

Thank you for your help. I just got around to implement this change in
my program and you were right. mp3's have a hard time with
media-start. There are lots of audio artifacts for the fast seek and
they have dead air. I suppose this a gstreamer bug but I've switched
my application to wav for now.

Thanks again,
-mike

On Fri, Feb 22, 2008 at 6:20 PM, Brandon Lewis
<[hidden email]> wrote:

> Oh, one more thing:
>
> >
>  > #!/usr/bin/python
>  > import pygst
>  > pygst.require("0.10")
>  > import gst
>  > import gobject
>  > import sys
>  >
>
>  The above isn't quite right. This is the proper way to initialize pygst:
>
>  #!/usr/bin/python
>  import gobject
>  gobject.threads_init()
>
> import pygst
>  pygst.require("0.10")
>  import gst
>  .....
>

-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel