简体   繁体   中英

how can i play VLC live streaming video in asp.net application using HTML video Tag

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.

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 (eg 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM