HTML5 live streaming

前端 未结 8 1192
北恋
北恋 2020-11-28 18:38

For school I need to set up an HTML5 live stream site. They have a flash stream-player they\'ve been using but now they want it to use HTML5 instead. How can I do this? I tr

相关标签:
8条回答
  • 2020-11-28 19:30

    Use ffmpeg + ffserver. It works!!! You can get a config file for ffserver from ffmpeg.org and accordingly set the values.

    0 讨论(0)
  • 2020-11-28 19:34

    A possible alternative for that:

    1. 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

    2. Embed this code into a <video> tag in your HTML page like that:

      <video id="video" src="http://localhost:8080/desktop.ogg" autoplay="autoplay" />

    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.

    0 讨论(0)
提交回复
热议问题