python-gst-tutorial icon indicating copy to clipboard operation
python-gst-tutorial copied to clipboard

Example breaks without python3-gst-1.0

Open declension opened this issue 5 years ago • 1 comments

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

declension avatar Nov 04 '20 08:11 declension

@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)

zdanek avatar Jan 10 '23 21:01 zdanek