CN114221941B - Webrtc-to-onvif audio/video code stream conversion method and device - Google Patents

Webrtc-to-onvif audio/video code stream conversion method and device Download PDF

Info

Publication number
CN114221941B
CN114221941B CN202111556301.9A CN202111556301A CN114221941B CN 114221941 B CN114221941 B CN 114221941B CN 202111556301 A CN202111556301 A CN 202111556301A CN 114221941 B CN114221941 B CN 114221941B
Authority
CN
China
Prior art keywords
code stream
protocol
onvif
data
audio
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.)
Active
Application number
CN202111556301.9A
Other languages
Chinese (zh)
Other versions
CN114221941A (en
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.)
Guangzhou Vcmy Technology Co ltd
Original Assignee
Guangzhou Vcmy 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 Guangzhou Vcmy Technology Co ltd filed Critical Guangzhou Vcmy Technology Co ltd
Priority to CN202111556301.9A priority Critical patent/CN114221941B/en
Publication of CN114221941A publication Critical patent/CN114221941A/en
Application granted granted Critical
Publication of CN114221941B publication Critical patent/CN114221941B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

The application provides a method and a device for converting webtc to onvif audio and video code streams, wherein the method comprises the following steps: acquiring a webtc live code stream, analyzing code stream data based on a webtc protocol, and acquiring a target address IP and SDP data; encapsulating the extracted SDP data according to the onvif protocol again, and then outputting a live code stream based on the onvif protocol to a target address IP; the onvif equipment receives a live code stream based on the onvif protocol, and multicasts the live code stream into RTMP audio and video for playing. The device executes the method, and specifically comprises the following steps: a data inlet is connected with and acquires a live code stream based on a webrtc protocol; the protocol analysis unit is used for analyzing the obtained live code stream based on the webrtc protocol to obtain a target address IP and SDP data; the encapsulation unit encapsulates SDP data based on the onvif protocol, adds an HTTP protocol header to the encapsulated data and generates a live code stream based on the onvif protocol; and outputting the live code stream based on the onvif protocol by a data outlet.

Description

Webrtc-to-onvif audio/video code stream conversion method and device
Technical Field
The application belongs to the technical field of networks, and particularly relates to a method and a device for converting webtc to onvif audio and video code streams.
Background
Currently, the main live broadcast technology is stable and reliable transmission based on the webtc protocol, supports communication with traditional GB28181 protocol equipment, but fails to realize communication with onvif protocol equipment, and code stream conversion from the webtc to the onvif provides possibility of linkage between different equipment. In fact, the data layer of the webtc protocol or the onvif protocol takes SDP (Session Description Protocol ) as a main data format, that is, the data layer is communicated with the data layer, so that a communication basis is provided for the webtc device and the onvif device.
Disclosure of Invention
The application provides a method and a device for converting webtc to onvif audio and video code streams, which meet the requirements of code stream transmission and conversion and have the following specific technical contents:
the Webrtc-onvif audio and video code stream conversion method comprises the following steps:
step 1, acquiring a webrtc live code stream, analyzing code stream data based on a webrtc protocol, and acquiring a target address IP and SDP data;
step 2, the extracted SDP data is encapsulated again according to the onvif protocol, and then a live code stream based on the onvif protocol is output to a target address IP;
and 3, the onvif equipment receives a live code stream based on the onvif protocol to form RTMP audio and video for playing.
Specifically, in step 1, a video source address and an SDP data length are extracted when analyzing the webtc protocol-based code stream data; in step 2, when the SDP data is repackaged, the Content-Type is designated as application/dp in the packet header of the DESCRIBE part, the Content-Base is the video source address, and the Content-Length is the SDP data Length; and packaging the DESCRIBE packet according to the HTTP packet format, and converting the HTTP packet into an HTTP audio/video stream.
The webtc-onvif audio/video code stream conversion device of the application comprises a processor, a memory and a code stream conversion program stored on the memory and capable of being operated by the processor, wherein the processor executes the following steps when executing the code stream conversion program:
step 1, acquiring a webrtc live code stream, analyzing code stream data based on a webrtc protocol, and acquiring a target address IP and SDP data;
and step 2, packaging the extracted SDP data again according to the onvif protocol, and then outputting a live code stream based on the onvif protocol to the target address IP.
The webtc-onvif audio/video code stream conversion device of the application comprises:
a data inlet is connected with and acquires a live code stream based on a webrtc protocol;
the protocol analysis unit is used for analyzing the obtained live code stream based on the webrtc protocol to obtain a target address IP and SDP data;
the encapsulation unit encapsulates the SDP data based on the onvif protocol, adds an HTTP protocol header to the encapsulated data and generates a live code stream based on the onvif protocol;
and outputting the live code stream based on the onvif protocol by a data outlet.
The beneficial effects of the application are as follows: the method meets the conversion requirement of live streaming to the onvif protocol output stream based on the webrtc protocol, realizes linkage communication between the webrtc equipment and the onvif equipment, overcomes the defect that two protocol code streams cannot be communicated in the prior art, and has better technical property and practicability.
Drawings
Fig. 1 is a code stream conversion flowchart of the present application.
Fig. 2 is a second code stream conversion flow chart of the present application.
Detailed Description
The scheme of the application is further described as follows:
the code stream data based on the onvif protocol is encapsulated in RTSP format;
the control layer of Onvif is divided into several stages of DESCRIBE/SETUP/PLAY/TEARDW, for the data layer, SDP (Session Description Protocol ) is used as the main data format, and the data layer of webtc is developed based on SDP, so that the control layer instruction is not said that the Onvif protocol data is communicated with the webtc protocol data, thus providing communication possibility for application supporting the webtc protocol and equipment supporting the Onvif protocol, in particular providing possibility for linkage of different protocol equipment.
Referring to fig. 1 and 2, the method for converting webtc to onvif audio/video code stream according to the present application comprises the following steps:
step 1, acquiring a webrtc live code stream, analyzing code stream data based on a webrtc protocol, and acquiring a target address IP, SDP data, a video source address and SDP data length; the parsing process removes the signaling data and only retains the audio and video data in SDP format;
step 2, the extracted SDP data is encapsulated again according to the onvif protocol, wherein the method comprises the following steps: the method comprises the steps of designating Content-Type as application/dp in a packet header of a DESCRIBE part, designating Content-Base as a video source address, and designating Content-Length as SDP data Length; packaging the DESCRIBE packet according to the HTTP packet format, and converting the HTTP packet into an HTTP audio/video stream; finally, outputting a live code stream based on an onvif protocol to a target address IP;
and 3, receiving the live code stream based on the onvif protocol by the onvif equipment, multicasting the live code stream into RTMP audio and video for playing.
When the method is applied, the method is laid out on a conversion device, a data inlet of the conversion device acquires a live code stream based on a webrtc protocol, and a data outlet of the conversion device outputs the live code stream based on an onvif protocol; the live code stream generated by the Webrtc application is converted by the Webrtc server to the conversion device, and then output to the onvif server by the onvif client.
The application also claims a webtc-onvif audio/video code stream conversion device for implementing the method, which comprises a processor, a memory and a code stream conversion program stored on the memory and capable of being run by the processor, and is characterized in that the processor executes the following steps when executing the code stream conversion program:
step 1, acquiring a webrtc live code stream, analyzing code stream data based on a webrtc protocol, and acquiring a target address IP, SDP data, a video source address and SDP data length; the parsing process removes the signaling data and only retains the audio and video data in SDP format;
and step 2, packaging the extracted SDP data according to the onvif protocol again, wherein the step comprises the following steps: the method comprises the steps of designating Content-Type as application/dp in a packet header of a DESCRIBE part, designating Content-Base as a video source address, and designating Content-Length as SDP data Length; packaging the DESCRIBE packet according to the HTTP packet format, and converting the HTTP packet into an HTTP audio/video stream; and finally outputting the live code stream based on the onvif protocol to the target address IP.
The application also claims a further webtc-onvif audio-video code stream conversion device for implementing the method, which comprises:
a data inlet is connected with and acquires a live code stream based on a webrtc protocol;
the protocol analysis unit is used for analyzing the obtained live code stream based on the webrtc protocol to obtain a target address IP and SDP data;
the encapsulation unit encapsulates the SDP data based on the onvif protocol, adds an HTTP protocol header to the encapsulated data and generates a live code stream based on the onvif protocol;
and outputting the live code stream based on the onvif protocol by a data outlet.
The webtc protocol core is RTMP protocol, the onvif protocol core is RTSP protocol, the webtc is converted into onvif, the SDP data is re-packaged according to the RTSP format, the SDP data is packaged in a DESCRIBE part like HTTP back package, and then the data is sent according to the data, so that the RTMP stream is sent to the conversion device by the webtc, and the RTMP stream is converted into RTSP by the conversion device and sent to the onvif device.
The method meets the conversion requirement of live streaming to the onvif protocol output stream based on the webrtc protocol, realizes linkage communication between the webrtc equipment and the onvif equipment, overcomes the defect that two protocol code streams cannot be communicated in the prior art, and has better technical property and practicability.
The above-mentioned preferred embodiments should be regarded as illustrative examples of embodiments of the present application, and all such technical deductions, substitutions, improvements made on the basis of the same, similar or similar embodiments of the present application should be regarded as the protection scope of the present patent.

Claims (8)

1. A webtc-to-onvif audio-video code stream conversion method, comprising the steps of:
step 1, acquiring a webrtc live code stream, analyzing code stream data based on a webrtc protocol, and acquiring a target address IP and SDP data;
step 2, the extracted SDP data is encapsulated again according to the onvif protocol, and then a live code stream based on the onvif protocol is output to a target address IP;
and 3, receiving the live code stream based on the onvif protocol by the onvif equipment, multicasting the live code stream into RTMP audio and video for playing.
2. The method for converting a webtc to an onvif audio video code stream according to claim 1, wherein:
in step 1, extracting a video source address and an SDP data length when analyzing code stream data based on a webtc protocol;
in step 2, when the SDP data is repackaged, the Content-Type is designated as application/dp in the packet header of the DESCRIBE part, the Content-Base is the video source address, and the Content-Length is the SDP data Length;
and packaging the DESCRIBE packet according to the HTTP packet format, and converting the HTTP packet into an HTTP audio/video stream.
3. The method for converting a webtc to an onvif audio video code stream according to claim 1, wherein: in step 1, the parsing process removes the signaling data while retaining only the audio-video data in SDP format.
4. The method for converting a webtc to an onvif audio video code stream according to claim 1, wherein: the code stream based on the webtc protocol is encapsulated in RTMP format, and the code stream based on the onvif protocol is encapsulated in RTSP format.
5. The method for converting a webtc to an onvif audio video code stream according to claim 1, wherein: the method comprises the steps that the method is arranged on a conversion device, a data inlet of the conversion device obtains a live code stream based on a webrtc protocol, and a data outlet of the conversion device outputs the live code stream based on an onvif protocol;
the live code stream generated by the Webrtc application is converted by the Webrtc server to the conversion device, and then output to the onvif server by the onvif client.
6. A webtc-onvif audio-video code stream conversion device, comprising a processor, a memory and a code stream conversion program stored in the memory and capable of being operated by the processor, wherein the processor executes the following steps when executing the code stream conversion program:
step 1, acquiring a webrtc live code stream, analyzing code stream data based on a webrtc protocol, and acquiring a target address IP and SDP data;
and step 2, packaging the extracted SDP data again according to the onvif protocol, and then outputting a live code stream based on the onvif protocol to the target address IP.
7. The apparatus of claim 6, wherein the processor when executing the stream conversion program further comprises the steps of:
in step 1, extracting a video source address and an SDP data length when analyzing code stream data based on a webtc protocol;
in step 2, when the SDP data is repackaged, the Content-Type is designated as application/dp in the packet header of the DESCRIBE part, the Content-Base is the video source address, and the Content-Length is the SDP data Length; and packaging the DESCRIBE packet according to the HTTP packet format, and converting the HTTP packet into an HTTP audio/video stream.
8. A webtc-to-onvif audio/video code stream conversion device, comprising:
a data inlet is connected with and acquires a live code stream based on a webrtc protocol;
the protocol analysis unit is used for analyzing the obtained live code stream based on the webrtc protocol to obtain a target address IP and SDP data;
the encapsulation unit encapsulates the SDP data based on the onvif protocol, adds an HTTP protocol header to the encapsulated data and generates a live code stream based on the onvif protocol;
and outputting the live code stream based on the onvif protocol by a data outlet.
CN202111556301.9A 2021-12-17 2021-12-17 Webrtc-to-onvif audio/video code stream conversion method and device Active CN114221941B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111556301.9A CN114221941B (en) 2021-12-17 2021-12-17 Webrtc-to-onvif audio/video code stream conversion method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111556301.9A CN114221941B (en) 2021-12-17 2021-12-17 Webrtc-to-onvif audio/video code stream conversion method and device

Publications (2)

Publication Number Publication Date
CN114221941A CN114221941A (en) 2022-03-22
CN114221941B true CN114221941B (en) 2023-10-13

Family

ID=80704055

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111556301.9A Active CN114221941B (en) 2021-12-17 2021-12-17 Webrtc-to-onvif audio/video code stream conversion method and device

Country Status (1)

Country Link
CN (1) CN114221941B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101540947A (en) * 2009-04-03 2009-09-23 中兴通讯股份有限公司 Analog live broadcasting method of mobile streaming media and content switching method thereof
KR20100087274A (en) * 2010-07-16 2010-08-04 주식회사 씬멀티미디어 Optimized trnasmitting method between media player and service using protocol converting for android mobile terminal
CN102263959A (en) * 2011-08-08 2011-11-30 中国电信股份有限公司 Direct broadcast transfer method and system
CN107911362A (en) * 2017-11-14 2018-04-13 杭州万为科技有限责任公司 The system and method for the internet video gateway security access of lightweight
CN111935463A (en) * 2020-10-16 2020-11-13 融智通科技(北京)股份有限公司 Method for viewing real-time monitoring video through webpage without control piece and low delay
CN111953925A (en) * 2020-08-21 2020-11-17 浙江华创视讯科技有限公司 Media stream processing method, device and system
CN113556579A (en) * 2021-06-07 2021-10-26 武汉众智数字技术有限公司 Method for playing security real-time video without web plug-in based on HTML5

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016076773A1 (en) * 2014-11-12 2016-05-19 Telefonaktiebolaget L M Ericsson (Publ) Methods and devices for negotiating session descriptor parameters
US11277492B2 (en) * 2019-04-17 2022-03-15 Sure Universal Ltd. Seamless connectivity to smart devices, cameras and home care devices over WiFi networks and cloud

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101540947A (en) * 2009-04-03 2009-09-23 中兴通讯股份有限公司 Analog live broadcasting method of mobile streaming media and content switching method thereof
KR20100087274A (en) * 2010-07-16 2010-08-04 주식회사 씬멀티미디어 Optimized trnasmitting method between media player and service using protocol converting for android mobile terminal
CN102263959A (en) * 2011-08-08 2011-11-30 中国电信股份有限公司 Direct broadcast transfer method and system
CN107911362A (en) * 2017-11-14 2018-04-13 杭州万为科技有限责任公司 The system and method for the internet video gateway security access of lightweight
CN111953925A (en) * 2020-08-21 2020-11-17 浙江华创视讯科技有限公司 Media stream processing method, device and system
CN111935463A (en) * 2020-10-16 2020-11-13 融智通科技(北京)股份有限公司 Method for viewing real-time monitoring video through webpage without control piece and low delay
CN113556579A (en) * 2021-06-07 2021-10-26 武汉众智数字技术有限公司 Method for playing security real-time video without web plug-in based on HTML5

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于SIP协议的实时语音通信系统的研究与开发";罗丛优;《中国优秀硕士学位论文全文数据库(电子期刊)》(第第2期期);全文 *

Also Published As

Publication number Publication date
CN114221941A (en) 2022-03-22

Similar Documents

Publication Publication Date Title
CN102118428B (en) Method and system for playing streaming media
CN100568971C (en) The transmission code stream of a kind of MPEG-4 is to the real time conversion method of internet stream media alliance stream
CN108243173B (en) A kind of RTMP video pushing method and device based on view networking
TWI435568B (en) Method and system for multimedia audio video transfer
WO2008061416A1 (en) A method and a system for supporting media data of various coding formats
CN108881927A (en) A kind of video data synthetic method and device
CN110166433B (en) Method and system for acquiring video data
CN105007465B (en) Ciphertext H264 net casts and program request platform based on live555 frames and ffmpeg libraries
CN109194982A (en) A kind of method and apparatus for transmitting big file stream
CN109302576A (en) Meeting treating method and apparatus
KR20130069581A (en) Apparatus and method for transmitting and receiving contents based on internet
KR20130069582A (en) Apparatus and method for transmitting and receiving contents based on internet
Yang et al. Implementation of HTTP live streaming for an IP camera using an open source multimedia converter
CN108632679B (en) A kind of method that multi-medium data transmits and a kind of view networked terminals
CN110536178B (en) Live broadcast control method and system
CN111711870B (en) Real-time streaming transmission method across network boundary
CN111629277B (en) Video data transmission method, device and computer readable storage medium
CN114221941B (en) Webrtc-to-onvif audio/video code stream conversion method and device
KR20130084972A (en) Apparatus and method for transmitting and receiving contents based on internet
CN114339146B (en) Audio and video monitoring method and device, electronic equipment and computer readable storage medium
CN108965914A (en) A kind of video data handling procedure and device based on view networking
CN107005745B (en) Method and apparatus for encapsulating a stream of audiovisual content
KR20160036924A (en) System for device independent live streaming
EP4123967B1 (en) Method and apparatus for processing multicast signal
CN110475089A (en) A kind of processing method of multi-medium data and view networked terminals

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
GR01 Patent grant
GR01 Patent grant