Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gst-resource-error-quark #1

Open
curiouswala opened this issue Apr 23, 2017 · 6 comments
Open

gst-resource-error-quark #1

curiouswala opened this issue Apr 23, 2017 · 6 comments

Comments

@curiouswala
Copy link

curiouswala commented Apr 23, 2017

The project is just what i needed but sadly doesn't work for me.
Python 3.5.2 under Linux

>>> from gsp import GstreamerPlayer
>>> player = GstreamerPlayer(None)
>>> player.queue("2.mp3")
gst-resource-error-quark: Could not open resource for reading. (5)

gstreamer work for me with my code i wrote a hacky version of the wrapper but really want queue management. Thanks for the code btw

@curiouswala curiouswala changed the title python 3.5.2 virtualenv python 3.5.2 virtualenv gst-resource-error-quark Apr 23, 2017
@curiouswala curiouswala changed the title python 3.5.2 virtualenv gst-resource-error-quark gst-resource-error-quark Apr 23, 2017
@happyleavesaoc
Copy link
Owner

Hi, specify the full path like so:

uri = 'file://' + os.path.abspath('2.mp3')

@curiouswala
Copy link
Author

curiouswala commented Apr 23, 2017

Here is the code

from gsp import GstreamerPlayer
import os

filename = '1cut.mp3'
print(os.path.exists(os.path.abspath(filename))) # This is true for me
player = GstreamerPlayer(None)
uri = 'file://'+os.path.abspath(filename)
player.queue(uri)

Here is the new result

/home/hasan/moodio_env/bin/python /home/hasan/PycharmProjects/audioplayer/wrapplayer.py
Process GstreamerProcess-2:
Traceback (most recent call last):
  File "/usr/lib/python3.5/multiprocessing/managers.py", line 709, in _callmethod
    conn = self._tls.connection
AttributeError: 'ForkAwareLocal' object has no attribute 'connection'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
    self.run()
  File "/home/hasan/moodio_env/lib/python3.5/site-packages/gsp/__init__.py", line 94, in run
    self.media(uri)
  File "/home/hasan/moodio_env/lib/python3.5/site-packages/gsp/__init__.py", line 118, in media
    self.state = STATE_PLAYING
  File "/home/hasan/moodio_env/lib/python3.5/site-packages/gsp/__init__.py", line 166, in state
    self._manager[ATTR_STATE] = state
  File "<string>", line 2, in __setitem__
  File "/usr/lib/python3.5/multiprocessing/managers.py", line 713, in _callmethod
    self._connect()
  File "/usr/lib/python3.5/multiprocessing/managers.py", line 700, in _connect
    conn = self._Client(self._token.address, authkey=self._authkey)
  File "/usr/lib/python3.5/multiprocessing/connection.py", line 487, in Client
    c = SocketClient(address)
  File "/usr/lib/python3.5/multiprocessing/connection.py", line 614, in SocketClient
    s.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

Process finished with exit code 0

mp3 file exists in the same dir
Could virtualenv affect it in any way?

@happyleavesaoc
Copy link
Owner

Try dropping the file://.

@jeena
Copy link

jeena commented Nov 29, 2017

I have the same problem.

@tschmidty69
Copy link

tschmidty69 commented Jan 15, 2018

I have a similar issue @happyleavesaoc I can play from the command line and from within my python venv for hass

Python 3.6.3 (default, Oct  3 2017, 21:45:48)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gsp import GstreamerPlayer
>>> pipeline = 'mpegaudioparse ! mpg123audiodec ! audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo'
>>> player = GstreamerPlayer(pipeline)
>>> player.queue('https://myserver/api/tts_proxy/a0f58f7e9238b8d577822294c20673c243bd091f_en-gb-wls_8567674757942596877_amazon_polly.mp3')
>>> gst-resource-error-quark: Error while seeking in file "/tmp/snapfifo". (11)

But when trying to play withing hass with the same parameters

 ERROR (SyncWorker_2) [gsp] gst-resource-error-quark: Could not open resource for reading. (5)

@pitoulambert
Copy link

I got the same problem while using the bbc/brave (audio/video) api editor

ERROR: [ output1] GStreamer error from sink: gst-resource-error-quark: Error while writing to file "/usr/local/share/brave/output_images/img_19777.jpg". (10)
ERROR: [ output1] GStreamer error debug: gstmultifilesink.c(793): gst_multi_file_sink_write_buffer (): /GstPipeline:pipeline25/GstMultiFileSink:sink:
No such file or directory
ERROR: [ output1] GStreamer error message: Error while writing to file "/usr/local/share/brave/output_images/img_19777.jpg".

I need your help please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants