Controlling parameters in pygst

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

Controlling parameters in pygst

Jille Timmermans
Hello,

I'm looking for a way to, let's say, change the equalizer-settings at a
specified point in time with GStreamer in Python. I've read the manual
and found the Controller-class.

Some snippets:
[..]
eq = gst.element_factory_make('equalizer-3bands')
[..]
control = gst.Controller(eq, 'band0', 'band1', 'band2')
control.set_interpolation_mode('band0', gst.INTERPOLATE_NONE)
[..]
control.set("band0", 8 * gst.SECOND, 12.0)
control.set("band0", 12 * gst.SECOND, -12.0)
[..]

My code is playing the MP3 I want, but doesn't do anything with the
equalizer-settings.

If I change the state of the pipeline to STATE_PLAYING and sleep for
some time and call
   eq.set_property('band0', -12.0)
it actually works, but I want a more exact timing.

Some background:
The projects[1] goal is to make a transition between two songs described
in an XML-file. It specifies at which time the second song should start
playing, can specify changes in pitch, equalizer-settings etc.

I would really love some hint whether the Controller is the right way to
go. I've also read something about DParams but I can't find the calls in
pygst so I assume they are not (yet) implemented.

Thanks in advance,
-- Jille
[1] https://github.com/Jille/MiXML
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Controlling parameters in pygst

Stefan Sauer
On 11/26/2011 04:56 PM, Jille Timmermans wrote:

> Hello,
>
> I'm looking for a way to, let's say, change the equalizer-settings at
> a specified point in time with GStreamer in Python. I've read the
> manual and found the Controller-class.
>
> Some snippets:
> [..]
> eq = gst.element_factory_make('equalizer-3bands')
> [..]
> control = gst.Controller(eq, 'band0', 'band1', 'band2')
> control.set_interpolation_mode('band0', gst.INTERPOLATE_NONE)
> [..]
> control.set("band0", 8 * gst.SECOND, 12.0)
> control.set("band0", 12 * gst.SECOND, -12.0)
> [..]
>
> My code is playing the MP3 I want, but doesn't do anything with the
> equalizer-settings.
>
> If I change the state of the pipeline to STATE_PLAYING and sleep for
> some time and call
>   eq.set_property('band0', -12.0)
> it actually works, but I want a more exact timing.
>
> Some background:
> The projects[1] goal is to make a transition between two songs
> described in an XML-file. It specifies at which time the second song
> should start playing, can specify changes in pitch, equalizer-settings
> etc.
>
> I would really love some hint whether the Controller is the right way
> to go. I've also read something about DParams but I can't find the
> calls in pygst so I assume they are not (yet) implemented.

You are using the right api. I think you run into a short comming of how
the 3-band and 10-band eq work. On the equalizer-nbands the api probably
works. I'll have a look into that and try to get it fixed before the
code-freeze.

Stefan
>
>
> Thanks in advance,
> -- Jille
> [1] https://github.com/Jille/MiXML
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: Controlling parameters in pygst

Stefan Sauer
In reply to this post by Jille Timmermans
On 11/26/2011 04:56 PM, Jille Timmermans wrote:

> Hello,
>
> I'm looking for a way to, let's say, change the equalizer-settings at
> a specified point in time with GStreamer in Python. I've read the
> manual and found the Controller-class.
>
> Some snippets:
> [..]
> eq = gst.element_factory_make('equalizer-3bands')
> [..]
> control = gst.Controller(eq, 'band0', 'band1', 'band2')
> control.set_interpolation_mode('band0', gst.INTERPOLATE_NONE)
> [..]
> control.set("band0", 8 * gst.SECOND, 12.0)
> control.set("band0", 12 * gst.SECOND, -12.0)
> [..]
>
> My code is playing the MP3 I want, but doesn't do anything with the
> equalizer-settings.
>
> If I change the state of the pipeline to STATE_PLAYING and sleep for
> some time and call
>   eq.set_property('band0', -12.0)
> it actually works, but I want a more exact timing.
>
> Some background:
> The projects[1] goal is to make a transition between two songs
> described in an XML-file. It specifies at which time the second song
> should start playing, can specify changes in pitch, equalizer-settings
> etc.
>
> I would really love some hint whether the Controller is the right way
> to go. I've also read something about DParams but I can't find the
> calls in pygst so I assume they are not (yet) implemented.

Hi again,

can you tra gstreamer for git (or apply commit
b5bf029401558588be1f474e1dfc7201c1e78be4). That should fix it. Thanks
for reporting this.

Stefan

>
> Thanks in advance,
> -- Jille
> [1] https://github.com/Jille/MiXML
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: Controlling parameters in pygst

Jille Timmermans
In reply to this post by Jille Timmermans
Stefan Sauer wrote:
> Hi again,
>
> can you tra gstreamer for git (or apply commit
> b5bf029401558588be1f474e1dfc7201c1e78be4). That should fix it. Thanks
> for reporting this.
>
> Stefan
It works!

Thanks a lot! It's really cool to see it got fixed within a few hours ;)

-- Jille
PS: As I'm not subscribed to the list I couldn't reply to your e-mail
but I read it at the archives.

Op 26-11-11 16:56, Jille Timmermans schreef:

> Hello,
>
> I'm looking for a way to, let's say, change the equalizer-settings at a
> specified point in time with GStreamer in Python. I've read the manual
> and found the Controller-class.
>
> Some snippets:
> [..]
> eq = gst.element_factory_make('equalizer-3bands')
> [..]
> control = gst.Controller(eq, 'band0', 'band1', 'band2')
> control.set_interpolation_mode('band0', gst.INTERPOLATE_NONE)
> [..]
> control.set("band0", 8 * gst.SECOND, 12.0)
> control.set("band0", 12 * gst.SECOND, -12.0)
> [..]
>
> My code is playing the MP3 I want, but doesn't do anything with the
> equalizer-settings.
>
> If I change the state of the pipeline to STATE_PLAYING and sleep for
> some time and call
> eq.set_property('band0', -12.0)
> it actually works, but I want a more exact timing.
>
> Some background:
> The projects[1] goal is to make a transition between two songs described
> in an XML-file. It specifies at which time the second song should start
> playing, can specify changes in pitch, equalizer-settings etc.
>
> I would really love some hint whether the Controller is the right way to
> go. I've also read something about DParams but I can't find the calls in
> pygst so I assume they are not (yet) implemented.
>
> Thanks in advance,
> -- Jille
> [1] https://github.com/Jille/MiXML
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel