Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppSink methods missing: AttributeError: 'GstAppSink' object has no attribute 'is_eos'

I'm trying to use the AppSink sink to read samples from it but none of the AppSink methods seem to exist on the object.

import gi
gi.require_version("Gst", "1.0")

from gi.repository import Gst
Gst.init()

pipe = Gst.parse_launch("audiotestsrc ! opusenc ! appsink name=sink")
sink = pipe.get_by_name("sink")

while not sink.is_eos():
    pass

Error

Traceback (most recent call last):
  File "x.py", line 9, in <module>
    while not sink.is_eos():
AttributeError: 'GstAppSink' object has no attribute 'is_eos'

gstreamer version:

gst-inspect-1.0 version 1.14.1
GStreamer 1.14.1
https://launchpad.net/distros/ubuntu/+source/gstreamer1.0
like image 414
SBSTP Avatar asked Sep 11 '25 20:09

SBSTP


1 Answers

The appsink interface is in a different library than the base GStreamer one. You will need to import GstApp as well:

import gi

gi.require_version("Gst", "1.0")
gi.require_version("GstApp", "1.0")

from gi.repository import Gst, GstApp

Gst.init(None)

pipe = Gst.parse_launch("audiotestsrc ! opusenc ! appsink name=sink")
sink = pipe.get_by_name("sink")

while not sink.is_eos():
    pass
like image 173
Florian Zwoch Avatar answered Sep 14 '25 11:09

Florian Zwoch