1

I have been using gstreamer since some few weeks. Still I am not much aware of how things work internally. So I was following some tutorials online to learn how I can use it in efficient way. Here is the Github link to the tutorials https://github.com/gkralik/python-gst-tutorial . But whenever I run the script using terminal I got something like this

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

I do not know what is wrong here. gstreamer is running video files from terminal directly using command lines. But when I write some codes then it gives error similar to above or does display at all. In the tutorial link above the first tutorial should play the default trailer of movie but it does not show any output to me.

Please suggest some fix. What version should I use to get it right or any other help will be appreciated. I am on Ubuntu 16.04 LTS . and using python 3.5 for tutorials. The gi version is 3.20.0.

Urvish
  • 643
  • 3
  • 10
  • 19
  • basic-tutorial-2-ex-vertigo.py from the link given runs fine. Try copy and paste again into an empty directory this time and call it `basic-tutorial-2-ex-vertigo.py`. – Rolf of Saxony May 29 '18 at 07:27
  • Thanks. I got the solution of it by installing the python bindings for gstreamer. – Urvish May 29 '18 at 15:22

2 Answers2

3

Adding one after another helped me to run the application

pipeline.add(source, filter_vertigo, videoconvert, sink)

Needs to be modify as

pipeline.add(source)
pipeline.add(filter_vertigo)
pipeline.add(videoconvert)
pipeline.add(sink)
Shaik Ahmad
  • 449
  • 1
  • 3
  • 11
1

Changing the following line in script :

#!/usr/bin/env python3

to

#!/usr/bin/env python2.7 

made it work.

I have installed the python bindings using

sudo apt-get install python-gst-1.0

However, that did not make it work for the python3. Feel free to let me know how you got this working. I am using Ubuntu 18.04 which has python3, 2.7, 3.6, 2 installed

gst
  • 1,251
  • 1
  • 14
  • 32
  • 1
    I have installed python bindings of gstreamer and it worked. The command for that is like `sudo apt-get install python3-gst-1.0` – Urvish Jul 25 '18 at 09:05