In order to get the requirement of yours I am suggesting following command which you should run on the terminal to control the VLC.
Code:
#!/usr/bin/python
import sys
import socket
#change to your vlc socket (in vlc configuration: UNIX socket command input)
SOCK = "/tmp/vlc.sock"
try:
command = sys.argv[1]
except:
print "try: %s help\n" % sys.argv[0]
sys.exit()
s = socket.socket(socket.AF_UNIX)
s.settimeout(0.5)
s.connect((SOCK))
s.send("%s\r" % command)
out = ""
while 1:
try:
line = s.recv(1024)
out += line
except socket.timeout:
break
if line == "":
break
s.close()
print out
Bookmarks