使用Servlet启动VLC HTTP流时出现问题

使用Servlet启动VLC HTTP流时出现问题,http,servlets,video,streaming,vlc,Http,Servlets,Video,Streaming,Vlc,我正在为自己做一个VLC项目。我的目标是创建一个HTML前端来启动流。我通过使用Javaservlet来实现这一点 概述: Ubuntu 13.04, Java 7-21:IcedTea 2.3.9, Eclipse JAVAEE IDE, 雄猫7 我正在尝试使用此调用启动VLC HTTP视频流 vlc -vvv /home/jca310ms/Videos/test.avi.flv \ --sout '#transcode{vcodec=FLV1,vb=4096,fps=25,scale

我正在为自己做一个VLC项目。我的目标是创建一个HTML前端来启动流。我通过使用Javaservlet来实现这一点

概述: Ubuntu 13.04, Java 7-21:IcedTea 2.3.9, Eclipse JAVAEE IDE, 雄猫7

我正在尝试使用此调用启动VLC HTTP视频流

vlc -vvv /home/jca310ms/Videos/test.avi.flv \
    --sout '#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}:std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv}'
现在,这个调用确实可以从命令行执行。但是,当使用以下命令运行时:

String args = "vlc -vvv /home/jca310ms/Videos/test.avi.flv --sout '#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}:std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv}'";
Runtime runtime = Runtime.getRuntime();
Process p = runtime.exec(args);
我从输出中获得以下错误:

err: [0x7ff2d8000b78] main input debug: Creating an input for 'test.avi.flv'
err: [0x7ff2ac001108] main stream output debug: using sout chain=`standard{mux="",access="'#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}",dst="std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv   }'"}'
err: [0x7ff2ac001108] main stream output debug: stream=`standard'
err: [0x7ff2ac0014f8] main stream out debug: looking for sout stream module: 1 candidate
err: [0x7ff2ac0014f8] main stream out warning: missing value for option mux
err: [0x7ff2ac0014f8] main stream out debug: set config option: sout-standard-access to '#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}
err: [0x7ff2ac0014f8] main stream out debug: set config option: sout-standard-dst to std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv}'
err: [0x7ff2ac0014f8] stream_out_standard stream out error: no mux specified or found by extension
err: [0x7ff2ac0014f8] main stream out debug: no sout stream module matching "standard" could be loaded
err: [0x7ff2ac0014f8] main stream out debug: TIMER module_need() : 1.743 ms - Total 1.743 ms / 1 intvls (Avg 1.743 ms)
err: [0x7ff2ac0014f8] main stream out debug: destroying chain... (name=(null))
err: [0x7ff2ac0014f8] main stream out debug: destroying chain done
err: [0x7ff2ac001108] main stream output error: stream chain failed for `standard{mux="",access="'#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}",dst="std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv}'"}'
err: [0x20dd928] main playlist debug: finished input
err: [0x7ff2d8000b78] main input error: cannot start stream output instance, aborting
err: [0x20dd928] main playlist debug: dead input
err: [0x20dd928] main playlist debug: changing item without a request (current 0/1)
err: [0x20dd928] main playlist debug: nothing to play
您知道是什么原因导致vlc能够通过控制台启动流,但无法使用runtime.exec()启动流


非常感谢所有的帮助

我通过删除从“#transcode and}”开始的单引号解决了这个问题。显然,这在使用控制台时是必要的,但不是必需的,因为命令在Java中存储为字符串