Page 1 of 1

Running VLC from shell script

Posted: 10 Jul 2008 17:13
by jerrygeis
When I run VLC from a script file with no variables everything works fine:

My First script:
#!/bin/sh
#
/usr/bin/vlc --stop-time=10 -I dummy -V dummy --quiet http://admin:admin@192.168.1.176/img/video.asf --sout #std{access=http,mux=asf,dst=:8080}' vlc:quit &

I can connect on port 8080 and play the video from source 176...

however,

when I try to put variables in the mix with my second script:
#!/bin/sh
#
VLC_VIDEO_URL=`if [ -e /tmp/vlc_video_url ]; then cat /tmp/vlc_video_url; else echo ""; fi`
VLC_STOP_TIME=`if [ -e /tmp/vlc_stop_time ]; then cat /tmp/vlc_stop_time; else echo ""; fi`
VLC_STREAM_PORT=`if [ -e /tmp/vlc_stream_port ]; then cat /tmp/vlc_stream_port; else echo ""; fi`
VLC_SOURCE_ADDRESS=`if [ -e /tmp/vlc_source_address ]; then cat /tmp/vlc_source_address; else echo ""; fi`
VLC_SOURCE_USER_PASSWORD=`if [ -e /tmp/vlc_source_user_password ]; then cat /tmp/vlc_source_user_password; else echo ""; fi`

VLC_SOUT="#std{access=http,mux=asf,dst=:$VLC_STREAM_PORT}"

/usr/bin/vlc -I dummy -V dummy --http-reconnect http://$VLC_SOURCE_USER_PASSWORD$VLC_SOURCE_ADDRESS/$VLC_VIDEO_URL --sout \'$VLC_SOUT\' &

This does not work... It gives me an error:
[00000268] dummy interface: using the dummy interface module...
[00000280] stream_out_standard private error: no access _and_ no muxer (fatal error)
[00000279] main stream output error: stream chain failed for `std{mux="",access="",dst="'#std{access=http,mux=asf,dst=:8100}'"}'
[00000277] main input error: cannot start stream output instance, aborting
[00000262] main playlist: nothing to play

What am I doing wrong here??? If I change the /usr/bin/vlc ... to echo /usr/bin/vlc ...
I see the exact same command as script 1 above that works.

THanks,

Jerry

Re: Running VLC from shell script

Posted: 10 Jul 2008 17:57
by Rémi Denis-Courmont
Your quoting is wrong.

Re: Running VLC from shell script

Posted: 10 Jul 2008 18:48
by jerrygeis
I was thinking that - but I am not finding it.
Can you be a little more specific.

Thank you.

Jerry

Re: Running VLC from shell script

Posted: 10 Jul 2008 18:56
by Rémi Denis-Courmont
I expect "$VLC_SOUT" to be the proper syntax.

Re: Running VLC from shell script

Posted: 10 Jul 2008 19:00
by jerrygeis
You are correct.

I thought I still needed the single quotes but no...

Thanks again.

Jerry