视频流 – 流媒体mp4与vlc到html浏览器

前端之家收集整理的这篇文章主要介绍了视频流 – 流媒体mp4与vlc到html浏览器前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我的网络摄像头图像(没有声音)流向html页面时遇到问题.我使用最新的(v2.0.2 vlc for Windows)进行流式传输,这里是命令行:
"c:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -I dummy  dshow:// --dshow-vdev="Logitech QuickCam Chat" --dshow-adev=none --dshow-caching=0 --sout=#transcode{vcodec=h264,vb=1024,channels=1,ab=128,samplerate=44100,width=320}:http{mux=ts,dst=:8080/webcam.mp4}

当我在另一个vlc播放器(http://127.0.0.1:8080/webcam.mp4)中打开流时,我可以观看流,但是当我想嵌入到一个网页时,我什么都看不到!这里是代码

<!DOCTYPE html>
<html>
  <head>
    <title>Video Test</title>
  </head>
  <body>
    <video id="video" class="projekktor" autoplay="autoplay" width="300px" preload="Metadata">  
      <source src="http://127.0.0.1:8080/webcam.mp4" />
            Your browser doesn't appear to support the HTML5 <code>&lt;video&gt;</code> element.  
    </video>
  </body>
</html>

比我试图在浏览器中打开它:

file:///C:/videostreaming/video.html

我可以在chrome示例中看到,是网络流量,流正在下载,但没有显示.

解决方法

您不能使用VLC通过http协议传输mp4

按照此链接查看Output方法/ muxer矩阵
http://www.videolan.org/streaming-features.html

但是你可以尝试转码为ogg.

尝试这个:

"c:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -I dummy  dshow:// --dshow-vdev="Logitech QuickCam Chat" --dshow-adev=none --dshow-caching=0 --sout=#transcode{vcodec=theo,width=320}:http{dst=:8080/webcam.ogg}

并在您的html视频标签中:

<source src="http://127.0.0.1:8080/webcam.ogg"/>
原文链接:https://www.f2er.com/html/231046.html

猜你在找的HTML相关文章