VLC HTTP video streaming [closed]

2019-04-16 02:20发布

问题:

I have a server to stream using HTTP protocol and (VLC) software and am forwarding the stream to dyndns.com to be able to broadcast to internet. I am able to see the stream from my website only with Firefox and Internet Explorer using the following script:

<object
        classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" 
        codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab"
        id="vlc"
        name="vlc"
        class="vlcPlayer"
        width="100%"
        height="100%"
        events="True">
    <param name="Src" value="DYNDNS_Address" />
    <param name="ShowDisplay" value="True" />
    <param name="AutoLoop" value="True" />
    <param name="AutoPlay" value="True" />
</object>

I am unable to preview the stream on chrome, also in order to see the video on IE and Firefox I had to install VLC software.

My question is: How can I preview this stream without forcing guest users to download and install VLC? Also, is there any HTML5 player that can preview this type of stream?

回答1:

This is a challenging task. You will need to look into several things in order to achieve what you seem to require: Streaming to Chrome, Firefox and IE.

You're keywords are "HTTP Live Streaming", "Segmenting", "HTML5 video tag"

VLC offers a way to produce a stream conforming to the HTTP Live Streaming format. The VLC module you are looking for is called livehttp

An example command for setting up such a segmented stream would look like this

vlc -vvv -I dummy <SOURCEADDRESS> --sout='#transcode{width=1280,height=720,fps=25,vcodec=h264,vb=4096,venc=x264{aud,profile=baseline,level=30,keyint=30,ref=1},acodec=mp3,ab=96}:std{access=livehttp{seglen=10,delsegs=false,numsegs=10,index=/path/to/your/index/prog_index.m3u8,index-url=YourUrl/fileSequence######.ts},mux=ts{use-key-frames},dst=/path/to/your/ts/files/fileSequence######.ts}'

With such a stream you can then integrate with the HTML5 video tag such as:

<video width="640" height="480">
<source src="/path/to/your/index/prog_index.m3u8" />
</video>

This should work for platforms supporting HTTP Live Streaming, HTML5 video and H264. These are starting points which should lead you into the right direction.

Also, look into this answer for a little bit more detail on the workflow steps involved.

Hope it helps you achieve what you require.



回答2:

Khaldoon,

I don't know if you have answer to the question already, however I will give one as follows:

You do need the vlc web plugins to be installed on the browsers to playback the video on your website. Unfortunately, the vlc plugin cannot be installed sepeartely, they are bundled together with the vlc player application itself.

So really, your users will have no choice but to install vlc player on their computer, ensuring that the web-plugin component was selected. This has been my expereince working with vlc web plugins.

I hope this help you or someone else.