当前位置:网站首页>Solutions for RTSP video streaming played by several browsers

Solutions for RTSP video streaming played by several browsers

2022-06-24 17:21:00 daniulive

Scheme 1 : H5 + websocket_rtsp_proxy Realize live video streaming

Streamedian Provides a “html5_rtsp_player + websock_rtsp_proxy” Technical solution , Can pass html5 Of video The tag plays directly RTSP Video stream of .

The whole architecture is shown in the figure below , It is divided into server side and browser side :

Option two :RTSP turn RTMP To RTMP The server , turn http-flv, For playback terminal flv.js Play

flv.js In the access to FLV Format of audio and video data will be FLV The file flow code is reused as ISO BMFF(MP4 debris ) fragment , Re pass Media Source Extensions API Pass on to the original HTML5 Video Tag to play .

flv.js It's using ECMAScript 6 Compiling , And then through Babel Compiler Translate it into ECMAScript 5, Use Browserify pack .

flv.js Get... From the server FLV Then unpack it and transfer it to Video The reason for the label is as follows :

  • Compatible with the current live broadcast scheme : At present, most of the audio and video services of the live broadcast scheme adopt FLV The container format transmits audio and video data .
  • flv The format is simple , Compared with MP4 Format to package is simple 、 It also has an advantage in performance , It's faster and easier to parse .

Option three :RTSP turn RTMP To RTMP The server , turn hls, For playback terminal video.js Play

Video.js Is a web Video player , Support html5 and flash Two ways of playing . More customized skin , plug-in unit , Components , The language also has a wealth of options to configure .

Option four :VLC perhaps SmartPlayer Third party plug-ins play

VLC Don't say more , Almost all streaming media developers know ,SmartPlayer It's Daniel live SDK (Github) Play plug-in for , Better delay and function experience .

The advantage of the plug-in form is that there is no need for secondary conversion , Directly through ActiveX Control , The delay is very low , The disadvantage is that it only supports IE browser .

Option five :RTSP turn WebRTC Play

The browser to webrtc Good support from , Especially in H264 Several mainstream browsers in coding have already supported .webrtc Use srtp Transmit media data , Then we just need to rtp The load data in is passed through webrtc The channel is sent to the browser , The browser side only needs to pass video Just play the tag , at present RTSP turn WebRTC The adaptation of the browser is better , The delay is also relatively low .

原网站

版权声明
本文为[daniulive]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/03/20210322183714267u.html