I started with Python Bindings for the first time with: operating system- ubuntu 14.04 vlc-1.1.2 and python-2.7.6 Here is the sample code I am working on:
import vlc
instance = vlc.Instance()
media_ply = instance.media_player_new()
media_ply.set_mrl("test1.mp3")
media_ply.play()
But I am constantly getting the following error message:
Traceback (most recent call last):
File "vlc1.py", line 3, in <module>
instance = vlc.Instance()
File "/home/ankita/env2/mmenv5/local/lib/python2.7/site-packages/vlc.py", line 1551, in __new__
return libvlc_new(len(args), args)
File "/home/ankita/env2/mmenv5/local/lib/python2.7/site-packages/vlc.py", line 3903, in libvlc_new
ctypes.c_void_p, ctypes.c_int, ListPOINTER(ctypes.c_char_p))
File "/home/ankita/env2/mmenv5/local/lib/python2.7/site-packages/vlc.py", line 246, in _Cfunction
raise NameError('no function %r' % (name,))
NameError: no function 'libvlc_new'
Can anybody tell me , did I do something wrong?
I was getting same error. Then I solved it by installing vlc (stupid mistake :D) using
sudo apt-get install vlc
download vlc.py
from vlc.py
Place vlc.py
in the same directory as your program.
Note that you must have the VLC Media Player program already installed on your system.
To test it quickly in python:
>>> import vlc
>>> p=vlc.MediaPlayer('test1.mp3')
>>> p.play()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With