I have a folder containing the following files:
1) VLC_Library_Test.py: the code in it is shown below.
2) vlc.py: the vlc python bindings that I downloaded from http://git.videolan.org/?p=vlc/bindings/python.git;a=tree;f=generated;b=HEAD
3) [Mazui]Hyouka-13[480p][DAEAD00A].mp4: a video file that I wish to play using the script.
# contents of VLC_Library_Test.py
import vlc
file_path = 'C:\\Users\\JohnSmith\\Computer_Code\\Python\\VLC\\[Mazui]_Hyouka_-_13_[480p][DAEAD00A].mp4'
vlc_instance = vlc.Instance()
vlc_player = vlc_instance.media_player_new()
media = vlc_instance.media_new(file_path)
vlc_player.set_media(media)
vlc_player.play()
Whenever I run the VLC_Library_Test.py script, nothing happens and I get the following error in the console log:
Warning: option --plugin-path no longer exists.
Warning: option --plugin-path no longer exists.
Process finished with exit code 0
How can I get the script above to work and play the video file using VLC ?
Any help is appreciated.
Here is some information about my current system:
Operating System: Windows 7 Home Premium (64 bit)
Python Interpreter: Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)]
VLC version: 2.1.5 Rincewind (64 bit)
vlc.exe & libvlc.dll Location: C:\Program Files\VideoLAN\VLC
I finally found a way to get it to work. All I needed was to add an infinite loop at the end of the code:
import vlc
file_path = 'C:\\Users\\JohnSmith\\Computer_Code\\Python\\VLC\\[Mazui]_Hyouka_-_13_[480p][DAEAD00A].mp4'
vlc_instance = vlc.Instance()
vlc_player = vlc_instance.media_player_new()
media = vlc_instance.media_new(file_path)
vlc_player.set_media(media)
vlc_player.play()
while True:
pass
I also installed the latest 64 bit version of VLC (2.2.0 Weatherwax). I then created a system environment variable called VLC and assigned it a value of C:\Program Files\VideoLAN\VLC (location of vlc.exe on your machine) and then appended that variable to the end of the system PATH variable. I had to restart Windows for the variable to take effect.