24

I have problems streaming my webcam picture (without sound) to a html page. I'm using the latest (v2.0.2 vlc for windows) for streaming, here's the command line:

"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} 

when I open the stream in another vlc player (http://127.0.0.1:8080/webcam.mp4), I can watch the stream, but when I'm trying to embedding it to a webpage, I can see nothing! here's the code:

<!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>

Than I'm trying to open it in the browser like:

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

What I can see in chrome example, is that there's network traffic, the stream is downloading, but nothing displayed.

vipw
  • 7,593
  • 4
  • 25
  • 48
balazs
  • 5,698
  • 7
  • 37
  • 45
  • Did you ever get this problem solved? I am having a similar problem and would love to know how you solved it. – crashwap Dec 06 '12 at 17:20
  • @cssyphus No, I haven't, but if you will be able, please don't forget to answer this question. :) – balazs Dec 06 '12 at 21:08
  • @balazs I am having the exact same problem but I haven't found the answer on this page. Has there been any progress? – AlanObject Feb 22 '14 at 20:03

4 Answers4

19

You can't transmit mp4 over http protocol using VLC

Follow this link to see the Output method / muxer matrix http://www.videolan.org/streaming-features.html

However you can try to transcode to ogg.

Try this:

"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,vb=1024,channels=1,ab=128,samplerate=44100,width=320}:http{dst=:8080/webcam.ogg}

and in your html video tag:

<source src="http://127.0.0.1:8080/webcam.ogg"/>
RzR
  • 3,068
  • 29
  • 26
Martin
  • 191
  • 1
  • 3
3

try adding the type of video (type="video/mp4"):

<video width="320" height="240" controls="controls">
      <source src="movie.mp4" type="video/mp4" />
      <source src="movie.ogg" type="video/ogg" />
      Your browser does not support the video tag.
    </video>
Entrabiter
  • 752
  • 7
  • 13
  • 2
    unfortunately it doesn't help. – balazs Jul 02 '12 at 16:02
  • 1
    if that doesn't work you can try converting it to ogg video. vlc also does that and its html5 video-able – Entrabiter Jul 02 '12 at 17:05
  • looks like from my chrome that mine is coming through as an application/octet-stream. I don't think it will show up unless it sees it as a video/mp4. you can go to the advanced preferences of VLC and in the HTML streaming option set the MIME type to video/mp4 – Entrabiter Jul 02 '12 at 18:40
  • setting the MIME type to video/mp4 either don't solve the problem. When I streaming using theora (video/ogg) the MIME is application/octet-stream too, and it works. But I would like to streaming mp4 format. – balazs Jul 03 '12 at 12:12
1

you're telling VLC to stream in TS format mux=ts this is your problem, you need to mux in mp4

Daniel Hill
  • 312
  • 2
  • 13
1

For live streaming you should use following

<video id="video" src="http://localhost:8181/stream" type="video/ogg; codecs=theora" autoplay="autoplay"/>

More at Here's a link!

Please note: Video type "ogg" only!

alba
  • 11
  • 4