转:http://blog.sina.com.cn/s/blog_9ac492410100yrxz.html
http://blog.csdn.net/gavinr/article/details/7287939
单播输出(指哪哪打)
命令行 vlc -vvv /var/www/html/movie/baymax.mp4 --sout udp:192.168.1.103
vlc播放 vlc udp://@192.168.1.103
注:192.168.1.103 ip可任意设,需要在该ip上播放流
Http输出
命令行 vlc /var/www/html/movie/baymax.mp4 --sout http/ts:192.168.1.103:1024
或
vlc /var/www/html/movie/baymax.mp4 -vvv --loop --sout "#standard{access=http,mux=ts,dst=192.168.1.103:10086/stream}"
vlc播放 vlc http://192.168.1.103:1024
注:命令行ip必须是本机,端口可任设,ts为封装。
可在任意ip上播放,播放ip为服务器ip即为命令行ip
rtsp输出
vlc /var/www/html/movie/baymax.mp4 -vvv --loop --sout "#rtp{sdp=rtsp://192.168.1.103:10086/stream}"
客户端面直接使用vlc rtsp://192.168.1.103:10086/stream即可访问
复制
yanisyu@yanisyu-Aspire-E1-571G:~$ vlc /var/www/html/movie/baymax.mp4 -vvv --sout "#duplicate{dst=standard{access=file,mux=avi,dst=/home/yanisyu/test.avi}, dst=rtp{dst=192.168.1.103,name=stream,sdp=rtsp://192.168.1.103:10086/stream}, dst=display}"
通过dumplicate模块得到3个输出,保存为*.avi、发送到rtsp server、本地显示
dumplicate还有一个select选项,用于选择处理的stream
捕获摄像头http://stackoverflow.com/questions/6297348/vlc-record-webcam-and-stream-to-chrome-linux
yanisyu@yanisyu-Aspire-E1-571G:~$ vlc v4l2:// :v4l2-dev=/dev/video0 :v4l2-width=640 :v4l2-height=480 --sout "#transcode{vcodec=mpeg4,acodec=mpga,vb=800,ab=128}:standard{access=http,mux=ts,dst=192.168.1.108:10086/stream}"
捕获摄像头并录制视频
yanisyu@yanisyu-Aspire-E1-571G:~$ vlc v4l2:// :v4l2-dev=/dev/video0 :v4l2-width=640 :v4l2-height=480 --sout "#transcode{vcodec=mpeg4,acodec=mpga,vb=800,ab=128}:duplicate{dst=standard{access=http,mux=ts,dst=192.168.1.108:10086/stream},dst=standard{access=file,mux=avi,dst=/home/yanisyu/video.avi}}"
捕获桌面http://stackoverflow.com/questions/22084098/vlc-screen-capture-using-terminal
yanisyu@yanisyu-Aspire-E1-571G:~$ vlc -I dummy screen:// --screen-fps=25 --quiet --sout "#transcode{vcodec=h264,vb072}:standard{access=file,mux=mp4,dst="/home/yanisyu/vlc-output-terminal.mp4"}"
yanisyu@yanisyu-Aspire-E1-571G:~$ vlc -I dummy screen:// --screen-fps=25 --quiet --sout "#transcode{vcodec=h264,vb072}:standard{access=http,mux=ts,dst=192.168.1.108:10086/stream}"