CN115022676B - Video stream pushing method and device, electronic equipment and readable medium - Google Patents

Video stream pushing method and device, electronic equipment and readable medium Download PDF

Info

Publication number
CN115022676B
CN115022676B CN202210339085.0A CN202210339085A CN115022676B CN 115022676 B CN115022676 B CN 115022676B CN 202210339085 A CN202210339085 A CN 202210339085A CN 115022676 B CN115022676 B CN 115022676B
Authority
CN
China
Prior art keywords
video stream
receiving end
identification information
decoding
address
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
CN202210339085.0A
Other languages
Chinese (zh)
Other versions
CN115022676A (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.)
Thundercomm Technology Co ltd
Original Assignee
Thundercomm 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 Thundercomm Technology Co ltd filed Critical Thundercomm Technology Co ltd
Priority to CN202210339085.0A priority Critical patent/CN115022676B/en
Publication of CN115022676A publication Critical patent/CN115022676A/en
Application granted granted Critical
Publication of CN115022676B publication Critical patent/CN115022676B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • 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
    • 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/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4782Web browsing, e.g. WebTV

Abstract

The embodiment of the invention provides a video stream pushing method, a device, electronic equipment and a readable medium, wherein the method comprises the following steps: acquiring a video acquisition request, wherein the video acquisition request records identification information of a receiving end and a video stream address; acquiring an original video stream acquired by video acquisition equipment corresponding to the video stream address; decoding the original video stream to obtain a decoded video stream; pushing the decoded video stream to a receiving end corresponding to the identification information. Therefore, the real-time pushing of the video stream can be completed without additionally arranging a decoding server for decoding and storing the decoded video stream and installing a third-party plug-in on a receiving end, and the data transmission efficiency is high.

Description

Video stream pushing method and device, electronic equipment and readable medium
Technical Field
The present invention relates to the field of video technologies, and in particular, to a method for pushing a video stream, a device for pushing a video stream, an electronic device, and a computer readable medium.
Background
In the prior art, if a user needs to watch a video stream acquired in real time by a video acquisition device such as a camera, a video camera and the like through a browser, a third party plug-in is usually required to be installed on the browser to realize the display of the video stream, which is not very convenient. Or an additional streaming media server is required to be arranged to decode and store the video stream of the video acquisition device, and then the browser acquires the stored decoded video stream from the streaming media server, so that the streaming media server is required to be additionally maintained, and the deployment is complicated.
Disclosure of Invention
The embodiment of the invention provides a pushing method and device of video streams, electronic equipment and a computer readable storage medium, which are used for solving the problem that a browser is complicated to acquire real-time video streams.
The embodiment of the invention provides a pushing method of a video stream, which comprises the following steps:
acquiring a video acquisition request, wherein the video acquisition request records identification information of a receiving end and a video stream address;
acquiring an original video stream acquired by video acquisition equipment corresponding to the video stream address;
decoding the original video stream to obtain a decoded video stream;
pushing the decoded video stream to a receiving end corresponding to the identification information.
Optionally, the method further comprises:
and recording the corresponding relation between the identification information of the receiving end and the video stream address in a preset first recording table.
Optionally, before the step of acquiring the original video stream from the video acquisition device corresponding to the video stream address, the method further includes:
and determining a video stream address recorded by the video acquisition request in the first record table.
Optionally, the method further comprises:
creating a session object for the video acquisition request;
and recording the corresponding relation between the identification information of the receiving end and the session object in a preset second record table.
Optionally, the step of pushing the decoded video stream to the receiving end corresponding to the identification information includes:
determining a session object corresponding to the identification information based on the second record table;
pushing the decoded video stream to the receiving end through the interface of the session object corresponding to the identification information.
Optionally, the method further comprises:
and deleting the corresponding relation between the receiving end and the video stream address in the first record table based on the detection that the receiving end stops acquiring the decoded video stream.
Optionally, the method further comprises:
in the process of decoding the original video stream, detecting whether the first record table contains identification information corresponding to a video stream address of the original video stream or not;
and stopping decoding the original video stream based on the identification information corresponding to the video stream address of the original video stream not included in the first record table.
The embodiment of the invention provides a pushing device for video streams, which comprises the following steps:
the request acquisition module is used for acquiring a video acquisition request, wherein the video acquisition request records identification information of a receiving end and a video stream address;
the video stream acquisition module is used for acquiring an original video stream acquired by video acquisition equipment corresponding to the video stream address;
the decoding module is used for decoding the original video stream to obtain a decoded video stream;
a pushing module, configured to push the decoded video stream to a receiving end corresponding to the identification information
Optionally, the apparatus further comprises:
and the first recording module is used for recording the corresponding relation between the identification information of the receiving end and the video stream address in a preset first recording table.
Optionally, the apparatus further comprises:
and the first searching module is used for determining a video stream address recorded by the video acquisition request in the first recording table.
Optionally, the apparatus further comprises:
a session creation module for creating a session object for the video acquisition request;
and the second recording module is used for recording the corresponding relation between the identification information of the receiving end and the session object in a preset second recording table.
Optionally, the first pushing module includes:
a session searching sub-module, configured to determine a session object corresponding to the identification information based on the second record table;
and the first pushing sub-module is used for pushing the decoded video stream to the receiving end through the interface of the session object corresponding to the identification information.
Optionally, the apparatus further comprises:
and the deleting module is used for deleting the corresponding relation between the receiving end and the video stream address in the first record table based on the fact that the receiving end stops acquiring the decoded video stream.
Optionally, the apparatus further comprises:
the detection module is used for detecting whether the first record table contains identification information corresponding to a video stream address of the original video stream or not in the process of decoding the original video stream;
and the stopping module is used for stopping decoding the original video stream based on the identification information corresponding to the video stream address of the original video stream not included in the first record table.
The embodiment of the invention also discloses electronic equipment, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.
Embodiments of the invention also disclose one or more computer-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform the methods described in the embodiments of the invention.
The embodiment of the invention has the following advantages:
according to the video stream pushing method, a video acquisition request is acquired, and the video acquisition request records identification information of a receiving end and a video stream address; acquiring an original video stream acquired by video acquisition equipment corresponding to the video stream address; decoding the original video stream to obtain a decoded video stream; pushing the decoded video stream to a receiving end corresponding to the identification information. Therefore, the real-time pushing of the video stream can be completed without additionally arranging a decoding server for decoding and storing the decoded video stream and installing a third-party plug-in on a receiving end, and the data transmission efficiency is high.
Drawings
Fig. 1 is a flowchart of steps of a method for pushing a video stream according to an embodiment of the present invention;
fig. 2 is a flowchart of steps of a method for pushing a video stream according to an embodiment of the present invention;
fig. 3 is a flow chart of a video stream pushing method provided in an embodiment of the present invention;
fig. 4 is a block diagram of a video stream pushing device according to an embodiment of the present invention;
FIG. 5 is a block diagram of an electronic device provided in an embodiment of the invention;
fig. 6 is a schematic diagram of a computer readable medium provided in an embodiment of the invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
Aiming at the situation that the implementation of video streams acquired in real time by viewing video acquisition equipment at a browser is complex, the embodiment of the invention can push the decoded video streams to a receiving end in real time based on identification information while decoding the video by improving a pushing flow, does not need to additionally arrange a server for storing video stream data at the rear end and install a third-party plug-in at the browser, can enable a user to view the real-time video streams in the browser, and has low maintenance cost and convenient use for the user.
Referring to fig. 1, a step flow chart of a video stream pushing method provided in an embodiment of the present invention may specifically include the following steps:
step 101, acquiring a video acquisition request, wherein the video acquisition request records identification information of a receiving end and a video stream address;
specifically, a back end in communication with at least one client may be provided, which may be configured to push the video stream to the client so that the client may view the video stream. In a specific implementation, the backend may include a webSocket server, a decoder, and a plug-flow end. The webSocket server can be used for communicating with the client and processing the request sent by the client. The decoding end can be used for decoding the video stream, and the pushing end can be used for pushing the video stream to the client.
When a client wants to view a video stream acquired by a video acquisition device in real time, the client which needs to receive the video stream can be used as a receiving end. Any client side of the receiving end or other client sides can send a video acquisition request to the webSocket server side, so that the webSocket server side can acquire the video acquisition request.
The video acquisition request can be recorded with identification information and a video stream address, so that the webSocket server can determine a video stream which the receiving end wants to view based on the video stream address, and the subsequent back end can determine the receiving end which needs to acquire the video stream based on the identification information when the subsequent back end performs video pushing.
In a specific implementation, a device management page may be provided through a browser. When the user needs real-time video streaming, the user can log in the device management page through the browser. The user may select a video capture device in the device management page that requires previewing. And then the browser can use the js Socket object to create a webSocket client, and the webSocket client sends the video stream address corresponding to the video acquisition equipment to the webSocket server at the back end in a parameter form through a webSocket protocol.
102, acquiring an original video stream acquired by video acquisition equipment corresponding to the video stream address;
after the webSocket server obtains the video stream address from the receiving end, the decoding end in the back end can obtain the original video stream acquired by the video acquisition device corresponding to the video stream address. In particular implementations, the original video stream may be transmitted using a real-time streaming protocol (Real Time Streaming Protocol, RTSP).
Step 103, decoding the original video stream to obtain a decoded video stream;
after the decoding end at the back end obtains the original video stream, the decoding end can decode the original video stream to obtain a decoded video stream, so that the video stream can be suitable for being displayed through a browser.
In a specific implementation, the decoding end can integrate a java v framework, and a ffmpeg video decoding module can be contained in the java v framework and can realize decoding of various formats. The decoding end can finish decoding the original video stream adopting the real-time streaming protocol without depending on a video stream processing server of a third party.
Step 104, pushing the decoded video stream to the receiving end corresponding to the identification information.
After the original video stream is decoded, the decoding end can send the decoded video stream to the pushing end. The pushing end can determine its corresponding receiving end based on the identification information, and push the decoded video stream to the receiving end.
For the receiving end, the receiving end can acquire the real-time video stream of the video acquisition equipment which needs to be checked through one video acquisition request, the method does not need to be like the existing real-time video stream acquisition mode, the decoding of the real-time video stream is required to be firstly requested, then a server for storing the decoded video stream is required to be sent to decode the video stream, the acquisition of the real-time video stream is completed through multiple requests, and additional plug-ins are not required to be installed.
For the back end, a server for storing the decoded video stream is not required to be additionally arranged, the original video stream can be decoded simultaneously in the process of acquiring the original video stream, and after the decoding is finished, the decoded video stream after the decoding is finished can be directly pushed to the receiving end, so that the data transmission efficiency is improved.
According to the pushing method of the video stream, a video acquisition request sent by a receiving end is acquired; the video acquisition request records identification information and a video stream address; acquiring an original video stream from video acquisition equipment corresponding to the video stream address; decoding the original video stream to obtain a decoded video stream; pushing the decoded video stream to a receiving end corresponding to the identification information. Therefore, the real-time pushing of the video stream can be completed without additionally arranging a decoding server for decoding and storing the decoded video stream and installing a third-party plug-in on a receiving end, and the data transmission efficiency is high.
Referring to fig. 2, a step flow chart of a video stream pushing method provided in an embodiment of the present invention may specifically include the following steps:
step 201, acquiring a video acquisition request, wherein the video acquisition request records identification information of a receiving end and a video stream address;
specifically, a back end in communication with at least one client may be provided, which may be configured to push the video stream to the client so that the client may view the video stream. In a specific implementation, the backend may include a webSocket server, a decoder, and a plug-flow end. The webSocket server can be used for communicating with the client and processing the request sent by the client. The decoding end can be used for decoding the video stream, and the pushing end can be used for pushing the video stream to the client.
When a client wants to view a video stream acquired by a video acquisition device in real time, the client which needs to receive the video stream can be used as a receiving end. Any client side of the receiving end or other client sides can send a video acquisition request to the webSocket server side, so that the webSocket server side can acquire the video acquisition request.
The video acquisition request can be recorded with identification information and a video stream address, so that the webSocket server can determine a video stream which the receiving end wants to view based on the video stream address, and the subsequent back end can determine the receiving end which needs to acquire the video stream based on the identification information when the subsequent back end performs video pushing.
In one embodiment of the invention, the method further comprises:
s11, establishing a session object aiming at the video acquisition request;
specifically, after obtaining the video obtaining request sent by the client, the server of the back end may create a session object for the video obtaining request so as to establish communication with the receiving end, and then may send a decoded video stream based on the session object, so as to complete efficient pushing of the decoded video stream.
S12, recording the corresponding relation between the identification information of the receiving end and the session object in a preset second record table.
In order to facilitate the subsequent transmission of the decoded video stream, the server side of the back end may create a second record table, where the second record table may be used to record the correspondence between the identification information of the receiving end and the session object. The session object corresponding to the receiving end can be rapidly determined through the second record table, and efficient pushing of the decoded video stream is completed based on the session object.
Meanwhile, if the receiving end is disconnected from the back end, the server end of the back end can delete the corresponding relation between the identification information of the receiving end and the session object in the second record table, so that whether the receiving end keeps communication with the back end or not can be determined through the second record table, and whether a user continues to acquire the decoded video stream or not can be determined.
In a specific implementation, a key-value form may be used to record the correspondence between the identification information of the receiving end and the session object. Wherein the key is identification information and the value is a session object. The session object records session information and interface information that needs to be used for transmitting the decoded video stream to the receiving end, so that the transmitting interface of the decoded video stream can be determined through the session object to transmit the decoded video stream to the receiving end.
Step 202, recording a corresponding relation between the identification information of the receiving end and the video stream address in a preset first recording table.
Specifically, the webSocket server of the back end may store the first record table in advance. The first record table may record a correspondence between identification information of the receiving end and an address of the video stream. So that the backend determines the transmission object of the decoded video stream.
In a specific implementation, a key-value form may be used to record a correspondence between identification information of the receiving end and an address of the video stream. Wherein key is video stream address, value is identification information. And the back end can quickly determine all receiving ends of the video stream corresponding to the video stream address to be checked through the first record table.
In one embodiment of the invention, the method further comprises:
s21, deleting the corresponding relation between the receiving end and the video stream address in the first record table based on the fact that the receiving end stops acquiring the decoded video stream.
Specifically, when the user stops viewing the decoded video stream or needs to view the video streams of other video acquisition devices, the receiving end in the browser can stop acquiring the decoded video stream of the current video acquisition device and interrupt the communication connection with the service end of the back end. The browser may then close its created receiving end. Therefore, the server of the back end can detect that the receiving end breaks the communication connection, and the receiving end stops acquiring the decoded video stream.
In this case, the server may delete the correspondence between the receiving end and the video stream address in the first recording table, so as to record that the receiving end no longer acquires the video stream corresponding to the video stream address.
Step 203, determining a video stream address recorded in the video acquisition request in the first record table;
specifically, there may be a case where multiple receiving ends all need to view the same video stream. The decoding end of the back-end may already decode the original video stream at this time without additionally acquiring and decoding the original video stream.
Therefore, before the original video stream is acquired, whether the video stream address recorded by the video acquisition request is contained or not can be queried in the first record table to determine whether other receiving ends have previously requested to acquire the decoded video stream or not, and whether the decoded video stream corresponding to the video stream address exists or not currently, without additionally acquiring the decoded video stream.
Under the condition that the decoded video stream corresponding to the video stream address is stored currently, it can be determined that other receiving ends previously request to acquire the decoded video stream, at this time, the decoding end decodes the original video stream to obtain the decoded video stream, at this time, the decoded video stream obtained by decoding the current decoding end can be directly pushed to the receiving end corresponding to the identification information without additionally requesting the original video stream, and video pushing to the receiving end is completed.
Step 204, obtaining an original video stream from the video acquisition device corresponding to the video stream address;
in the case where there is currently no decoded video stream corresponding to the video stream address, then the original video stream still needs to be acquired and decoded at this time.
Specifically, after the webSocket server obtains the video stream address from the receiving end, the decoding end in the back end may obtain the original video stream from the video acquisition device corresponding to the video stream address. In particular implementations, the original video stream may be transmitted using a real-time streaming protocol (Real Time Streaming Protocol, RTSP).
Step 205, decoding the original video stream to obtain a decoded video stream;
after the decoding end at the back end obtains the original video stream, the decoding end can decode the original video stream to obtain a decoded video stream, so that the video stream can be suitable for being displayed through a browser.
In a specific implementation, the decoding end can integrate a java v framework, and a ffmpeg video decoding module can be contained in the java v framework and can realize decoding of various formats. The decoding end can finish decoding the original video stream adopting the real-time streaming protocol without depending on a video stream processing server of a third party.
In one embodiment of the invention, the method further comprises:
s31, in the process of decoding the original video stream, detecting whether the first record table contains identification information corresponding to a video stream address of the original video stream or not;
specifically, during the process of decoding the original video stream, the back end may detect in real time whether the first record table includes the identification information corresponding to the video stream address of the original video stream, so as to determine whether the current receiving end remains connected to the back end, that is, whether the receiving end still needs to acquire the decoded video stream.
In a specific implementation, the decoding end may detect, when an original video stream of a preset number of frames is obtained, whether the first record table includes identification information corresponding to a video stream address of the original video stream. Wherein, the preset number can be 1, 3, 5, 10, 50, 100, etc., which is not limited by the present invention.
S32, stopping decoding the original video stream based on the identification information corresponding to the video stream address of the original video stream not included in the first record table.
If the first record table does not contain the identification information corresponding to the video stream address of the original video stream, it can be determined that no receiving end needs to acquire the decoded video stream currently exists. At this time, based on the fact that the first recording table does not contain the identification information corresponding to the video stream address of the original video stream, the decoding end can stop decoding the original video stream, so that waste of computing resources is avoided.
Step 206, pushing the decoded video stream to the receiving end corresponding to the identification information.
After the original video stream is decoded, the decoding end can send the decoded video stream to the pushing end. The pushing end can determine its corresponding receiving end based on the identification information, and push the decoded video stream to the receiving end.
For the receiving end, the receiving end can acquire the real-time video stream of the video acquisition equipment which needs to be checked through one video acquisition request, the method does not need to be like the existing real-time video stream acquisition mode, the decoding of the real-time video stream is required to be firstly requested, then a server for storing the decoded video stream is required to be sent to decode the video stream, the acquisition of the real-time video stream is completed through multiple requests, and additional plug-ins are not required to be installed.
For the back end, a server for storing the decoded video stream is not required to be additionally arranged, the original video stream can be decoded simultaneously in the process of acquiring the original video stream, and after the decoding is finished, the decoded video stream after the decoding is finished can be directly pushed to the receiving end, so that the data transmission efficiency is improved.
In one embodiment of the present invention, the step of pushing the decoded video stream to the receiving end corresponding to the identification information includes:
s41, determining a session object corresponding to the identification information based on the second record table;
after decoding to obtain a decoded video stream, the push end may determine how the decoded video stream should be sent to the receiving end based on the second record table. Therefore, the push segment can determine the session object corresponding to the identification information based on the corresponding relation between the identification information recorded by the second record table and the session object.
S42, pushing the decoded video stream to the receiving end through the interface of the session object corresponding to the identification information.
Specifically, the session object may have information of an interface for transmitting data corresponding to the receiving end recorded therein. Therefore, the pushing section can push the decoded video stream to the receiving end through the interface of the session object corresponding to the identification information, so that the decoded video stream can be efficiently pushed based on the second record table.
As a specific example of the present invention, fig. 3 is a schematic flow chart of a video stream pushing method according to an embodiment of the present invention. The user can perform a video management page UI in the front-end browser and select a video acquisition device to be browsed. Thereafter, the browser may create a webSocket receiver using js Socket objects and generate identification information ClientId. Then the receiving end can determine the video stream address url of the video acquisition equipment based on rtsp protocol through the onvif interface. Then, the receiving end can send a video acquisition request through a webSocket protocol by taking the identification information ClientId and the rtsp protocol-based video stream address url as parameters so as to establish webSocket connection with a webSocket server of the back end.
Then, the webSocket server of the back end can monitor the newly added receiving end, and records the corresponding relation between the webSocket session object and the identification information ClientId through the second recording table ClientsMap so as to facilitate the follow-up stream pushing. And simultaneously, recording the corresponding relation between the identification information ClientId and the rtsp protocol-based video stream address url through a first recording table ClientClassifyMap so as to control a decoding flow and a pushing flow based on the first recording table ClientClassifyMap.
The webSocket server may determine whether the number of receiving ends corresponding to the rtsp protocol-based video stream address url is greater than 1 in the first record table ClientClassifyMap, and if so, the webSocket server may not need to decode, but may directly obtain pushing of the decoded video stream based on the second record table. If not more than 1, the decoding end of the back end needs to be informed to process the decoding of the video stream.
The decoding end of the back end can acquire the rtsp protocol-based video stream address url sent by the webSocket server and acquire an original video stream from the rtsp protocol-based video stream address url. Then, the decoding end can decode the original video stream based on the ffmpeg decoding module contained in the Javacv frame to obtain a decoded video stream. In the decoding process, the decoding end can determine whether the current rtsp protocol-based video stream address url still has a corresponding receiving end based on the first record table ClientClassifyMap in real time, so as to determine whether the receiving end needing to acquire the decoded video stream still exists at present. If not, stopping decoding. If so, capturing the decoding result to obtain a decoded video stream. If decoding is abnormal and the decoded video stream can not be obtained, ending the decoding flow and feeding back error information. If the decoded video stream is obtained, the decoded video stream can be sent to a push segment at the back end for further processing.
After obtaining the decoded video stream, the push end of the back end may further convert the decoded video stream into a binary group in order to facilitate sending the decoded video stream. Thereafter, the pushing end may determine, based on the first record table ClientClassifyMap, whether the current rtsp protocol-based video stream address url still has a corresponding receiving end, so as to determine whether there is still a receiving end that needs to acquire the decoded video stream. If not, the transmission of the decoded data stream is stopped. If so, searching a webSocket session object corresponding to the identification information ClientId based on the second record table ClientMap. If not, it may also be determined that the receiving end has stopped acquiring the decoded video stream at this time, and stops transmitting the decoded data stream. If so, sending the decoded video stream to an interface of a webSocket session object corresponding to the identification information ClientId, and completing pushing of the decoded data stream.
According to the pushing method of the video stream, a video acquisition request sent by a receiving end is acquired; the video acquisition request records identification information and a video stream address; acquiring an original video stream from video acquisition equipment corresponding to the video stream address; decoding the original video stream to obtain a decoded video stream; pushing the decoded video stream to a receiving end corresponding to the identification information. Therefore, the real-time pushing of the video stream can be completed without additionally arranging a decoding server for decoding and storing the decoded video stream and installing a third-party plug-in on a receiving end, and the data transmission efficiency is high.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 4, a block diagram of a video stream pushing device provided in an embodiment of the present invention is shown, which may specifically include the following modules:
a request acquisition module 401, configured to acquire a video acquisition request, where the video acquisition request records identification information of a receiving end and a video stream address;
a video stream obtaining module 402, configured to obtain an original video stream collected by a video collecting device corresponding to the video stream address;
a decoding module 403, configured to decode the original video stream to obtain a decoded video stream;
a first pushing module 404, configured to push the decoded video stream to a receiving end corresponding to the identification information.
Optionally, the apparatus further comprises:
and the first recording module is used for recording the corresponding relation between the identification information of the receiving end and the video stream address in a preset first recording table.
Optionally, the apparatus further comprises:
and the first searching module is used for determining a video stream address recorded by the video acquisition request in the first recording table.
Optionally, the apparatus further comprises:
a session creation module for creating a session object for the video acquisition request;
and the second recording module is used for recording the corresponding relation between the identification information of the receiving end and the session object in a preset second recording table.
Optionally, the first pushing module includes:
a session searching sub-module, configured to determine a session object corresponding to the identification information based on the second record table;
and the first pushing sub-module is used for pushing the decoded video stream to the receiving end through the interface of the session object corresponding to the identification information.
Optionally, the apparatus further comprises:
and the deleting module is used for deleting the corresponding relation between the receiving end and the video stream address in the first record table based on the fact that the receiving end stops acquiring the decoded video stream.
Optionally, the apparatus further comprises:
the detection module is used for detecting whether the first record table contains identification information corresponding to a video stream address of the original video stream or not in the process of decoding the original video stream;
and the stopping module is used for stopping decoding the original video stream based on the identification information corresponding to the video stream address of the original video stream not included in the first record table.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
In addition, the embodiment of the invention also provides an electronic device, as shown in fig. 5, which comprises a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502 and the memory 503 complete communication with each other through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501 is configured to execute the program stored in the memory 503, and implement the following steps:
acquiring a video acquisition request, wherein the video acquisition request records identification information of a receiving end and a video stream address;
acquiring an original video stream acquired by video acquisition equipment corresponding to the video stream address;
decoding the original video stream to obtain a decoded video stream;
pushing the decoded video stream to a receiving end corresponding to the identification information.
Optionally, the method further comprises:
and recording the corresponding relation between the identification information of the receiving end and the video stream address in a preset first recording table.
Optionally, before the step of acquiring the original video stream from the video acquisition device corresponding to the video stream address, the method further includes:
and determining a video stream address recorded by the video acquisition request in the first record table.
Optionally, the method further comprises:
creating a session object for the video acquisition request;
and recording the corresponding relation between the identification information of the receiving end and the session object in a preset second record table.
Optionally, the step of pushing the decoded video stream to the receiving end corresponding to the identification information includes:
determining a session object corresponding to the identification information based on the second record table;
pushing the decoded video stream to the receiving end through the interface of the session object corresponding to the identification information.
Optionally, the method further comprises:
and deleting the corresponding relation between the receiving end and the video stream address in the first record table based on the detection that the receiving end stops acquiring the decoded video stream.
Optionally, the method further comprises:
in the process of decoding the original video stream, detecting whether the first record table contains identification information corresponding to a video stream address of the original video stream or not;
and stopping decoding the original video stream based on the identification information corresponding to the video stream address of the original video stream not included in the first record table.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, as shown in fig. 6, a computer readable storage medium 601 is provided, where instructions are stored, when the computer readable storage medium runs on a computer, to cause the computer to perform the video streaming pushing method described in the above embodiment.
In a further embodiment of the present invention, a computer program product comprising instructions, which when run on a computer, causes the computer to perform the method for pushing a video stream as described in the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (8)

1. A method for pushing a video stream, comprising:
acquiring a video acquisition request, wherein the video acquisition request records identification information of a receiving end and a video stream address;
acquiring an original video stream acquired by video acquisition equipment corresponding to the video stream address;
decoding the original video stream to obtain a decoded video stream;
pushing the decoded video stream to a receiving end corresponding to the identification information, so that the decoded video stream is directly displayed at the receiving end;
wherein the method further comprises:
recording the corresponding relation between the identification information of the receiving end and the video stream address in a preset first recording table;
in the process of decoding the original video stream, detecting whether the first record table contains identification information corresponding to a video stream address of the original video stream or not;
and stopping decoding the original video stream based on the identification information corresponding to the video stream address of the original video stream not included in the first record table.
2. The method of claim 1, wherein prior to the step of obtaining the original video stream from the video capture device corresponding to the video stream address, the method further comprises:
and determining a video stream address recorded by the video acquisition request in the first record table.
3. The method according to claim 1, wherein the method further comprises:
creating a session object for the video acquisition request;
and recording the corresponding relation between the identification information of the receiving end and the session object in a preset second record table.
4. The method according to claim 3, wherein the step of pushing the decoded video stream to the receiving end corresponding to the identification information includes:
determining a session object corresponding to the identification information based on the second record table;
pushing the decoded video stream to the receiving end through the interface of the session object corresponding to the identification information.
5. The method according to claim 1, wherein the method further comprises:
and deleting the corresponding relation between the receiving end and the video stream address in the first record table based on the detection that the receiving end stops acquiring the decoded video stream.
6. A push device for video streams, comprising:
the request acquisition module is used for acquiring a video acquisition request, wherein the video acquisition request records identification information of a receiving end and a video stream address;
the video stream acquisition module is used for acquiring an original video stream acquired by video acquisition equipment corresponding to the video stream address;
the decoding module is used for decoding the original video stream to obtain a decoded video stream;
the pushing module is used for pushing the decoded video stream to the receiving end corresponding to the identification information, so that the decoded video stream is directly displayed at the receiving end;
wherein the apparatus further comprises:
the first recording module is used for recording the corresponding relation between the identification information of the receiving end and the video stream address in a preset first recording table;
the detection module is used for detecting whether the first record table contains identification information corresponding to a video stream address of the original video stream or not in the process of decoding the original video stream;
and the stopping module is used for stopping decoding the original video stream based on the identification information corresponding to the video stream address of the original video stream not included in the first record table.
7. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the method according to any one of claims 1-5 when executing a program stored on a memory.
8. One or more computer-readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method of any of claims 1-5.
CN202210339085.0A 2022-04-01 2022-04-01 Video stream pushing method and device, electronic equipment and readable medium Active CN115022676B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210339085.0A CN115022676B (en) 2022-04-01 2022-04-01 Video stream pushing method and device, electronic equipment and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210339085.0A CN115022676B (en) 2022-04-01 2022-04-01 Video stream pushing method and device, electronic equipment and readable medium

Publications (2)

Publication Number Publication Date
CN115022676A CN115022676A (en) 2022-09-06
CN115022676B true CN115022676B (en) 2024-02-13

Family

ID=83067138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210339085.0A Active CN115022676B (en) 2022-04-01 2022-04-01 Video stream pushing method and device, electronic equipment and readable medium

Country Status (1)

Country Link
CN (1) CN115022676B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113747181A (en) * 2020-08-06 2021-12-03 上海达龙信息科技有限公司 Network live broadcast method, live broadcast system and electronic equipment based on remote desktop
CN113766317A (en) * 2021-03-08 2021-12-07 京东城市(北京)数字科技有限公司 Video transmission method, video transmission device, electronic equipment and storage medium
CN113824925A (en) * 2021-08-11 2021-12-21 南京国电南自电网自动化有限公司 WEB plug-in-free video monitoring system and method
CN113973214A (en) * 2021-09-30 2022-01-25 中通服科信信息技术有限公司 Video stream format conversion method, device and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10009659B2 (en) * 2016-03-31 2018-06-26 Disney Enterprises, Inc. System and method for hybrid push-based streaming
US10412130B2 (en) * 2016-04-04 2019-09-10 Hanwha Techwin Co., Ltd. Method and apparatus for playing media stream on web browser

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113747181A (en) * 2020-08-06 2021-12-03 上海达龙信息科技有限公司 Network live broadcast method, live broadcast system and electronic equipment based on remote desktop
CN113766317A (en) * 2021-03-08 2021-12-07 京东城市(北京)数字科技有限公司 Video transmission method, video transmission device, electronic equipment and storage medium
CN113824925A (en) * 2021-08-11 2021-12-21 南京国电南自电网自动化有限公司 WEB plug-in-free video monitoring system and method
CN113973214A (en) * 2021-09-30 2022-01-25 中通服科信信息技术有限公司 Video stream format conversion method, device and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Ping Li ; Changyin Liu ; Peng Zhang.Design and Implementation of Live Stream System Based on Kurento.《2021 IEEE 2nd International Conference on Information Technology, Big Data and Artificial Intelligence (ICIBA)》.2022,904-908. *
基于WebRTC的跨平台视频会议系统的设计与实现;聂晓飞;《中国学位论文全文数据库》;全文 *
基于WebSocket和MSE的视频监控Web页播放的实现方法;盛琦鑫;《广播电视网络》;第27卷(第12期);62-66 *

Also Published As

Publication number Publication date
CN115022676A (en) 2022-09-06

Similar Documents

Publication Publication Date Title
AU2019200652B2 (en) Using messaging associated with adaptive bitrate streaming to perform media monitoring for mobile platforms
CN112087644B (en) Pull stream request processing method, device and system, electronic equipment and storage medium
CN106998485B (en) Video live broadcasting method and device
CN107493486B (en) Method, system and terminal equipment for video playing termination
CN111159269B (en) Data processing method, device and system
CN104185016A (en) OTT video quality monitoring method, device and system
US9641908B2 (en) Method and system for transferring real-time audio/video stream
CN109446445B (en) Resource acquisition method and device
CN113301388B (en) Video stream processing system, equipment and method
CN109194706B (en) Network resource dial testing method and terminal
CN112822435A (en) Security method, device and system allowing user to easily access
CN112653736B (en) Parallel source returning method and device and electronic equipment
CN115022676B (en) Video stream pushing method and device, electronic equipment and readable medium
CN116261021B (en) Video stream playing method and device, electronic equipment and storage medium
CN113438520B (en) Data processing method, device and system
US11973816B2 (en) Using messaging associated with adaptive bitrate streaming to perform media monitoring for mobile platforms
CN113037698B (en) Video manufacturer adaptation method, device, equipment and medium based on configuration file
CN111083430B (en) Image acquisition method and device, electronic equipment and storage medium
CN113630628A (en) Media stream sending method, system, processing equipment and storage medium
CN114189504A (en) Method and device for acquiring flow starting URL (Uniform resource locator), electronic equipment and storage medium
CN117519524A (en) Terminal application testing method and device, electronic equipment and storage medium
TW202343250A (en) Cloud server and anomaly detection system and method for network surveillance
CN113271458A (en) Method for detecting video source effectiveness in transcoding system
CN116112531A (en) Data collection method, device, equipment and medium

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