Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm creating a script that issues a few curl commands in order to access a time-protected mms stream link, then set up a relay using cvlc (vlc's command line interface) for my own use on an unencumbered player.

The curl aspect of this is working, as I can run as a browser and curl side by side and get the same access url. (It's time locked meaning the stream will work forever, but you have to connect quickly or the URL will time out.)

The very end of the script prints the command I will run, which is then followed up by "exec $CMD".

When I echo $CMD I get:
cvlc --sout '#standard{access=http,mux=asf,dst=0.0.0.0:58194}' mms://[...]

Manually Copy/Pasting this command in, verbatim, works perfectly fine, but as part of a script, the cvlc execution output says:

[0x9743d0] main interface error: no suitable interface module
[0x962120] main libvlc error: interface "globalhotkeys,none" initialization failed
[0x9743d0] dummy interface: using the dummy interface module...
[0xb16e30] stream_out_standard stream out error: no mux specified or found by extension
[0xb16ad0] main stream output error: stream chain failed for `standard{mux="",access="",dst="'#standard{access=http,mux=asf,dst=0.0.0.0:58194}'"}'
[0xb11cd0] main input error: cannot start stream output instance, aborting
[0xb11f70] signals interface error: Caught Interrupt signal, exiting...

Why is --sout behaving one way in a script (non-interactive shell?) vs. another way in the foreground (interactive shell) ?

share|improve this question

1 Answer 1

up vote 2 down vote accepted
+50

The thread Invoking VLC from a script has this funny answer at its end:

OK I've fixed it. Experimentation showed me that the answer is:

#!/bin/bash
VLCCMD="cvlc source.mp3 --sout "#duplicate{dst=std{access=udp,dst=192.168.0.2:1235}}""
echo VLC Command:$VLCCMD
$VLCCMD

There are two changes to my original script:

  • remove the double quotes from the MP3 filename
  • change the single-quote around the #duplicate to a double-quote
share|improve this answer
    
Hmmm. But those inner double-quotes are unescaped... –  VxJasonxV Dec 30 '10 at 8:05
    
HOLY CRAP IT WORKS. ... HOLY CRAP........ why does it work? O_o. The bounty is all yours.......... in 18 hours. –  VxJasonxV Dec 30 '10 at 8:31
    
This is probably a bug in the parameter-parsing of cvlc. You could report it in the VideoLAN Forums. –  harrymc Dec 30 '10 at 10:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.