2

Estoy escribiendo un simple script para reproducir un archivo de audio con la librería Gst(gstreamer) de PyGobject, al ejecutar el script sale el siguiente error:

(python3:31506): GStreamer-CRITICAL **: 00:55:27.705: Trying to dispose element pipeline, but it is in READY instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. This problem may also be caused by a refcounting bug in the application or some element.

(python3:31506): GStreamer-CRITICAL **: 00:55:27.705: Trying to dispose element audio_source, but it is in PAUSED instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. This problem may also be caused by a refcounting bug in the application or some element.

(python3:31506): GStreamer-CRITICAL **: 00:55:27.705: Trying to dispose element typefind, but it is in PAUSED instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. This problem may also be caused by a refcounting bug in the application or some element.

(python3:31506): GStreamer-CRITICAL **: 00:55:27.705: Trying to dispose element decode, but it is in PAUSED instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. This problem may also be caused by a refcounting bug in the application or some element.

(python3:31506): GStreamer-CRITICAL **: 00:55:27.706: Trying to dispose element convert, but it is in PAUSED instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. This problem may also be caused by a refcounting bug in the application or some element.

(python3:31506): GStreamer-CRITICAL **: 00:55:27.706: Trying to dispose element audio_sink, but it is in PAUSED instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. This problem may also be caused by a refcounting bug in the application or some element.

No consigo ninguna información al respecto, Aqui el Código de mi script:

import gi
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst

class SimplePlayer:

    def __init__(self, path):

        self.path = path

        # Init Gst
        GObject.threads_init()
        Gst.init(None)

        #Create Pipeline
        self.pipeline = Gst.Pipeline('pipeline')

        #Create Elements for Pipeline
        self.source = Gst.ElementFactory.make('filesrc', 'audio_source')
        self.decode = Gst.ElementFactory.make('decodebin', 'decode')
        self.audioconvert = Gst.ElementFactory.make('audioconvert', 'convert')
        self.audio_sink = Gst.ElementFactory.make('autoaudiosink', 'audio_sink')

        #Configure Elemnts
        self.source.set_property('location', path)

        #Adding Elements to Pipeline
        self.pipeline.add(self.source)
        self.pipeline.add(self.decode)
        self.pipeline.add(self.audioconvert)
        self.pipeline.add(self.audio_sink)


        #Linking Elements
        self.source.link(self.decode)
        self.decode.link(self.audioconvert)
        self.audioconvert.link(self.audio_sink)

        # Finally Playing =D
        self.pipeline.set_state(Gst.State.PLAYING)

        #I don't know well from here
        bus = self.pipeline.get_bus()
        msg = bus.timed_pop_filtered(Gst.CLOCK_TIME_NONE,Gst.MessageType.ERROR | Gst.MessageType.EOS)
        print(msg)

player = SimplePlayer('/home/user/Music/audio.mp3')

También si me pueden sugerir un tutorial para esta librería me seria muy útil. Gracias

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.