Running VLC from shell script

About encoding, codec settings, muxers and filter usage
jerrygeis
Blank Cone
Blank Cone
Posts: 37
Joined: 17 Jul 2007 22:29

Running VLC from shell script

Postby jerrygeis » 10 Jul 2008 17:13

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

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Running VLC from shell script

Postby Rémi Denis-Courmont » 10 Jul 2008 17:57

Your quoting is wrong.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

jerrygeis
Blank Cone
Blank Cone
Posts: 37
Joined: 17 Jul 2007 22:29

Re: Running VLC from shell script

Postby jerrygeis » 10 Jul 2008 18:48

I was thinking that - but I am not finding it.
Can you be a little more specific.

Thank you.

Jerry

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Running VLC from shell script

Postby Rémi Denis-Courmont » 10 Jul 2008 18:56

I expect "$VLC_SOUT" to be the proper syntax.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

jerrygeis
Blank Cone
Blank Cone
Posts: 37
Joined: 17 Jul 2007 22:29

Re: Running VLC from shell script

Postby jerrygeis » 10 Jul 2008 19:00

You are correct.

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

Thanks again.

Jerry


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 3 guests