stream RTSP to HTML website

前端 未结 2 750
盖世英雄少女心
盖世英雄少女心 2020-12-16 06:46

I would like to display IP cameras streaming in RTSP into a web page.

I\'ve tried many solutions, like using VLC to transcode the stream, but none of them seems to b

相关标签:
2条回答
  • 2020-12-16 07:23

    You can integrate VLC library into your website and VLC will take care of everything you need for playing RTSP stream: https://wiki.videolan.org/index.php?title=HowTo_Integrate_VLC_plugin_in_your_webpage&action=edit&oldid=19150

    0 讨论(0)
  • 2020-12-16 07:27

    After tried the "plugins" way suggested in

    How can I display an RTSP video stream in a web page?

    And the "conversion" way suggested in

    https://www.npmjs.com/package/html5_rtsp_player

    I finally found a really straight forward solution using this plugin, works for Chrome only which is ok for my project.

    https://www.videoexpertsgroup.com/vxg-chrome-plugin/

    This is how the html code look like

        <!DOCTYPE html>
        <html>
          <head>
          <title></title>
          <meta charset="utf-8" />
          <script type="text/javascript" src="/assets/vxgplayer-1.8.31/vxgplayer-1.8.31.min.js"></script>
          <link href="/assets/vxgplayer-1.8.31/vxgplayer-1.8.31.min.css" rel="stylesheet" />
        </head>
         <body>
           <div  class="vxgplayer"
           id="vxg_media_player1"
           width="640"
           height="480"
           url="rtsp://admin:admin@192.168.1.117/defaultPrimary0?streamtype=u"
           nmf-src="/assets/vxgplayer-1.8.31/pnacl/Release/media_player.nmf"
           nmf-path="media_player.nmf"
           useragent-prefix="MMP/3.0"
           latency="10000"
           autohide="2"
           volume="0.7"
           avsync
           autostart
           controls
           mute
           aspect-ratio
           aspect-ratio-mode="1"
           auto-reconnect
           connection-timeout="5000"
           connection-udp="0"
           custom-digital-zoom></div>
        </body>
        </html>
    
    0 讨论(0)
提交回复
热议问题