我正在为自己的VLC项目工作。我的目标是创建一个HTML前端来启动流。我这样做是通过使用Java Servlets来实现的。
概述: Ubuntu 13.04, Java 7-21:IcedTea 2.3.9, Eclipse JAVAEE IDE, Tomcat 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()启动流?
非常感谢任何和所有帮助!!!