Results 1 to 6 of 6

Thread: How to control VLC through terminal while playing media?

  1. #1
    Join Date
    Jun 2005
    Posts
    65

    How to control VLC through terminal while playing media?

    Well I am big fond of Linux based operating system. Why because it seems to be secure than that of the windows based operating system. I have installed VLC on the computer of mine. well I wanted to know how can I control the VLC media player from the different console. Let me know how can I get the above mentioned requirement in the situation of mine. Any help to fix the matter would be highly appreciated. Thanks a lot in advance.

  2. #2
    Join Date
    Nov 2008
    Posts
    1,054

    Re: How to control VLC through terminal while playing media?

    Looking at the situation I am suggesting that you should launch the VLC GUI on the computer of yours and then you should simply try to listen the specific port by using the following command.
    Code:
    vlc --rc-host=localhost:4212 &
    And copy and paste the below mentioned command on the other terminal.
    Code:
    echo -e "/home/charles/Desktop/Fiat.wmv" | nc localhost 4212

  3. #3
    Join Date
    Nov 2008
    Posts
    996

    Re: How to control VLC through terminal while playing media?

    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

  4. #4
    Join Date
    May 2008
    Posts
    979

    Re: How to control VLC through terminal while playing media?

    I think you are doing something wrong with the thing which you have mentioned over here. I let you know that you will be able to get the requirement of yours if you can connect the VLC which you have installed on the computer by using the telnet localhost 4212. I am not sure about the thing whether it is going to work or not. However I recommend that you should try the same and let me know whether it is working or not.

  5. #5
    Join Date
    Nov 2008
    Posts
    1,192

    Re: How to control VLC through terminal while playing media?

    Let me know any of the above mentioned commands are working for you or not. If there is no change in the situation than I recommend that you should simply run the following command on the terminal.
    Code:
    vlc --intf rc
    Well you should copy and paste the above mentioned command and simply press enter from the keyboard.

  6. #6
    Join Date
    Jun 2009
    Posts
    1,518

    Re: How to control VLC through terminal while playing media?

    You should simply launch the VLC media player on the computer and simply play any of the video and then you should launch the terminal on the computer and then run the below mentioned command on the terminal.
    Code:
    sh-3.2$ /bin/echo -n  "pause" | nc -U /Users/vlc.sock

Similar Threads

  1. What is Media Access Control and Logical Link Control
    By Pakhi in forum Networking & Security
    Replies: 4
    Last Post: 10-01-2011, 10:53 AM
  2. What are the Functions Control Terminal Screen in PHP?
    By Zavier in forum Software Development
    Replies: 5
    Last Post: 04-03-2010, 02:16 AM
  3. Replies: 4
    Last Post: 29-01-2010, 09:11 PM
  4. Replies: 6
    Last Post: 07-01-2010, 10:50 AM
  5. Replies: 2
    Last Post: 29-03-2007, 06:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •