Video transmission method and device, electronic equipment and computer readable medium
By testing network status and encoding and storing segments before real-time video streaming, combined with video watermarking technology, the problems of network packet loss and video leakage are solved, achieving stable and secure video transmission.
Patent Information
- Application Number
- CN202411040046.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2044-07-31
AI Technical Summary
Real-time video streaming is susceptible to network factors that can lead to packet loss. Furthermore, in private scenarios such as home surveillance, video transmission is prone to leakage and it is difficult to trace unauthorized requests and controls.
By sending network status test data packets, receiving and analyzing the response information from the target terminal, determining the network packet loss rate, controlling the surveillance camera to capture and encode video streams for segmented storage and transmission, and introducing watermark information into the video stream for uniqueness verification and combination, the stable transmission and source traceability of the video stream are ensured.
It achieves stable video stream transmission even in the event of network packet loss, and can trace the terminal device that made the illegal request after video leakage, thus improving the security and stability of video transmission.
Smart Images

Figure CN119071430B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to the technical field of computer technology, and particularly to a video transmission method and device, electronic equipment and computer readable medium. BACKGROUND
[0002] Real-time video transmission, usually in the scene of home monitoring, is a technology that transmits the real-time video stream captured by certain technology to a target terminal. At present, when transmitting the real-time video stream, the commonly used way is to directly transmit the captured real-time video stream to the target terminal.
[0003] However, when transmitting the real-time video stream by using the above way, the following technical problems often exist:
[0004] First, due to the influence of network, device and other factors, network packet loss phenomenon often occurs in the process of transmitting the real-time video stream, which makes the real-time video stream unable to be transmitted stably.
[0005] Second, the video transmission process is easy to leak. In the private scene such as home monitoring, once an illegal request and control are received, not only the relevant privacy will be infringed, but also it is difficult to trace back. SUMMARY
[0006] The summary of the present disclosure is used to introduce the concepts in a brief form, which will be described in detail in the specific embodiments part. The summary of the present disclosure does not aim to identify the key features or essential features of the claimed technical solutions, nor does it aim to limit the scope of the claimed technical solutions.
[0007] Some embodiments of the present disclosure propose a video transmission method and device, electronic equipment and computer readable medium to solve one or more of the technical problems mentioned in the background part.
[0008] In a first aspect, some embodiments of the present disclosure provide a video transmission method, the method comprising: in response to receiving a real-time monitoring video request sent by a target terminal, sending a network state test data packet preset to the target terminal; receiving reply information returned by the target terminal, wherein the reply information comprises a received data packet data amount, and the received data packet data amount is a data amount of the network state test data packet received by the target terminal; in response to determining that a ratio of the received data packet data amount to a data amount of the network state test data packet is less than a first preset threshold, controlling a monitoring camera to shoot a real-time video stream and using an encoder to encode the shot real-time video stream to obtain a real-time generated monitoring video stream, and performing segmented storage on the generated monitoring video stream; transmitting the monitoring video stream to the target terminal in real time; and receiving data packet reception feedback information returned by the target terminal, wherein the data packet reception feedback information comprises a real-time sub-video stream reception data amount, the real-time sub-video stream reception data amount is a data amount of a real-time sub-video stream received by the target terminal, and the target terminal generates a reception feedback information for each received real-time sub-video stream.
[0009] In a second aspect, some embodiments of the present disclosure provide a video transmission device, the device comprising: a sending unit configured to, in response to receiving a real-time monitoring video request sent by a target terminal, send a network state test data packet preset to the target terminal; a first receiving unit configured to receive reply information returned by the target terminal, wherein the reply information comprises a received data packet data amount, and the received data packet data amount is a data amount of the network state test data packet received by the target terminal; a control unit configured to, in response to determining that a ratio of the received data packet data amount to a data amount of the network state test data packet is less than a first preset threshold, control a monitoring camera to shoot a real-time video stream and use an encoder to encode the shot real-time video stream to obtain a real-time generated monitoring video stream, and perform segmented storage on the generated monitoring video stream; a transmission unit configured to transmit the monitoring video stream to the target terminal in real time; and a second receiving unit configured to receive data packet reception feedback information returned by the target terminal, wherein the data packet reception feedback information comprises a real-time sub-video stream reception data amount, the real-time sub-video stream reception data amount is a data amount of a real-time sub-video stream received by the target terminal, and the target terminal generates a reception feedback information for each received real-time sub-video stream.
[0010] In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the implementations of the first aspect.
[0011] In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium having stored thereon a computer program, wherein the program, when executed by a processor, implements the method described in any implementation manner of the first aspect.
[0012] The above various embodiments of the present disclosure have the following beneficial effects: through the video transmission method of some embodiments of the present disclosure, the real-time video stream can be preprocessed according to the network packet loss rate, so that the video stream can be transmitted stably to a certain extent. Specifically, the reason why the real-time video stream cannot be transmitted stably in the process of real-time video stream transmission is that the real-time video stream is easily affected by network factors when being transmitted. Based on this, the video transmission method of some embodiments of the present disclosure first sends the pre-set network state test data packet to the target terminal in response to receiving the real-time monitoring video request sent by the target terminal. Then, the reply information returned by the target terminal is received, wherein the reply information includes the received data packet data amount, and the received data packet data amount is the data amount of the network state test data packet received by the target terminal. Thus, the network state is tested before starting the real-time video stream recording, and then the current network packet loss rate is obtained according to the test. Next, in response to determining that the ratio of the received data packet data amount to the data amount of the network state test data packet is less than a first preset threshold, the monitoring camera is controlled to shoot the real-time video stream, and the encoder is used to encode the shot real-time video stream to obtain the real-time generated monitoring video stream, and the generated monitoring video stream is stored in segments. Thus, the transmission process of the real-time video stream can be adjusted according to the pre-tested network state. Then, the monitoring video stream is transmitted to the target terminal in real time. Finally, the data packet receiving feedback information returned by the target terminal is received, wherein the data packet receiving feedback information includes the real-time sub-video stream receiving data amount, the real-time sub-video stream receiving data amount is the data amount of the real-time sub-video stream received by the target terminal, and the target terminal generates a receiving feedback information for each received real-time sub-video stream. Thus, the real-time video stream can be preprocessed according to the network packet loss rate, so that the video stream can be transmitted stably to a certain extent. BRIEF DESCRIPTION OF DRAWINGS
[0013] The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent upon consideration of the following detailed description, taken in conjunction with the accompanying drawings. Throughout the drawings, like or similar reference numerals designate identical or similar elements throughout the several views. It should be understood that the drawings are schematic and elements and features are not necessarily to scale.
[0014] Figure 1 is a flowchart of some embodiments of the video transmission method according to the present disclosure;
[0015] Figure 2 is a structural schematic diagram of some embodiments of the video transmission device of the present disclosure;
[0016] Figure 3 is a structural schematic diagram of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION
[0017] Embodiments of the present disclosure will be described below in greater detail with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms, and should not be interpreted as being limited to the embodiments set forth herein. Rather, these embodiments are provided so as to more completely and comprehensively understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are merely for exemplary purposes, and are not intended to limit the scope of protection of the present disclosure.
[0018] It should also be noted that, for ease of description, only the parts related to the present application are shown in the drawings. The embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0019] It should be noted that the terms "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules or units.
[0020] It should be noted that the adjectives "one", "multiple" mentioned in the present disclosure are illustrative and not limiting, and those skilled in the art should understand that, unless otherwise explicitly stated in the context, it should be understood as "one or more".
[0021] The names of the messages or information exchanged between the devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0022] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
[0023] Reference Figure 1 shows a flow 100 of some embodiments of the video transmission method according to the present disclosure. The video transmission method comprises the following steps:
[0024] Step 101, in response to receiving a real-time monitoring video request sent by a target terminal, sending a pre-set network state test data packet to the target terminal.
[0025] In some embodiments, the execution subject of the video transmission method can send the pre-set network status test data packet to the target terminal in response to receiving a real-time monitoring video request sent by the target terminal. The target terminal can be a mobile terminal. The network status test data packet can be a preset video with a fixed data amount.
[0026] As an example, the target terminal can be a smart phone.
[0027] In some optional implementations of some embodiments, the execution subject can perform the following steps before sending the pre-set network status test data packet to the target terminal in response to receiving a real-time monitoring video request sent by the target terminal:
[0028] First, send video watermark acquisition information to the target terminal.
[0029] Second, receive video watermark information returned by the target terminal in response to the video watermark acquisition information. The video watermark information can be information generated by a user on the target terminal and used as a video watermark.
[0030] Third, perform uniqueness verification on the video watermark information. The uniqueness verification can be to determine whether the stored video watermark information includes the video watermark information.
[0031] Fourth, in response to determining that the video watermark information does not pass the uniqueness verification, send a watermark information repetition prompt to the target terminal and reacquire the video watermark information.
[0032] Fifth, in response to determining that the video watermark information passes the uniqueness verification, store the video watermark information.
[0033] Step 102, receive reply information returned by the target terminal.
[0034] In some embodiments, the execution subject can receive reply information returned by the target terminal. The reply information can include a received data packet data amount, which is the data amount of the network status test data packet received by the target terminal.
[0035] Thus, the ratio of the received data packet data amount in the reply information to the data amount of the network status test data packet can be used to determine the packet loss rate of the network status test data packet in the transmission process.
[0036] In response to determining that the ratio of the data volume of the received data packet to the data volume of the network status test data packet is less than the first preset threshold, the execution subject controls the monitoring camera to capture a real-time video stream and uses an encoder to encode the captured real-time video stream to obtain a real-time generated monitoring video stream, and stores the generated monitoring video stream in segments.
[0037] In some embodiments, the execution subject can control the monitoring camera to capture a real-time video stream and use an encoder to encode the captured real-time video stream to obtain a real-time generated monitoring video stream, and store the generated monitoring video stream in segments in response to determining that the ratio of the data volume of the received data packet to the data volume of the network status test data packet is less than the first preset threshold.
[0038] In practice, the first preset threshold can be set according to actual application requirements, which is not limited here.
[0039] In some optional implementations of some embodiments, the execution subject can also control the monitoring camera to capture a real-time video stream and use an encoder to encode the captured real-time video stream to obtain a real-time generated monitoring video stream in response to determining that the ratio of the data volume of the received data packet to the data volume of the network status test data packet is greater than or equal to the first preset threshold.
[0040] In step 104, the monitoring video stream is transmitted to a target terminal in real time.
[0041] In some embodiments, the execution subject can transmit the monitoring video stream to the target terminal in real time, which can include the following steps:
[0042] First, the real-time generated monitoring video stream is segmented to obtain a sequence of real-time sub-video streams. The data volume of each real-time sub-video stream in the sequence of real-time sub-video streams is the same.
[0043] Second, real-time sub-video streams are sequentially taken from the head of the sequence of real-time sub-video streams to be sent to the target terminal.
[0044] Third, the real-time generated real-time sub-video stream is added to the tail of the sequence of real-time sub-video streams.
[0045] Optionally, the execution subject can sequentially take real-time sub-video streams from the head of the sequence of real-time sub-video streams to send to the target terminal, which can include the following steps:
[0046] First, the real-time sub-video stream is copied to obtain a copied sub-video stream.
[0047] Secondly, the pre-set watermark distinguishing information is combined with the video watermark information to obtain the copied video watermark information.
[0048] The watermark distinguishing information is used to combine with the existing video watermark information to generate the copied video watermark information.
[0049] In practice, the watermark distinguishing information can be set according to actual application requirements, which is not limited here.
[0050] Thirdly, the video watermark information is added to the real-time sub-video stream to obtain the first real-time video stream.
[0051] Fourthly, the video watermark information is added to the copied sub-video stream to obtain the second real-time video stream.
[0052] Fifthly, the first real-time video stream and the second real-time video stream are cut to obtain a cut video stream sequence and a copied cut video stream sequence. The number of cut video streams in the cut video stream sequence is the same as the number of copied cut video streams in the copied cut video stream sequence. The length of each cut video stream in the cut video stream sequence is the same as the length of each copied cut video stream in the copied cut video stream sequence.
[0053] In practice, the length of the cut video stream can be set according to actual application requirements, which is not limited here.
[0054] As an example, the length of the cut video stream can be 30 seconds.
[0055] Sixthly, the number of cut video streams in the cut video stream sequence is determined as the combination number.
[0056] Seventhly, an initial sequence is generated. The length of the initial sequence is the same as the combination number, and the values in the initial sequence are all zero.
[0057] Eighthly, a positive integer smaller than the combination number is randomly selected as the cut number.
[0058] Ninthly, the initial sequence is cut by using the cut number to obtain a cut group sequence. The number of cut groups in the cut group sequence is one more than the cut number, and each cut group in the cut group sequence includes at least one value.
[0059] Tenthly, the cut groups in the cut group sequence are randomly assigned target values to obtain a target cut group sequence. The target cut group sequence includes at least one cut group with the target value and at least one cut group with a value of zero.
[0060] In practice, the target value can be set according to actual application needs, which is not limited herein. As an example, the target value can be 1.
[0061] Eleventh, combining each split video stream corresponding to the position with the target value in the target split group sequence in the split video stream sequence and each copy split video stream corresponding to the position with the value of zero in the target split group sequence in the copy split video stream sequence in order to obtain a target real-time sub-video stream.
[0062] Twelfth, sending the target real-time sub-video stream to the target terminal.
[0063] The step of sequentially taking out real-time sub-video streams from the head of the real-time sub-video stream sequence to send to the target terminal and its extended steps are an inventive point of an embodiment of the present disclosure, which solves the second technical problem mentioned in the background art that in private scenes such as home monitoring, once an illegal request and control is received, not only the privacy is infringed, but also it is difficult to trace. The factors leading to the above technical problem are often as follows: video transmission process is easy to leak, and illegal request and control are easy to receive. If the above factors are solved, the terminal device sending illegal request can be traced after video leakage, and the source of video leakage can be determined. In order to achieve this effect, the present disclosure introduces video watermark information, and copies the real-time sub-video stream to obtain a copy sub-video stream, and respectively marks the real-time sub-video stream and the copy sub-video stream with a watermark, performs splitting and combination to obtain a video stream with unique combination characteristics. Further, when the video stream is leaked, the source of video leakage can be determined according to the combination relationship therein.
[0064] In some optional implementations of some embodiments, the execution subject can further perform the following steps:
[0065] First step, in response to receiving a real-time monitoring video termination request sent by the target terminal or monitoring a real-time monitoring video playback termination operation of the target terminal, the following sub-steps are performed:
[0066] First sub-step, continue to control the monitoring camera to shoot a video stream to obtain a pre-stored video stream.
[0067] Second sub-step, segmenting and storing the pre-stored video stream.
[0068] Second step, in response to receiving a video review request sent by the target terminal, the following steps are performed:
[0069] First sub-step, testing the current network status to obtain the current network speed.
[0070] A second sub-step, in response to determining that the current network speed is less than the first preset network speed, compressing the quality of the segmented and stored pre-stored video stream to a first quality to obtain a first compressed video stream, and sending the first compressed video stream to the target terminal.
[0071] A third sub-step, in response to determining that the current network speed is greater than or equal to the first preset network speed and less than a second preset network speed, compressing the quality of the segmented and stored pre-stored video stream to a second quality to obtain a second compressed video stream, and sending the second compressed video stream to the target terminal, wherein the resolution of the second quality is higher than that of the first quality.
[0072] As an example, the first preset network speed can be 10M / S, and the first preset network speed can be 20M / S. The first quality can be 360P, and the first quality can be 1080P.
[0073] A fourth sub-step, in response to determining that the current network speed is greater than or equal to the second preset network speed, sending the segmented and stored pre-stored video stream to the target terminal.
[0074] Step 105, receiving the data packet receiving feedback information returned by the target terminal.
[0075] In some embodiments, the execution subject can receive the data packet receiving feedback information returned by the target terminal. The data packet receiving feedback information includes real-time sub-video stream receiving data volume, the real-time sub-video stream receiving data volume is the data volume of the real-time sub-video stream received by the target terminal, and the target terminal generates a receiving feedback information for each real-time sub-video stream received.
[0076] Thus, the real-time packet loss rate can be determined according to the real-time sub-video stream receiving data volume in the data packet receiving feedback information, and the video transmission process can be adjusted, thereby reducing the packet loss rate in the transmission process to a certain extent and improving user experience and video data transmission stability.
[0077] In some optional implementations of some embodiments, the execution subject can further perform the following steps:
[0078] First step, determining the real-time packet loss rate in the monitoring video stream transmission process according to the data packet receiving feedback information.
[0079] Second step, in response to determining that the packet loss rate meets a first preset condition, compressing the real-time sub-video stream taken from the head of the real-time sub-video stream sequence to send the compressed real-time sub-video stream to the target terminal. The first preset condition is that the packet loss rate is less than or equal to a second preset threshold, and the second preset threshold is less than the first preset threshold.
[0080] In practice, the first preset threshold and the second preset threshold can be set according to actual application requirements, which are not limited here.
[0081] Optionally, the execution subject determines the real-time packet loss rate in the transmission process of the monitoring video stream according to the data packet receiving feedback information, and the method can further include the following steps:
[0082] First, in response to determining that the data packet receiving feedback information is empty, the real-time packet loss rate in the transmission process of the monitoring video stream is determined to be 100%.
[0083] Second, in response to determining that the data packet receiving feedback information is not empty, the ratio of the real-time sub-video stream receiving data amount in the data packet receiving feedback information to the data amount of the real-time sub-video stream in the real-time sub-video stream sequence is determined as the real-time packet loss rate.
[0084] The above various embodiments of the present disclosure have the following beneficial effects: through the video transmission method of some embodiments of the present disclosure, the real-time video stream can be preprocessed according to the network packet loss rate, so that the video stream can be transmitted stably to a certain extent. Specifically, the reason why the real-time video stream cannot be transmitted stably during the real-time video stream transmission process is that the real-time video stream is easily affected by network factors when being transmitted. Based on this, the video transmission method of some embodiments of the present disclosure first sends the pre-set network state test data packet to the target terminal in response to receiving the real-time monitoring video request sent by the target terminal. Then, the reply information returned by the target terminal is received, wherein the reply information includes the received data packet data amount, and the received data packet data amount is the data amount of the network state test data packet received by the target terminal. Thus, before starting the real-time video stream recording, the network state is tested, and then the current network packet loss rate is obtained according to the test. Next, in response to determining that the ratio of the received data packet data amount to the data amount of the network state test data packet is less than a first preset threshold, the monitoring camera is controlled to shoot the real-time video stream, and the encoder is used to encode the shot real-time video stream to obtain the real-time generated monitoring video stream, and the generated monitoring video stream is stored in segments. Thus, the transmission process of the real-time video stream can be adjusted according to the pre-tested network state. Then, the monitoring video stream is transmitted to the target terminal in real time. Finally, the data packet receiving feedback information returned by the target terminal is received, wherein the data packet receiving feedback information includes the real-time sub-video stream receiving data amount, the real-time sub-video stream receiving data amount is the data amount of the real-time sub-video stream received by the target terminal, and the target terminal generates a receiving feedback information for each received real-time sub-video stream. Thus, the real-time video stream can be preprocessed according to the network packet loss rate, so that the video stream can be transmitted stably to a certain extent.
[0085] Further reference Figure 2 As an implementation of the method shown in the above figures, the present disclosure provides some embodiments of a video transmission device, which device embodiments correspond to the method embodiments shown in Figure 1 The video transmission device can be applied to various electronic devices.
[0086] As Figure 2As shown, the video transmission device 200 of some embodiments includes a sending unit 201, a first receiving unit 202, a control unit 203, a transmission unit 204, and a second receiving unit 205. The sending unit 201 is configured to send a pre-set network status test data packet to a target terminal in response to receiving a real-time monitoring video request sent by the target terminal. The first receiving unit 202 is configured to receive reply information returned by the target terminal, wherein the reply information includes a received data packet data amount, and the received data packet data amount is the data amount of the network status test data packet received by the target terminal. The control unit 203 is configured to control a monitoring camera to capture a real-time video stream and use an encoder to encode the captured real-time video stream to obtain a real-time generated monitoring video stream, and store the generated monitoring video stream in segments, in response to determining that a ratio of the received data packet data amount to a data amount of the network status test data packet is less than a first pre-set threshold. The transmission unit 204 is configured to transmit the monitoring video stream to the target terminal in real time. The second receiving unit 205 is configured to receive data packet receiving feedback information returned by the target terminal, wherein the data packet receiving feedback information includes a real-time sub-video stream receiving data amount, and the real-time sub-video stream receiving data amount is the data amount of a real-time sub-video stream received by the target terminal. The target terminal generates a receiving feedback information for each real-time sub-video stream received.
[0087] It can be understood that the units described in the video transmission device 200 correspond to the respective steps in the method described above. Therefore, the operations, features, and advantages described above for the method also apply to the video transmission device 200 and the units included therein, and will not be described here again. Figure 1
[0088] The following refers to Figure 3 which shows a structural schematic diagram of an electronic device 300 suitable for use to implement some embodiments of the present disclosure. Figure 3 The electronic device shown is merely an example and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.
[0089] As Figure 3 As shown, the electronic device 300 can include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301 that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 302 or loaded into a random access memory (RAM) 303 from a storage device 308. Various programs and data required for the operation of the electronic device 300 are also stored in the RAM 303. The processing device 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0090] Generally, the following devices can be connected to the I / O interface 305: input devices 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; and communication devices 309. The communication devices 309 can allow the electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 The electronic device 300 is shown with various devices, but it should be understood that all of the illustrated devices are not required, and more or fewer devices can alternatively be implemented. Figure 3 Each block shown in the flowcharts can represent one device or, as desired, multiple devices.
[0091] In particular, processes described above with reference to the flowcharts can be implemented as a computer software program according to some embodiments of the present disclosure. For example, some embodiments of the present disclosure include a computer program product including a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In some such embodiments, the computer program can be downloaded and installed from a network through the communication devices 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-described functions defined in the methods of some embodiments of the present disclosure are performed.
[0092] Note that the computer readable medium in some embodiments of the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination thereof. The computer readable storage medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination of the foregoing. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program used by an instruction execution system, apparatus or device, or that can be used by or in connection with an instruction execution system, apparatus or device. In some embodiments of the present disclosure, the computer readable signal medium can include a computer readable program code propagated in or on a carrier medium, in which the computer readable program code is embodied. Such propagated computer readable program code can take many forms, including but not limited to, an electromagnetic signal, an optical signal or any suitable combination of the foregoing. The computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate or transport a program for use by or in connection with an instruction execution system, apparatus or device. Program code embodied on a computer readable medium can be transmitted using any suitable medium, including but not limited to, wire, cable, wireless, RF, infrared or any suitable combination of the foregoing.
[0093] In some embodiments, the client, server, or both can communicate using any current known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet, and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any current known or future developed networks.
[0094] The computer readable medium can be included in the electronic device, or can exist separately from the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: in response to receiving a real-time monitoring video request sent by a target terminal, send a pre-set network state test data packet to the target terminal; receive reply information returned by the target terminal, wherein the reply information includes a received data packet data amount, and the received data packet data amount is a data amount of the network state test data packet received by the target terminal; in response to determining that a ratio of the received data packet data amount to a data amount of the network state test data packet is less than a first preset threshold, control a monitoring camera to shoot a real-time video stream and use an encoder to encode the shot real-time video stream to obtain a real-time generated monitoring video stream, and perform segmented storage on the generated monitoring video stream; transmit the monitoring video stream to the target terminal in real time; and receive data packet receiving feedback information returned by the target terminal, wherein the data packet receiving feedback information includes a real-time sub-video stream receiving data amount, the real-time sub-video stream receiving data amount is a data amount of a real-time sub-video stream received by the target terminal, and the target terminal generates a receiving feedback information for each real-time sub-video stream received.
[0095] Computer program code for carrying out operations of some embodiments of the disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0096] The computer program product of the first aspect can include a computer readable storage medium. The computer readable storage medium can include instructions. The instructions can include one or both of: instructions that configure a general purpose computer to become a special purpose computer capable of implementing the method of the first aspect; and instructions that configure a special purpose computer to become a special purpose computer capable of implementing the method of the first aspect.
[0097] The units described in some embodiments of the present disclosure can be implemented by means of software, or implemented by means of hardware. The described units can also be arranged in a processor, for example, can be described as: a processor includes a sending unit, a first receiving unit, a control unit, a transmission unit and a second receiving unit. Among them, the name of these units does not constitute a limitation to the unit itself in some cases, for example, the sending unit can also be described as "a unit for sending the pre-set network state test data packet to the target terminal".
[0098] The functions described above in the present document can be performed, at least in part, by one or more hardware logic components. For example, and without limitation, non-limiting examples of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system on a chip (SOCs), complex programmable logic devices (CPLDs), etc.
Claims
1. A video transmission method, comprising: in response to receiving a real-time monitoring video request sent by a target terminal, sending a pre-set network state test data packet to the target terminal; receiving reply information returned by the target terminal, wherein the reply information comprises a received data packet data amount, which is a data amount of the network state test data packet received by the target terminal; in response to determining that a ratio of the received data packet data amount to a data amount of the network state test data packet is less than a first pre-set threshold, controlling a monitoring camera to shoot a real-time video stream and using an encoder to encode the shot real-time video stream to obtain a real-time generated monitoring video stream, and segmenting and storing the generated monitoring video stream; transmitting the monitoring video stream to the target terminal in real time, comprising: segmenting the real-time generated monitoring video stream to obtain a real-time sub-video stream sequence; sequentially taking real-time sub-video streams from a head end of the real-time sub-video stream sequence to send to the target terminal, comprising: copying the real-time sub-video stream to obtain a copied sub-video stream; adding video watermark information to the real-time sub-video stream to obtain a first real-time video stream; adding the video watermark information to the copied sub-video stream to obtain a second real-time video stream; splitting the first real-time video stream and the second real-time video stream to obtain a split video stream sequence and a copied split video stream sequence; determining a number of split video streams in the split video stream sequence as a combination number; generating an initial sequence, wherein the initial sequence has the same length as the combination number, and all values in the initial sequence are zero; randomly selecting a positive integer smaller than the combination number as a split number; splitting the initial sequence using the split number to obtain a split group sequence; randomly assigning a target value to split groups in the split group sequence to obtain a target split group sequence, wherein the target split group sequence comprises at least one split group with the target value, at least one split group with a value of zero, and the target value is 1; combining each split video stream in the split video stream sequence corresponding to a position with the target value in the target split group sequence with each copied split video stream in the copied split video stream sequence corresponding to a position with a value of zero in the target split group sequence in order to obtain a target real-time sub-video stream; sending the target real-time sub-video stream to the target terminal; adding a real-time generated real-time sub-video stream to a tail end of the real-time sub-video stream sequence; receiving data packet reception feedback information returned by the target terminal, wherein the data packet reception feedback information comprises a real-time sub-video stream reception data amount, which is a data amount of a real-time sub-video stream received by the target terminal, and the target terminal generates a reception feedback information for each received real-time sub-video stream; determining a real-time packet loss rate in a monitoring video stream transmission process according to the data packet reception feedback information. In response to determining that the packet loss rate meets the first preset condition, compressing a real-time sub-video stream taken from a head of the sequence of real-time sub-video streams to send the compressed real-time sub-video stream to the target terminal.
2. The method of claim 1, wherein, The first preset condition is that the packet loss rate is less than or equal to a second preset threshold, and the second preset threshold is less than the first preset threshold.
3. The method of claim 2, wherein, The method further includes: In response to determining that the data packet receiving feedback information is empty, determining that the real-time packet loss rate in the monitoring video stream transmission process is 100 percent; In response to determining that the data packet receiving feedback information is not empty, determining the real-time packet loss rate as a ratio of a real-time sub-video stream receiving data amount in the data packet receiving feedback information to a data amount of the real-time sub-video stream in the sequence of real-time sub-video streams.
4. The method of claim 3, wherein, The method further includes: In response to determining that the ratio of the received data packet data amount to the data amount of the network state test data packet is greater than or equal to the first preset threshold, controlling the monitoring camera to capture a real-time video stream and using an encoder to encode the captured real-time video stream to obtain a real-time generated monitoring video stream.
5. The method of claim 4, wherein, The method further includes: In response to receiving a real-time monitoring video termination request sent by the target terminal or monitoring a real-time monitoring video playback termination operation of the target terminal, performing the following sub-steps: Continuing to control the monitoring camera to capture a video stream to obtain a pre-stored video stream; Segmenting and storing the pre-stored video stream; In response to receiving a video review request sent by the target terminal, performing the following steps: Testing a current network state to obtain a current network speed; In response to determining that the current network speed is less than a first preset network speed, compressing a quality of the segmented and stored pre-stored video stream to a first quality to obtain a first compressed video stream, and sending the first compressed video stream to the target terminal; In response to determining that the current network speed is greater than or equal to the first preset network speed and less than a second preset network speed, compressing a quality of the segmented and stored pre-stored video stream to a second quality to obtain a second compressed video stream, and sending the second compressed video stream to the target terminal, wherein a resolution of the second quality is higher than that of the first quality; In response to determining that the current network speed is greater than or equal to the second preset network speed, sending the segmented and stored pre-stored video stream to the target terminal.
6. A video transmission device, comprising: a sending unit configured to, in response to receiving a real-time monitoring video request sent by a target terminal, send a pre-set network state test data packet to the target terminal; a first receiving unit configured to receive reply information returned by the target terminal, wherein the reply information includes a received data packet data amount, and the received data packet data amount is a data amount of the network state test data packet received by the target terminal; The control unit is configured to control the monitoring camera to shoot a real-time video stream and utilize an encoder to encode the shot real-time video stream to obtain a real-time generated monitoring video stream and segmentally store the generated monitoring video stream in response to determining that a ratio of the received data packet data amount to a data amount of the network state test data packet is less than a first preset threshold value. The transmission unit is configured to transmit the monitoring video stream to the target terminal in real time, including: segmentally processing the real-time generated monitoring video stream to obtain a real-time sub-video stream sequence; sequentially taking out real-time sub-video streams from a head end of the real-time sub-video stream sequence to send to the target terminal, including: copying the real-time sub-video stream to obtain a copied sub-video stream; adding the video watermark information to the real-time sub-video stream to obtain a first real-time video stream; adding the video watermark information to the copied sub-video stream to obtain a second real-time video stream; splitting the first real-time video stream and the second real-time video stream to obtain a split video stream sequence and a copied split video stream sequence; determining a number of split video streams in the split video stream sequence as a combination number; generating an initial sequence, wherein a length of the initial sequence is the same as the combination number, and values in the initial sequence are all zero; randomly selecting a positive integer smaller than the combination number as a split number; splitting the initial sequence by using the split number to obtain a split group sequence; randomly assigning a target value to a split group in the split group sequence to obtain a target split group sequence, wherein the target split group sequence includes at least one split group with the target value, at least one split group with a value of zero, and the target value is 1; combining each split video stream in the split video stream sequence corresponding to a position with the target value in the target split group sequence with each copied split video stream in the copied split video stream sequence corresponding to a position with a value of zero in the target split group sequence in sequence to obtain a target real-time sub-video stream; sending the target real-time sub-video stream to the target terminal; adding a real-time generated real-time sub-video stream to a tail end of the real-time sub-video stream sequence; The second receiving unit is configured to receive data packet receiving feedback information returned by the target terminal, wherein the data packet receiving feedback information includes a real-time sub-video stream receiving data amount, the real-time sub-video stream receiving data amount is a data amount of a real-time sub-video stream received by the target terminal, and the target terminal generates a receiving feedback information for each received real-time sub-video stream; The determination unit is configured to determine a real-time packet loss rate in a monitoring video stream transmission process according to the data packet receiving feedback information; The compression unit is configured to compress the real-time sub-video stream taken out from the head end of the real-time sub-video stream sequence to send the compressed real-time sub-video stream to the target terminal in response to determining that the packet loss rate meets a first preset condition.
7. An electronic device, comprising: one or more processors; storage having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement a method as claimed in any of claims 1-5.
8. A computer readable medium having stored thereon a computer program, wherein, The program, which when executed by a processor, implements a method as claimed in any of claims 1-5.
Citation Information
Patent Citations
Wireless video streaming service self-adaption rate control method based on QoE
CN103888846A
Monitoring system and monitoring method based on big data network
CN113794861A
KR20220047546A