python: Too many open files

Mathieu Duponchelle mathieu at centricular.com
Fri Jan 22 20:10:31 UTC 2021


GstPlayer can be used from python, and probably fits your use case :)

 meh   master  ~  devel  gst-build  ipython3

Python 3.8.6 (default, Sep 25 2020, 00:00:00) 

Type 'copyright', 'credits' or 'license' for more information

IPython 7.12.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from gi.repository import Gst                                                                                                                                                                                                                                                     

<ipython-input-1-4132414128eb>:1: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded.

  from gi.repository import Gst

In [2]: Gst.init(None)                                                                                                                                                                                                                                                                    

Out[2]: []

In [3]: from gi.repository import GstPlayer                                                                                                                                                                                                                                               

<ipython-input-3-b10918504373>:1: PyGIWarning: GstPlayer was imported without specifying a version first. Use gi.require_version('GstPlayer', '1.0') before import to ensure that the right version gets loaded.

  from gi.repository import GstPlayer

In [4]: p = GstPlayer.Player()                                                                                                                                                                                                                                                            

In [5]: p.set_uri('file:///home/meh/Music/chaplin.wav')                                                                                                                                                                                                                                   

In [6]: p.play()                                                                                                                                                                                                                                                                          

In [7]: p.set_uri('file:///home/meh/Music/biggie.wav')                                                                                                                                                                                                                                    

In [8]: p.play()                                                                                                                                                                                                                                                                          

On 1/22/21 7:27 PM, Patrick Shirkey wrote:
>
> Yes, I am using python for this project and this script meets all of my requirements except for the file descriptor leak.
>
> Is there a specific step required before/after loading a new audio file with:
> self.player.get_by_name('urisrc').set_property('uri', 'file://' + filename)
>
>
>
>
> -------- Original Message --------
> On Jan 22, 2021, 7:04 PM, Mathieu Duponchelle < mathieu at centricular.com> wrote:
>
>
>     Hey, are you aware of the existence of gst-player?
>
>     https://gstreamer.freedesktop.org/documentation/player/gstplayer.html?gi-language=c
>
>     Cheers,
>
>     -- 
>     Mathieu Duponchelle · https://www.centricular.com <https://www.centricular.com>
>
>     On 1/22/21 5:01 PM, Patrick Shirkey wrote:
>>     Hi,
>>
>>     I am using this simple python script to play audio files:
>>
>>     https://github.com/atareao/lplayer/blob/master/src/lplayer/player.py <https://github.com/atareao/lplayer/blob/master/src/lplayer/player.py>
>>
>>     specifically
>>
>>     85: get_player()
>>     135: play()
>>     172: stop()
>>
>>
>>     Any ideas on why I get 2 additional STREAM file descriptors every time I play a new track eventually resulting in "Too many open files" error and segfault?
>>
>>     ex.  44u     unix 0x000000008179a133       0t0  100262669 type=STREAM
>>
>>
>>     --
>>     Patrick Shirkey
>>
>>
>>
>>     _______________________________________________
>>     gstreamer-devel mailing list
>>     gstreamer-devel at lists.freedesktop.org
>>     https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210122/a48f1b19/attachment-0001.htm>


More information about the gstreamer-devel mailing list