VLC流到MP4 WEBM和Flash [英] VLC stream to MP4 WEBM and Flash

查看:277
本文介绍了VLC流到MP4 WEBM和Flash的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将视频从IP摄像头流式传输到我的Wordpress网站.我希望可以通过Windows,Mac,Android和IOS等常见设备访问我的流.目前,我正在使用VLC进行流传输,但是我只能使Flash流工作,但我想进行FLV,MP4和webm.我应该使用哪个播放器在网站上显示MP4和webm视频?而且我也不认为对VLC的调用是正确的,因为我无法在另一台计算机上的VLC中打开MP4和webm流,但是我可以打开flv流.

I am trying to stream video from a IP Cam to my my Wordpress site. I would like my stream to be available via common devices Windows, Mac, Android and IOS. Currently I am using VLC to stream,but I can only get a flash stream to work but I would like to do FLV, MP4 and webm. What player should I use to display the MP4 and webm video on the site? Also I don't think the calls to VLC are correct cause I can't open the MP4 and webm stream in VLC on another computer, but I can open the flv stream.

VLC脚本:

cd "C:\Program Files (x86)\VideoLAN\VLC"

vlc -vvv -I dummy http://IP/cgi/mjpg/mjpg.cgi :sout=#transcode{vcodec=h264,vb=200,deinterlace,ab=32,fps=25,width=460,height=480}:duplicate{dst=std{access=http{mime=video/x-flv},dst=0.0.0.0:8080/webcam.flv}}
vlc -vvv -I dummy http://IP/cgi/mjpg/mjpg.cgi :sout=#transcode{vcodec=VP80,vb=200,deinterlace,ab=32,fps=25,width=460,height=480,acodec=vorb}:duplicate{dst=std{access=http{mime=video/x-webm},dst=0.0.0.0:8080/webcam.webm}}
vlc -vvv -I dummy http://IP/cgi/mjpg/mjpg.cgi :sout=#transcode{vcodec=h264,vb=200,deinterlace,ab=32,fps=25,width=460,height=480}:duplicate{dst=std{access=http{mime=video/x-mp4},dst=0.0.0.0:8080/webcam.mp4}}

FLV播放器代码:

<object id="player1" width="640" height="480" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
    <param name="flashvars" value="file=http://VLC_IP:8080/webcam.flv&amp;autostart=true&stretching=exactfit" />
    <param name="allowfullscreen" value="true" />
    <param name="allowscriptaccess" value="always" />
    <param name="src" value="http://player.longtailvideo.com/player.swf" />
    <embed id="player1" width="640" height="480" type="application/x-shockwave-flash" src="http://player.longtailvideo.com/player.swf" flashvars="file=http://VLC_IP:8080/webcam.flv&amp;autostart=true&stretching=exactfit" allowfullscreen="true" allowscriptaccess="always" />
</object>

推荐答案

要流式传输 WebM ,您可以使用以下命令(在arch linux安装程序中有效)

To stream WebM you can use the following command (worked on arch linux setup)

cvlc \
$source \
--sout '#transcode{vcodec=VP80,vb=2000,scale=0,channels=2,samplerate=44100}:std{access=http{mime=video/webm},mux=webm,dst=:8080/cam1}' \
-vvv

尽管此(webm)不受官方支持.请参见矩阵

Although this (webm) is not officially supported. See these supported formats matrices

有关Sout参数的文档,请参见官方页面

For the documentation of sout params please see the official page

关于 MP4 :

完全不支持

这篇关于VLC流到MP4 WEBM和Flash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆