gkralik / python-gst-tutorial

Python version of GStreamer tutorials (http://docs.gstreamer.com/display/GstSDK/Tutorials)
113 stars 42 forks source link

Example breaks without python3-gst-1.0 #5

Open declension opened 3 years ago

declension commented 3 years ago

Thanks for the examples! A problem I had (Ubuntu 20.04)

Steps

Run example 7 (possibly others too) on standard Python 3.8 install (with pygobject) on Ubuntu (etc)

Expected

Works and produces sine wave etc

Actual

TypeError: Gst.Bin.add() takes exactly 2 arguments (11 given)

Potential Fix

Seems this is solved by sudo apt install python3-gst-1.0 but this is not clear at any point

zdanek commented 1 year ago

@declension Nope, all you have to do is add all elements one by one to the pipeline. Just fix

 pipeline.add(audio_source, tee, audio_queue, audio_convert, audio_resample,
                 audio_sink, video_queue, visual, video_convert, video_sink)

to

    pipeline.add(audio_source)
    pipeline.add(tee)
    pipeline.add(audio_queue)
    pipeline.add(audio_convert)
    pipeline.add(audio_resample)
    pipeline.add(audio_sink)
    pipeline.add(video_queue)
    pipeline.add(visual)
    pipeline.add(video_convert)
    pipeline.add(video_sink)