No VLC instance using python-vlc

This forum is about all development around libVLC.
floatingshed
New Cone
New Cone
Posts: 2
Joined: 17 Nov 2020 11:48

No VLC instance using python-vlc

Postby floatingshed » 17 Nov 2020 11:57

I am new to python-vlc.
I have the latest VLC 64bit installed in the default location.
I am running python 3.6 64bit
I have python-vlc installed.

I am simply trying to run the mediaplayer demo script included with python-vlc. The script runs and generates the gui but this error appears when I try to play a file:

Code: Select all

Traceback (most recent call last): File "C:\Users\floatingshed\Downloads\examples_wxvlc.py", line 177, in OnPlay self.OnOpen(None) File "C:\Users\floatingshed\Downloads\examples_wxvlc.py", line 148, in OnOpen self.Media = self.Instance.media_new(unicode(video)) File "C:\Python36\lib\site-packages\vlc.py", line 1932, in media_new m._instance = self AttributeError: 'NoneType' object has no attribute '_instance'

I have Googled this for hours, most say that the vlc dll's are not being found but they are.
Any ideas?
Thanks.

floatingshed
New Cone
New Cone
Posts: 2
Joined: 17 Nov 2020 11:48

Re: No VLC instance using python-vlc

Postby floatingshed » 17 Nov 2020 13:15

I have discovered that this error only occurs if the media file is in the root of a drive. If it is in a directory all is well.
Looking at the code of vlc.py, if the media file is in the root the mrl is not a valid path (in windows). It lacks the backslash following the drive letter.

Code: Select all

1903 def media_new(self, mrl, *options): 1904 """Create a new Media instance.

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: No VLC instance using python-vlc

Postby mfkl » 18 Nov 2020 04:51

Feel free to open a PR to contribute your help then :wink:
https://mfkl.github.io

discuss99
New Cone
New Cone
Posts: 2
Joined: 27 Nov 2020 08:22

Re: No VLC instance using python-vlc

Postby discuss99 » 27 Nov 2020 08:26

I have both vlc 4.0 64 bit and python 3 64 bit..install those python module properly....but have error when exec it. spend few days...install and uninstall , can't fix it...
anyone can help?

Error as below
vlc_instance = vlc.Instance(vlc_option)
AttributeError: module 'vlc' has no attribute 'Instance'

Code: Select all

#pip install pafy #pip install youtube_dl #pip install python-vlc import pafy import vlc import time vlc_option = '--video-filter=invert' #player = vlc.MediaPlayer("/path/to/file.flac") url = """https://youtu.be/xxxxxxxx""" vid = pafy.new(url) best = vid.getbest() best_player = best.url vlc_instance = vlc.Instance(vlc_option)


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 21 guests