Page 1 of 1

vlc remote executing with ssh fails

Posted: 21 Dec 2006 18:51
by vvvua
Hello.
I have 2 PCs.
1-st with video capture device
2-nd control system

I want to start vlc from 2-nd PC at 1-st PC with ssh command and vlc starts, but then exits.

Code: Select all

ssh video@10.0.0.1 "/home/video/go" VLC media player 0.8.6 Janus
"/home/video/go" - is a script with command line like
/usr/bin/vlc -I dummy --daemon v4l:// ...
BUT(!) When i run manually by

Code: Select all

ssh video@10.0.0.1 video@10.0.0.1$/home/video/go VLC media player 0.8.6 Janus
vlc starts and all works fine.
What is wrong?

P.S. screen is bad idea, couse i have to execute commands in scipts running from cron

Posted: 22 Dec 2006 14:01
by dimstar
I would guess that in the first case, when you start ssh with the go-command, it will be started as the shell that is dying as soon as the go-script finishes.

A simple WA could be to start vlc with
vlc -I... &
to fork it?

It isprobably a timing issue, that the go script exits before vlc is completely initialized and can take it's own control.

Regards,
Dominique

Posted: 22 Dec 2006 14:20
by vvvua
no.
vlc needs tty allocation.
all fixed.
Thanks.

Posted: 22 Dec 2006 14:22
by dimstar
vvvua,

for the records: can you tell the solution here, so in case somebody else comes accross the problem, he has chances not only to find that somebody else had the problem, but also a solution?

That's usually what I miss in Forums :-)

Posted: 22 Dec 2006 14:46
by vvvua
ok.
solution is:
1. setup ~/.ssh/known_hosts for ssh2 authentification without password promt
2. Now you can execute vlc or script with vlc inside with

Code: Select all

ssh -t user@remote_mashine "/path/to/vlc/vlc -I dummy --daemon ... ... ..."