1

I setup a live stream of the VLC Media player using Http and I want this stream to be played in my asp.net application using HTML 5 Video tag.

I expect to play the live stream of the VLC in my asp.net application.

Joey Phillips
  • 1,543
  • 2
  • 14
  • 22
Abdullah
  • 19
  • 5

1 Answers1

2

First You need to supply the MIME type attribute in the video tag: type="application/x-mpegURL". The video tag I use for a stream looks like this.

<video width="352" height="198" controls>
    <source src="VLCLiveStreamingURLGoesHere" type="application/x-mpegURL">
</video>

Make sure to replace VLCLiveStreamingURLGoesHere with your VLC Live stream URL.

If you want to play direct HLS file, then add chrome extension called Native HLS Playback from chrome web app.

A possible alternative for that:

Use an encoder (e.g. VLC or FFmpeg) into packetize your input stream to OGG format. For example, in this case I used VLC to packetize screen capture device with this code:

C:\Program Files\VideoLAN\VLC\vlc.exe -I dummy screen:// :screen-fps=16.000000 :screen-caching=100 :sout=#transcode{vcodec=theo,vb=800,scale=1,width=600,height=480,acodec=mp3}:http{mux=ogg,dst=127.0.0.1:8080/desktop.ogg} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep

Embed this code into a tag in your HTML page like that:

This should do the trick. However it's kind of poor performance and AFAIK MP4 container type should have a better support among browsers than OGG.

HTML5 live streaming

Joey Phillips
  • 1,543
  • 2
  • 14
  • 22