controlling VLC from another program

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
jarekf

controlling VLC from another program

Postby jarekf » 09 Dec 2004 16:05

Hi,

I want to execute vlc as a media player, that is being dynamically (not just at start) controlled from another application (written in java if that matters). In particular I want to be able to control volume during playback.

Is it possible to send control messages back and forth between the lanunching app and vlc? The command line options contains all I need (e.g. --key-vol-up <integer>), but I do not know how to be able to use that during runtime.

Thanks
Jarek

markfm
Big Cone-huna
Big Cone-huna
Posts: 1536
Joined: 22 Feb 2004 17:42

Postby markfm » 09 Dec 2004 16:40

Take a look at the rc interface. I believe it has volume control, as well as a few other things.

To launch, use --extraintf="rc" in your command line. This will open a console window for rc. Type in help to get a list of the available commands.

Play with the console interface, to get a feel for what the commands and responses look like. Then, do a start with both --extraintf="rc" and --rc-host="ip:port", where ip = the address of the PC and port = whatever port number you wish to use. You will now have a socket-based instance of the rc interface, hopefully something useful.

Alternately, you could probably launch with the http interface active, push properly formatted commands through that pipe.

jarekf

how to hide the console?

Postby jarekf » 10 Dec 2004 16:00

Thank you so much. This is amazing software. I have already done a successfull tests with RC mode from my app.
I have only one last question. I am running it on WindowsXP. Is it possible to hide the console window that appears just after start? I know it is needed for manual control, but when started from another program it is really redundant.

Thanks again
Jarek

jarekf

telnet access

Postby jarekf » 10 Dec 2004 17:45

I have encountered more problems, my previous tests were too preliminary.

When I run vlc RC only, it is not possible to communicate with it through standard streams (stdout, stdin), I guess the reason is vlc RC runs in a separate thread.
When I run with socket server (--rc-host="127.0.0.1:9999"), I can connect to the port with using regular telnet software, I can send commands, but there is no effect (no response from socket nor on vlc).

Am I doing something wrong or it doesn't work in version 0.8.1?
I am running it on Windows XP.

Thanks
Jarek

markfm
Big Cone-huna
Big Cone-huna
Posts: 1536
Joined: 22 Feb 2004 17:42

Postby markfm » 10 Dec 2004 18:10

On Windows, I also use --rc-quiet, which explicitly turns off the console window.

I run RC on both Win2K and WinXP, works fine, does what is expected. It's not a "real" Telnet interface, but a raw TCP/IP interface. Anyhow, I use RC to inject varrious logos and marquee/banner text, changing things and moving position on the video, on the fly.

What might be messing you up is if you are using software that is configured for real Telnet -- check for an option to turn Telnet protocol off in whatever you're using. Otherwise, do a search for TeraTerm Pro -- it's old freeware, works fine. TTP has a "Telnet" checkbox right on the user interface -- just clear it when doing a connection to RC.

Guest

Postby Guest » 10 Dec 2004 20:15

I used option --rc-quiet, and now it works great! Including telnet. I have just run first movie controlled from my app.
Thanks so much for this great software. I will be recommending using it with my open source app (http://bioera.net).

Jarek

jarekf
New Cone
New Cone
Posts: 6
Joined: 10 Dec 2004 20:22
Contact:

Postby jarekf » 10 Dec 2004 20:46

Is there a documentation about all commands available through RC? In the online help I did not find for example how to change "position on the video" you mentioned.
Now that it works so nicely I though to add more controls. For example set the position of the player window, so that after start it is in the same position as last time etc.

Thanks
Jarek

markfm
Big Cone-huna
Big Cone-huna
Posts: 1536
Joined: 22 Feb 2004 17:42

Postby markfm » 10 Dec 2004 20:48

--rc-extend turns on help for marquee.

cutty
New Cone
New Cone
Posts: 5
Joined: 18 May 2005 20:24

writing rc command to socket

Postby cutty » 18 May 2005 21:06

Has anybody been able to successfully control vlc via another application? I am not having any luck. Can somebody please help me!!!!!

I successfully issue this command to bring up vlc with rc

"C:\Program Files\VideoLAN\VLC\vlc.exe" --extraintf="rc" --rc-host="129.4.555.170:1234" --rc-quiet --rc-extend

-- this part works great, rc works perfectly when I communicate
with rc via telnet, however, I do not want to use telnet, I
just want to open a TCP/IP socket and send the rc commands to it.

I successfully open a socket on the correct port and try to send it
commands but it is not working. I guess I am a list confused on
how to send the rc command.

for instance if I want information on help, do I just send an "h" and a carrage return to the socket, or is there something special I have to do?

Can anybody help.... thanks alot

cbscpe

Postby cbscpe » 22 May 2005 22:38

Except for --rc-quiet and --rc-extend I use a similar command line to start vlc on Macosx and control it via a program. What I do is just open a socket and send "add udp://\n" and "play\n" to have vlc display a stream sent to the port 1234. In fact when connecting via Telnet you can get a list of available commands. When sending them via your program you just need to add a newline (at least on the Mac perhaps for Windows you need to add both newline and carriage return). Also volume control work perfect.

cutty
New Cone
New Cone
Posts: 5
Joined: 18 May 2005 20:24

it's working

Postby cutty » 28 May 2005 00:30

I got it working, I needed a newline and carrage return. it's pretty cool, thanks for the help all.

cutty

ftorm

rc command loop

Postby ftorm » 07 Jun 2005 00:29

Hi!

I want to communicate with VLC over a TCP socket. My app can connect, send commands, but only once.

example:
I send a play command from my application, but after this my pause command doesnt work.
After exiting and restarting my app i can pause the stream but then i cannot play it again.

My app is a simple loop with a few menu items (play, pause, stop . . .). The app and VLC never raises an error.

What could be the problem?

ftorm

bismarkjoe

I'm running into a similar issue

Postby bismarkjoe » 02 Aug 2005 03:57

I'm running into a similar problem, and have not had any luck finding a solution. I'm trying to launch the player with a command similar to the following:

--extraintf="rc" --rc-host=localhost:1313

I've tried it both with and without the "rc-quiet" switch, but have not had any sucess either way.

The version of VLC I am running is 0.8.2 on the windows platform, and I've tried connecting to port 1313 on my local machine from within a C# program, a java program, and I've even tried to use Tera Term Pro (both with and without the telnet box checked). All of the applications can connect to the socket fine, and even send commands (at least without raising an exception), but the application never responds, and there is no effect on the player.

I'm at my wit's end here. Does anyone have any suggestions? or better yet sample code that works?

I would prefer to use socket based communcation but am willing to use IO redirection if I can get it working...

Thanks in advance,

--Mike

jarekf
New Cone
New Cone
Posts: 6
Joined: 10 Dec 2004 20:22
Contact:

Extended GUI options?

Postby jarekf » 15 Aug 2005 19:46

Is it possible to control options available in Extended Gui via rc/telnet in real time? For example how to change brightness remotely?

Thanks
Jarek

lucindrea
New Cone
New Cone
Posts: 3
Joined: 30 Oct 2005 22:23

Postby lucindrea » 30 Oct 2005 23:28

2 things i needed to do with my telnet ( i connect to my windows box via my linux box - weir i know but i need that capture card in the xp box ) ...

telnet into the box
hit ^]
then
mode line
^]
mode litecho


after that all my commands work .. as stated above , you need the line feed and charrage return.
now if i can just work out how the change chans without havig to type next 30 times ;-)

huubee

Re: it's working

Postby huubee » 30 Dec 2005 16:35

I got it working, I needed a newline and carrage return. it's pretty cool, thanks for the help all.

cutty
Hi,

How did you setting the VLC ? I uses VLC 0.84a on window XP.

I got VLC 0.84a to communicates to my PC thru. "localhost:4212" port, I can only send the first command , any command send after the first one won't response. However the VLC communicates properly thru. DOS prompt, if option --rc-quiet disable.

If anyone know how, pls help.
thanks in advance

huubee

Guest

Re: rc command loop

Postby Guest » 30 Dec 2005 18:18

Hi!

I want to communicate with VLC over a TCP socket. My app can connect, send commands, but only once.

example:
I send a play command from my application, but after this my pause command doesnt work.
After exiting and restarting my app i can pause the stream but then i cannot play it again.

My app is a simple loop with a few menu items (play, pause, stop . . .). The app and VLC never raises an error.

What could be the problem?

ftorm

huubee

Re: rc command loop

Postby huubee » 30 Dec 2005 18:22

Hi!

I want to communicate with VLC over a TCP socket. My app can connect, send commands, but only once.

example:
I send a play command from my application, but after this my pause command doesnt work.
After exiting and restarting my app i can pause the stream but then i cannot play it again.

My app is a simple loop with a few menu items (play, pause, stop . . .). The app and VLC never raises an error.

What could be the problem?

ftorm
Hi,
I had the same problem like your. I know why. Here is the problem. Do not send any extra character after CR+LF
For example:
send cmd=help+CR+LF only. donot send 'help+CR+LF+char'

huubee


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 26 guests