CN114268612A - Websocket-based webpage real-time voice communication method - Google Patents

Websocket-based webpage real-time voice communication method Download PDF

Info

Publication number
CN114268612A
CN114268612A CN202111580038.7A CN202111580038A CN114268612A CN 114268612 A CN114268612 A CN 114268612A CN 202111580038 A CN202111580038 A CN 202111580038A CN 114268612 A CN114268612 A CN 114268612A
Authority
CN
China
Prior art keywords
voice
server
webpage
websocket
streaming media
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111580038.7A
Other languages
Chinese (zh)
Inventor
郭海涛
黄志新
黄晶
王涵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Fufu Information Technology Co Ltd
Original Assignee
China Telecom Fufu Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Fufu Information Technology Co Ltd filed Critical China Telecom Fufu Information Technology Co Ltd
Priority to CN202111580038.7A priority Critical patent/CN114268612A/en
Publication of CN114268612A publication Critical patent/CN114268612A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Telephonic Communication Services (AREA)

Abstract

The invention relates to a webpage real-time voice communication method based on WebSocket, which is applied to an intelligent video monitoring system, wherein the intelligent video monitoring system comprises a webpage end, a server end, a streaming media end and video equipment, and is characterized in that: the webpage end and the server end are connected through WebSocket communication, the webpage end collects voice in real time and continuously pushes the obtained voice stream to the server in real time, the server obtains the voice stream transcoding to generate a standard pcma audio stream and pushes the standard pcma audio stream to the streaming media end, the streaming media end pushes the standard pcma audio stream to the video equipment to play the voice in real time, the technical scheme is adopted to collect the voice based on the browser, the WebSocket is established through the browser to be connected with the server in real time and push the voice communication, downloading of a client or a plug-in is not needed, various mainstream browsers are supported, and real-time voice communication can be carried out with the video monitoring equipment at any time and any place.

Description

Websocket-based webpage real-time voice communication method
Technical Field
The invention relates to the field of intelligent video monitoring, in particular to a webpage real-time voice communication method based on WebSocket.
Background
With the development of WIFI and the Internet, the coverage rate of the WIFI and the Internet is wider and wider, and great convenience is brought to people due to the sharing characteristic of the Internet. The intelligent video monitoring system is deeply applied to various industries, such as public security, park building, cultural and educational sanitation, traffic and the like. In various applications, a matched back-end management system is provided, and each monitoring picture can be checked in real time, real-time voice communication with equipment is realized, and the like. At present, most of real-time voice functions of a matched monitoring system need to download a PC client or a plug-in, a mobile phone end downloads an APP, and real-time voice acquisition and communication are carried out by utilizing native voice acquisition of the client and tcp connection.
With the development and upgrade of various browser manufacturers at present, the functions and permissions of browsers are getting larger and larger, and browsers are installed in computers and mobile devices. If the real-time voice communication can be carried out through the web interface, the communication can be carried out at any time and any place without downloading a client or a plug-in. In patent CN201710602668.7, "a method for real-time voice communication of web page based on two-dimension code scanning", there is a method for realizing real-time voice communication of web page, the invention mainly generates two-dimension code of special address, mobile phone scans into specific page address, and real-time voice collection and communication are performed based on WebRCT. Since the WebRTC protocol is not very good in browser compatibility, only the high-version chrome browser supports the WebRTC protocol at present, which is also the greatest limitation of the present invention. WebRTC mainly applies to native APP or PC client to perform functions such as real-time video interaction, and the like, and opens the bottom API function, thereby performing secondary development. And at the browser end, only interface calls of an upper layer are provided.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides the WebSocket-based webpage real-time voice communication method which collects voice based on the browser, establishes the WebSocket through the browser to be connected with the server in real time and push voice communication, does not need to download clients or plug-ins, supports various mainstream browsers, can carry out real-time voice communication with video monitoring equipment at any time and any place, and is convenient for management and maintenance of managers or users to a great extent.
The invention relates to a webpage real-time voice communication method based on WebSocket, which adopts the following technical scheme: the intelligent video monitoring system is applied to an intelligent video monitoring system, the intelligent video monitoring system comprises a webpage end, a server end, a streaming media end and video equipment, the webpage end and the server end are in communication connection through WebSocket, the webpage end collects voice in real time and pushes the obtained voice stream to the server in real time, the server obtains voice stream transcoding to generate a standard pcma audio stream and pushes the standard pcma audio stream to the streaming media end, and the streaming media end pushes the standard pcma audio stream to the video equipment to play the voice in real time.
Further, it comprises the following steps:
s1, the user initiates a voice communication request on the video monitoring page of the webpage end;
s2, the server side obtains the information of the current video equipment according to the coding of the video equipment, and establishes WebSocket real-time connection between the webpage side and the server side, TCP connection between the server and the streaming media side and connection between the streaming media side and the video equipment;
s3, the webpage side starts to acquire voice authority, configures acquisition parameters, acquires user voice to generate a voice stream, and pushes the voice stream to the server side in real time through WebSocket;
s4, after receiving the voice stream, the server end converts the voice stream into a standard pcma audio stream, and sends an RTP packet and the standard pcma audio stream to the streaming media end through TCP connection;
s5, after receiving the standard pcma audio stream, the streaming media end pushes the audio stream to the video equipment for playing;
and S6, after the voice of the user is finished, requesting to close the voice communication at the webpage end, terminating the voice acquisition at the webpage end, disconnecting the WebSocket connection with the server end, disconnecting the tcp connection with the streaming media end by the server, and disconnecting the streaming media from the video equipment.
Compared with the prior art, the invention has the beneficial effects that: the method has the advantages that the browser is used for collecting voice, the WebSocket is established through the browser to be connected with the server in real time to push voice communication, a client or a plug-in is not required to be downloaded, various mainstream browsers are supported, real-time voice communication can be carried out with video monitoring equipment at any time and any place, management and maintenance of managers or users are facilitated to a great extent, the method can be applied to scenes in various intelligent video monitoring fields such as security, traffic, and defense to carry out convenient real-time voice communication, the users do not need to carry out real-time voice communication with the monitoring equipment on a specific computer or mobile phone with the client or the plug-in, and only need to access on a web page, so that the voice shouting communication function can be carried out; the mobile terminal can access the H5 interface at a browser, a public number and the like to carry out real-time voice communication.
Drawings
The accompanying drawings, which are described herein to provide a further understanding of the application, are included in the following description:
FIG. 1 is a flow chart of an embodiment of the present invention.
Detailed Description
Referring to fig. 1, the embodiment of the web real-time voice communication method based on the WebSocket is applied to an intelligent video monitoring system, the intelligent video monitoring system includes a web end, a server end, a streaming media end and a video device, the web end and the server end are connected through the WebSocket in a communication manner, the web end collects voice in real time, the obtained voice stream is pushed to the server in real time, the server obtains the voice stream transcoding to generate a standard pcma audio stream, the standard pcma audio stream is pushed to the streaming media end, and the streaming media end pushes the standard pcma audio stream to the video device to play the voice in real time.
Which comprises the following steps:
s1, the user initiates a voice communication request on the video monitoring page of the webpage end;
s2, the server side obtains the information of the current video equipment according to the coding of the video equipment, and establishes WebSocket real-time connection between the webpage side and the server side, TCP connection between the server and the streaming media side and connection between the streaming media side and the video equipment;
s3, the webpage side starts to acquire voice authority, configures acquisition parameters, acquires user voice to generate a voice stream, and pushes the voice stream to the server side in real time through WebSocket;
s4, after receiving the voice stream, the server end converts the voice stream into a standard pcma audio stream, and sends an RTP packet and the standard pcma audio stream to the streaming media end through TCP connection;
s5, after receiving the standard pcma audio stream, the streaming media end pushes the audio stream to the video equipment for playing;
and S6, after the voice of the user is finished, requesting to close the voice communication at the webpage end, terminating the voice acquisition at the webpage end, disconnecting the WebSocket connection with the server end, disconnecting the tcp connection with the streaming media end by the server, and disconnecting the streaming media from the video equipment.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (2)

1. A webpage real-time voice communication method based on WebSocket is applied to an intelligent video monitoring system, the intelligent video monitoring system comprises a webpage end, a server end, a streaming media end and video equipment, and is characterized in that: the webpage end and the server end are in communication connection through WebSocket, the webpage end collects voice in real time and pushes the obtained voice stream to the server in real time, the server obtains the voice stream transcoding to generate a standard pcma audio stream and pushes the standard pcma audio stream to the streaming media end, and the streaming media end pushes the standard pcma audio stream to the video equipment to play the voice in real time.
2. The WebSocket-based webpage real-time voice communication method as claimed in claim 1, wherein the WebSocket-based webpage real-time voice communication method comprises the following steps: which comprises the following steps:
s1, the user initiates a voice communication request on the video monitoring page of the webpage end;
s2, the server side obtains the information of the current video equipment according to the coding of the video equipment, and establishes WebSocket real-time connection between the webpage side and the server side, TCP connection between the server and the streaming media side and connection between the streaming media side and the video equipment;
s3, the webpage side starts to acquire voice authority, configures acquisition parameters, acquires user voice to generate a voice stream, and pushes the voice stream to the server side in real time through WebSocket;
s4, after receiving the voice stream, the server end converts the voice stream into a standard pcma audio stream, and sends an RTP packet and the standard pcma audio stream to the streaming media end through TCP connection;
s5, after receiving the standard pcma audio stream, the streaming media end pushes the audio stream to the video equipment for playing;
and S6, after the voice of the user is finished, requesting to close the voice communication at the webpage end, terminating the voice acquisition at the webpage end, disconnecting the WebSocket connection with the server end, disconnecting the tcp connection with the streaming media end by the server, and disconnecting the streaming media from the video equipment.
CN202111580038.7A 2021-12-22 2021-12-22 Websocket-based webpage real-time voice communication method Pending CN114268612A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111580038.7A CN114268612A (en) 2021-12-22 2021-12-22 Websocket-based webpage real-time voice communication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111580038.7A CN114268612A (en) 2021-12-22 2021-12-22 Websocket-based webpage real-time voice communication method

Publications (1)

Publication Number Publication Date
CN114268612A true CN114268612A (en) 2022-04-01

Family

ID=80828757

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111580038.7A Pending CN114268612A (en) 2021-12-22 2021-12-22 Websocket-based webpage real-time voice communication method

Country Status (1)

Country Link
CN (1) CN114268612A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105049912A (en) * 2015-08-07 2015-11-11 虎扑(上海)文化传播股份有限公司 Processing method of video signals and electronic equipment
CN106506632A (en) * 2016-10-27 2017-03-15 上海幻电信息科技有限公司 A kind of audio frequency and video live broadcasting method based on HTML5 browsers
US20170289214A1 (en) * 2016-04-04 2017-10-05 Hanwha Techwin Co., Ltd. Method and apparatus for playing media stream on web browser
CN107995187A (en) * 2017-11-30 2018-05-04 上海哔哩哔哩科技有限公司 Video main broadcaster, live broadcasting method, terminal and system based on HTML5 browsers
CN111432214A (en) * 2020-04-02 2020-07-17 深圳亿维锐创科技股份有限公司 H5 live video-based self-adaptive dynamic transcoding technology
CN111787399A (en) * 2020-07-23 2020-10-16 成都云盯科技有限公司 Video playing method, device and system
CN112073423A (en) * 2020-09-15 2020-12-11 杭州二更网络科技有限公司 Browser plug-flow method and system based on WebRTC
CN112583638A (en) * 2020-11-25 2021-03-30 新浪网技术(中国)有限公司 Websocket-based voice alarm method and system
CN112866345A (en) * 2020-12-31 2021-05-28 珠海派诺科技股份有限公司 Websocket-based streaming media low-delay communication implementation method, electronic device and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105049912A (en) * 2015-08-07 2015-11-11 虎扑(上海)文化传播股份有限公司 Processing method of video signals and electronic equipment
US20170289214A1 (en) * 2016-04-04 2017-10-05 Hanwha Techwin Co., Ltd. Method and apparatus for playing media stream on web browser
CN106506632A (en) * 2016-10-27 2017-03-15 上海幻电信息科技有限公司 A kind of audio frequency and video live broadcasting method based on HTML5 browsers
CN107995187A (en) * 2017-11-30 2018-05-04 上海哔哩哔哩科技有限公司 Video main broadcaster, live broadcasting method, terminal and system based on HTML5 browsers
CN111432214A (en) * 2020-04-02 2020-07-17 深圳亿维锐创科技股份有限公司 H5 live video-based self-adaptive dynamic transcoding technology
CN111787399A (en) * 2020-07-23 2020-10-16 成都云盯科技有限公司 Video playing method, device and system
CN112073423A (en) * 2020-09-15 2020-12-11 杭州二更网络科技有限公司 Browser plug-flow method and system based on WebRTC
CN112583638A (en) * 2020-11-25 2021-03-30 新浪网技术(中国)有限公司 Websocket-based voice alarm method and system
CN112866345A (en) * 2020-12-31 2021-05-28 珠海派诺科技股份有限公司 Websocket-based streaming media low-delay communication implementation method, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN102025759B (en) Method and system for providing user generated content (UGC) sharing businesses in real time
EP3110098A1 (en) Mobile terminal and method for achieving sharing of streaming media file of cloud based on dlna
CN104869438A (en) Live video cloud release system based on mobile terminal and cloud release method
CN104980482A (en) File transmitting method and device, file receiving method and device
CN103533460A (en) Method, device, terminal and system for sharing television service
JP2022538953A (en) Multimedia data processing method, apparatus, electronic equipment and computer program
CN101232609A (en) Method for implementing mobile phone video true time monitoring
CN104683734A (en) Video surveillance content adaptation method, system, central server and device
CN104113570A (en) Android terminal desktop direct access method and system through browser or software program
CN106161351A (en) Method, device and the CDN server that streaming media service is merged with file download
CN101471855B (en) Communication equipment and application method and system thereof
CN101742265A (en) Video monitoring method, fixed network video monitoring service platform and mobile terminal
KR101523204B1 (en) System and method for providing advertisement
CN103596019A (en) A method and a system used for displaying IPTV content across screens
CN105120207A (en) Sweeping robot video monitoring method and server
KR20060069058A (en) System for mediating convergence services of communication and broadcasting using non-communicative appliance
CN103516707B (en) The implementation method of control, system and terminal is accessed between DLNA device
CN109788072A (en) A method of standard Webrtc client is accessed into existing system
CN101094159B (en) Method for penetrating through private network of media stream
CN106791992B (en) Signal source method for pushing and system
CN103684970A (en) Transmission method and thin terminals for media data streams
CN114268612A (en) Websocket-based webpage real-time voice communication method
CN201928397U (en) Audio-video transmission system based on real time streaming protocol (RTSP) and compatible with various video coding terminals access
CN109100944B (en) IMS-based data acquisition and processing system
CN101384007A (en) Inter-network data transmission method, apparatus and communication device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination