Python Bindings for GStreamer on Ubuntu

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

Python Bindings for GStreamer on Ubuntu

sk_gst
Hello,

I am trying to learn to use python with Gstreamer. I am following the
tutorials mentioned  here
<https://github.com/gkralik/python-gst-tutorial/blob/master/basic-tutorial-2-ex-vertigo.py>  
.  I installed the python-gst using 'sudo apt-get install python-gst-1.0'.

However, when I run the script, I get the following errors:

Traceback (most recent call last):
  File "basic2.py", line 28, in <module>
    pipeline.add(source, filter_vertigo, videoconvert, sink)
TypeError: Gst.Bin.add() takes exactly 2 arguments (5 given)

Changing the first line in script to '#!/usr/bin/env python2.7' makes it
work.
I am trying to understand why the gstreamer does not work with python3.

Which packages should I install to get it working?

I am running a Ubuntu 18.04 with Gstreamer1.0.



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

Re: Python Bindings for GStreamer on Ubuntu

Mathieu Duponchelle
Hello,

Have you installed the "python-gst-1.0" package? It contains the overrides that make,
amongst other things, Gst.Bin.add accept an arbitrary number of arguments.

--
Mathieu Duponchelle · https://www.centricular.com

On 07/24/2018 02:19 PM, vk_gst wrote:

> Hello,
>
> I am trying to learn to use python with Gstreamer. I am following the
> tutorials mentioned  here
> <https://github.com/gkralik/python-gst-tutorial/blob/master/basic-tutorial-2-ex-vertigo.py>  
> .  I installed the python-gst using 'sudo apt-get install python-gst-1.0'.
>
> However, when I run the script, I get the following errors:
>
> Traceback (most recent call last):
>   File "basic2.py", line 28, in <module>
>     pipeline.add(source, filter_vertigo, videoconvert, sink)
> TypeError: Gst.Bin.add() takes exactly 2 arguments (5 given)
>
> Changing the first line in script to '#!/usr/bin/env python2.7' makes it
> work.
> I am trying to understand why the gstreamer does not work with python3.
>
> Which packages should I install to get it working?
>
> I am running a Ubuntu 18.04 with Gstreamer1.0.
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Python Bindings for GStreamer on Ubuntu

Thibault Saunier-4
Hello,

You only installed python-gst which is for python2, there must be
another package for python3.

Regards,

Thibault
On Tue, Jul 24, 2018 at 9:17 AM Mathieu Duponchelle
<[hidden email]> wrote:

>
> Hello,
>
> Have you installed the "python-gst-1.0" package? It contains the overrides that make,
> amongst other things, Gst.Bin.add accept an arbitrary number of arguments.
>
> --
> Mathieu Duponchelle · https://www.centricular.com
>
> On 07/24/2018 02:19 PM, vk_gst wrote:
> > Hello,
> >
> > I am trying to learn to use python with Gstreamer. I am following the
> > tutorials mentioned  here
> > <https://github.com/gkralik/python-gst-tutorial/blob/master/basic-tutorial-2-ex-vertigo.py>
> > .  I installed the python-gst using 'sudo apt-get install python-gst-1.0'.
> >
> > However, when I run the script, I get the following errors:
> >
> > Traceback (most recent call last):
> >   File "basic2.py", line 28, in <module>
> >     pipeline.add(source, filter_vertigo, videoconvert, sink)
> > TypeError: Gst.Bin.add() takes exactly 2 arguments (5 given)
> >
> > Changing the first line in script to '#!/usr/bin/env python2.7' makes it
> > work.
> > I am trying to understand why the gstreamer does not work with python3.
> >
> > Which packages should I install to get it working?
> >
> > I am running a Ubuntu 18.04 with Gstreamer1.0.
> >
> >
> >
> > --
> > Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> > _______________________________________________
> > gstreamer-devel mailing list
> > [hidden email]
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Python Bindings for GStreamer on Ubuntu

sk_gst
In reply to this post by Mathieu Duponchelle
Hi Mathieu,

As I mentioned in the question, I have already installed python-gst-1.0
using 'apt-get install' .

linux@linux-GP60-2PE:~/Documents/py_gst_samples/eg$ sudo apt-get install
python-gst-1.0
Reading package lists... Done
Building dependency tree      
Reading state information... Done
python-gst-1.0 is already the newest version (1.14.1-1~ubuntu18.04.1).

Also for the following:
linux@linux-GP60-2PE:~/Documents/py_gst_samples/eg$ python
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygst
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pygst
>>>


Do you know where I am going wrong?



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

Re: Python Bindings for GStreamer on Ubuntu

Russel Winder
In reply to this post by sk_gst
On Tue, 2018-07-24 at 07:19 -0500, vk_gst wrote:
> Hello,
>
> I am trying to learn to use python with Gstreamer. I am following the
> tutorials mentioned  here
> <https://github.com/gkralik/python-gst-tutorial/blob/master/basic-tut
> orial-2-ex-vertigo.py>  
> .  I installed the python-gst using 'sudo apt-get install python-gst-
> 1.0'.

python-gst-1.0 is for Python 2

python3-gst-1.0  is for Python 3

At least on Debian Sid…

> However, when I run the script, I get the following errors:
>
> Traceback (most recent call last):
>   File "basic2.py", line 28, in <module>
>     pipeline.add(source, filter_vertigo, videoconvert, sink)
> TypeError: Gst.Bin.add() takes exactly 2 arguments (5 given)
>
> Changing the first line in script to '#!/usr/bin/env python2.7' makes
> it
> work.
> I am trying to understand why the gstreamer does not work with
> python3.
>
> Which packages should I install to get it working?
>
> I am running a Ubuntu 18.04 with Gstreamer1.0.
>
…but it should be the same on Ubuntu

--
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Python Bindings for GStreamer on Ubuntu

Mathieu Duponchelle
In reply to this post by Mathieu Duponchelle
I should probably learn to read, see what the others said :)

On 07/24/2018 03:17 PM, Mathieu Duponchelle wrote:
> Hello,
>
> Have you installed the "python-gst-1.0" package? It contains the overrides that make,
> amongst other things, Gst.Bin.add accept an arbitrary number of arguments.
>

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

Re: Python Bindings for GStreamer on Ubuntu

sk_gst
In reply to this post by Russel Winder
This worked.

Cheers!!



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel