Video projection method, device, computer device and storage medium

By matching and copying video streams on the proxy server in the LAN, the problem of excessive network pressure and power consumption of VR terminals during screen projection is solved, and high-quality synchronous screen projection is achieved.

CN113727143BActive Publication Date: 2025-06-10HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110830756.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-08-30
Publication Date
2025-06-10
Estimated Expiration
2038-08-30

AI Technical Summary

Technical Problem

In the existing screen projection technology, VR terminals need to receive and send video streams at the same time, resulting in increased network pressure and power consumption, prone to lag, and reducing screen projection quality.

Method used

Through the proxy server in the same LAN as the first terminal and the second terminal in the same LAN, the screen projection proxy request message of the second terminal is received, the video stream being played by the first terminal, and the copied video stream is sent to the second terminal, to prevent the first terminal from sending a video stream directly to the second terminal.

Benefits of technology

The network pressure and power consumption of the first terminal are reduced, lag is avoided, screen projection quality is improved, and synchronous playback between the first terminal and the second terminal is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113727143B_ABST
    Figure CN113727143B_ABST
Patent Text Reader

Abstract

The present invention discloses a video projection method, device, computer device and storage medium, belonging to the field of video technology. The method includes: a proxy server receives a projection proxy request message from a second terminal, and the projection proxy request message carries at least the stream information of a first video stream being played by the first terminal; matching a data stream sent by a video server to the first terminal from the received video streams; when the first video stream is matched, copying the first video stream; and sending the copied video stream to the second terminal. By matching, through the proxy server, the video stream being played by the first terminal from the received video streams and sending the video stream corresponding to the video being played by the first terminal to the second terminal, the present invention enables the first terminal and the second terminal to play synchronously, avoids the first terminal from sending the video stream to the second terminal, reduces the network pressure and power consumption of the first terminal, and avoids lag, thereby improving the projection quality.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the application with the application date of August 30, 2018, application number 201811005325.3, and invention title "Video Projection Method, Device, Computer Device and Storage Medium" submitted to the China National Intellectual Property Administration. Technical Field

[0002] The present invention relates to the field of video technology, and particularly relates to a video projection method, device, computer device and storage medium. Background Art

[0003] With the progress of technology, as a personal wearable device, virtual reality (VR) terminals are widely used in life. Due to volume limitations, VR terminals cannot meet the need for multiple people to watch videos simultaneously. Therefore, projection technology is required to project the video images of VR terminals onto other screens that can enable multiple people to watch videos simultaneously.

[0004] The current projection technology can use a set-top box as the video projection party for projection. The projection process can be as follows: The VR terminal sends a video data request to the video server. The video request carries the network protocol address of the VR terminal, video uniform resource locator (URL) information, and the network protocol address of the video server. The video server sends a video stream to the VR terminal according to the information carried in the video request. After receiving the video stream, the VR terminal plays the video indicated by the video stream. The VR terminal sends a projection request to the set-top box. The projection request carries the video stream, playback progress, and head rotation information. The set-top box plays the video that the VR terminal is playing according to the information carried in the received projection request.

[0005] However, in the above projection process, the VR terminal not only needs to receive the video stream but also needs to send the video stream to the set-top box, increasing the network pressure and power consumption of the VR terminal. When the network pressure of the VR terminal is too high, the video played by the VR terminal will freeze, and then the video played on the set-top box will also freeze, thus reducing the projection quality. Summary of the Invention

[0006] Embodiments of the present invention provide a video projection method, device, computer device and storage medium, which can solve the problems of projection freeze of the first terminal and excessive network pressure and power consumption of the first terminal. The technical solution is as follows:

[0007] In a first aspect, a video projection method is provided, which is applied to a proxy server. The proxy server is in the same local area network as the first terminal and the second terminal. The method includes:

[0008] Receive a screen mirroring proxy request message from a second terminal, where the screen mirroring proxy request message carries at least the stream information of a first video stream being played by the first terminal;

[0009] Match the data stream sent by a video server to the first terminal according to the stream information of the first video stream, where the video server is used to provide the first video stream;

[0010] When the first video stream is matched, copy the first video stream to obtain a second video stream;

[0011] Send the second video stream to the second terminal, where the second video stream is used for video playback on the second terminal.

[0012] In a possible implementation, the first video stream is a Real-Time Transport Protocol (RTP) stream, and the stream information of the first video stream includes a five-tuple.

[0013] In a possible implementation, the URL information of the first video stream.

[0014] Based on the above two possible implementations, it shows that the first terminal can support multiple streaming media transmission protocols, improving the applicability of the first terminal, and the first terminal has universality.

[0015] In a possible implementation, the screen mirroring proxy request message further includes the network protocol address of the video server, and the method further includes:

[0016] When the first video stream is not matched, send a video stream request message to the video server according to the screen mirroring proxy request message of the second terminal, where the video stream request message carries video URL information;

[0017] Receive a third video stream, where the third video stream is the video stream corresponding to the video URL information;

[0018] Send the third video stream to the second terminal.

[0019] Based on the above possible implementations, it can avoid the phenomenon of out-of-sync screen mirroring caused by the proxy server being unable to match the video stream being played by the first terminal, and improve the synchronization effect.

[0020] In a possible implementation, the stream information of the first video stream further includes the network protocol address of the first terminal.

[0021] Based on the above possible implementations, the proxy server can provide proxy screen mirroring services for multiple first terminals simultaneously, improving the usage efficiency of the proxy server.

[0022] In a possible implementation, before matching the data stream sent by the video server to the first terminal according to the stream information of the first video stream, the method further includes:

[0023] Determine a target streaming media transmission protocol according to the protocol type field in the screen projection proxy request message, where the target streaming media transmission protocol is the streaming media transmission protocol adopted by the first terminal, and different values ​​of the protocol type field correspond to different streaming media transmission protocols;

[0024] Based on the target streaming media transmission protocol, a step of matching a data stream sent by the video server to the first terminal according to the stream information of the first video stream is performed.

[0025] Based on the above possible implementation methods, the proxy server can implement adaptive and differentiated processing for videos of different streaming media transmission protocols according to the protocol type field in the screen projection proxy request information.

[0026] In one possible implementation, the method further includes:

[0027] A video synchronization message periodically sent by the first terminal is received, and the video synchronization message is forwarded to the second terminal, wherein the video synchronization message includes stream information of the first video stream, and the video synchronization message also includes at least one of a playback progress and head rotation information of the first terminal.

[0028] Based on the above possible implementation method, the video synchronization information is sent periodically so that the second terminal can adjust the played video picture in real time according to the video synchronization information so that the video picture played by the second terminal is synchronized with the video picture played by the first terminal, thereby improving the synchronization effect.

[0029] In one possible implementation, the method further includes:

[0030] Receive a screen projection proxy end request message from the second terminal, where the screen projection proxy end request message is used to request the proxy server to end a matching process for the first video stream;

[0031] Stop matching the data stream sent by the video server to the first terminal.

[0032] Based on the above possible implementation methods, the screen projection process can be ended at any time, thereby avoiding unnecessary continuous screen projection, for example, when no one is watching the projected screen.

[0033] In a second aspect, a video screen projection method is provided, which is applied to a second terminal, where the second terminal, the proxy server, and the first terminal are in the same local area network, and the method includes:

[0034] Receive a screen projection request message from the first terminal, where the screen projection request message carries at least stream information of a first video stream being played by the first terminal;

[0035] Sending a screen projection proxy request message to the proxy server, where the screen projection proxy request message carries at least stream information of the first video stream being played by the first terminal;

[0036] Receiving a second video stream sent by the proxy server, where the second video stream is obtained by copying the first video stream received by the proxy server;

[0037] receiving a video synchronization message sent by the first terminal, the video synchronization message including stream information of the first video stream, the video synchronization message also including any one of a playback progress and head rotation information of the first terminal;

[0038] Video playback is performed based on the video synchronization message and the second video stream.

[0039] In one possible implementation, the method further includes:

[0040] Receiving a screen projection end request message from the first terminal;

[0041] A screen projection proxy end request message is sent to the proxy server, where the screen projection proxy end request message is used to request the proxy server to end the matching process for the first video stream.

[0042] Based on the above possible implementation methods, the screen projection process can be ended at any time, thereby avoiding unnecessary continuous screen projection, for example, when no one is watching the projected screen.

[0043] In the third aspect, a video screen projection device is provided for executing the above-mentioned video screen projection method. Specifically, the video screen projection device includes a functional module for executing the video screen projection method provided by the above-mentioned first aspect or any optional method of the above-mentioned first aspect, wherein the above-mentioned aspect is an aspect corresponding to a video screen projection method applied to a proxy server.

[0044] In a fourth aspect, a video screen projection device is provided for executing the above-mentioned video screen projection method. Specifically, the video screen projection device includes a functional module for executing the video screen projection method provided by the above-mentioned second aspect or any optional method of the above-mentioned second aspect, wherein the above-mentioned aspect is an aspect corresponding to a video screen projection method applied to a second terminal.

[0045] On the one hand, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement operations performed by the above-mentioned video projection method.

[0046] On the one hand, a computer-readable storage medium is provided, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the operations performed by the video projection method as described above.

[0047] The beneficial effects brought by the technical solution provided by the embodiments of the present invention are as follows:

[0048] The proxy server matches the video stream being played by the first terminal from the received video streams according to the network protocol address of the first terminal and the stream information of the video stream, and sends the video stream corresponding to the video being played by the first terminal to the second terminal, so that the second terminal can play the video indicated by the video stream, achieving the purpose of synchronous playback between the first terminal and the second terminal, avoiding the first terminal from sending the video stream to the second terminal, reducing the network pressure and power consumption of the first terminal, avoiding lags, and thus improving the projection quality. Description of the Drawings

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0050] Figure 1 is a schematic diagram of a video projection implementation environment provided by an embodiment of the present invention;

[0051] Figure 2 is a schematic diagram of the structure of the first terminal provided by an embodiment of the present invention;

[0052] Figure 3 is a schematic diagram of the structure of a second terminal provided by an embodiment of the present invention;

[0053] Figure 4 is a schematic diagram of the device structure of a proxy server provided by an embodiment of the present invention;

[0054] Figure 5 is a flowchart of a video projection method provided by an embodiment of the present invention;

[0055] Figure 6 is a flowchart of a video projection method provided by an embodiment of the present invention;

[0056] Figure 7 is a flowchart of a video projection method provided by an embodiment of the present invention;

[0057] Figure 8 is a flowchart of a video projection method provided by an embodiment of the present invention;

[0058] Figure 9 It is a schematic structural diagram of a video projection device provided by an embodiment of the present invention;

[0059] Figure 10 It is a schematic structural diagram of a video projection device provided by an embodiment of the present invention. Detailed implementation manners

[0060] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0061] Figure 1 It is a schematic diagram of a video projection implementation environment provided by an embodiment of the present invention. Refer to Figure 1 , in this implementation environment, it includes: a first terminal 101, a second terminal 102, a proxy server 103, and a video server 104. Among them, the first terminal 101, the second terminal 102, and the proxy server 103 are in the same local area network. The first terminal 101 is connected to the second terminal 102, the proxy server 103, and the video server 104 through a wireless network. The proxy server 103 can be connected to the second terminal through a network cable.

[0062] The first terminal 101 is a terminal for playing videos, and can play videos provided by the video server of the operator. Such videos can be movies, TV dramas, game videos, or real-time chat videos, etc. In the embodiments of the present invention, the first terminal can be the initiator of projection, and the video it plays can be the projection target. The first terminal can be a VR terminal for playing VR videos. VR videos mainly provide panoramic images that seamlessly connect 180 degrees up and down and 360 degrees horizontally centered on the human eye. When the video server 104 transmits a video stream to the first terminal 101, the video server 104 will push the entire 360-degree surround image to the first terminal 101, and then the first terminal 101 is responsible for tracking the change of the user's perspective and instantaneously completing the projection and display of the image. Therefore, the perspective will change at any time during the viewing of VR videos, so the first terminal 101 needs to periodically send video synchronization messages to the proxy server 103, so that the second terminal 102 can play the video picture being played by the first terminal 101 according to the video synchronization message forwarded by the proxy server 103 to achieve synchronization. Of course, the first terminal can also be other terminals that can play videos, and the embodiments of the present invention do not make specific limitations on this. The first terminal 101 can be an all-in-one machine and can be a user terminal of the operator's cloud VR service. Optionally, the first terminal 101 can be a VR glasses.

[0063] The second terminal 102 is a terminal with video playback capability, and can play the video indicated by the video stream according to the received video stream. In an embodiment of the present invention, the second terminal 102 can be used for screen projection display. The second terminal 102 can send a screen projection proxy request to the proxy server 103, and according to the video synchronization message periodically forwarded by the proxy server 103 and the video stream sent by the proxy server 103, play the video picture being played by the first terminal 101 to complete the screen projection display. Of course, the second terminal can also be other terminals for playing videos, as long as the screen projection display can be completed, and the embodiment of the present invention does not make specific limitations. The second terminal 102 can be a user terminal of an operator's broadband TV service, such as a set-top box.

[0064] The proxy server 103 is a unified network exit of the local area network and can serve as a proxy server for the second terminal 102. It is responsible for forwarding the information sent by the first terminal 101 to the second terminal 102, and sending the matched video stream being played by the first terminal 101 to the second terminal 102, so that the second terminal 102 can play the video screen being played by the first terminal 101 according to the information sent by it.

[0065] The video server 104 can store video files and is used to send a video stream to the first terminal 101 so that the first terminal 101 can play the video indicated by the video stream. The video server 104 can be a video server in the operator's video server cluster that interacts with the first terminal for video streams. The operator's video server cluster is composed of one or more scheduled video servers and multiple non-scheduled servers, and multiple non-scheduled servers can store the same video file. When the scheduling server receives a video stream request message from the first terminal 101, according to the information carried in the video stream request message, a non-scheduled video server that stores the target video file and is relatively idle is scheduled, and the non-scheduled video server sends the video stream to the first terminal 101. Of course, the video server that receives the video stream request message can also be a non-scheduled server, and the non-scheduled server sends the video stream to the first terminal 101. The implementation of the present invention does not specifically limit which video server receives the video stream request message.

[0066] It should be noted that when the first terminal 101 and the video server 104 perform information exchange, it needs to be completed through the network exit of the proxy server. That is, when the device in the local area network and the server or device in the external network perform information exchange, it needs to be completed with the help of the network exit of the proxy server 103. For example, when the video server 104 pushes the video stream to the first terminal 101, it needs to be transmitted through the network connection of the proxy server 103.

[0067] In addition, the first terminal 101 and the video server 104 support a streaming media transmission protocol, which may be the hypertext transfer protocol live streaming (HLS), or the real-time streaming protocol RTP, or other streaming media transmission protocols. The embodiments of the present invention do not specifically limit this.

[0068] In the implementation environment provided by the embodiments of the present invention, the above-mentioned first terminal, second terminal, and proxy server are configured in the same local area network. The proxy server serves as an information transfer medium between the first terminal and the second terminal, and can periodically forward the video synchronization message of the first terminal to the second terminal, so that the second terminal can play the same video picture synchronously with the first terminal.

[0069] The above is a simple description of the implementation environment and each participating device of the video projection method proposed by the present invention. For Figure 1 the hardware implementation of the terminal and proxy server involved, the following description is made:

[0070] Figure 2 FIG. is a schematic structural diagram of a first terminal provided by an embodiment of the present invention. The first terminal 200 may vary greatly due to different configurations or performances, and may include one or more video codecs 201, one or more central processing units (CPUs) 202, one or more memories 203, one or more sensors 204, and a transceiver 205. Among them, the video codec 201 can decode the digital video stored in the memory 203. At least one instruction is stored in the memory 203, and the at least one instruction is loaded and executed by the processor 202 to implement the methods executed on the first terminal side in the following various method embodiments. The sensor 204 can obtain the head rotation information of the user. The transceiver may be components such as a wired or wireless network interface, a keyboard, and an input / output interface for input / output. The first terminal may further include other components for implementing device functions, which will not be elaborated here. Of course, the first terminal has a display component, such as a display screen, etc., for displaying the picture output by the video codec 201.

[0071] In an exemplary embodiment, a computer-readable storage medium is further provided, such as a memory including instructions, and the above instructions can be executed by a processor in a first terminal to complete the video projection method in the following embodiments. For example, the computer-readable storage medium may be a read only memory image (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0072] Figure 3 FIG. 4 is a schematic structural diagram of a second terminal provided by an embodiment of the present invention. The second terminal 300 may vary greatly due to different configurations or performances, and may include one or more video codecs 301, one or more processors 302, and one or more memories 303. Among them, the video codec 301 can compress or decompress the digital video stored in the memory 303. At least one instruction is stored in the memory 303, and the at least one instruction is loaded and executed by the processor 302 to implement the methods provided by the above method embodiments. Of course, the second terminal may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input / output. The second terminal may also include other components for implementing the functions of the device, which will not be elaborated here. Of course, the first terminal has a display component, such as a display screen, etc., for displaying the picture output by the video codec 301.

[0073] In an exemplary embodiment, a computer-readable storage medium is further provided, such as a memory including instructions, and the above instructions can be executed by a processor in the second terminal to complete the video projection method in the following embodiments. For example, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0074] Figure 4 FIG. 5 is a schematic structural diagram of a proxy server provided by an embodiment of the present invention. The server 400 may vary greatly due to different configurations or performances, and may include one or more processors 401 and one or more memories 402. Among them, at least one instruction is stored in the memory 402, and the at least one instruction is loaded and executed by the processor 401 to implement the methods provided by the above method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input / output. The server may also include other components for implementing the functions of the device, which will not be elaborated here.

[0075] In an exemplary embodiment, a computer-readable storage medium is further provided, such as a memory including instructions, and the above instructions can be executed by a processor in a proxy server to complete the video projection method in the following embodiments. For example, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0076] The first terminal and the proxy server may default to support the same streaming media transmission protocol. For example, when both the first terminal and the proxy server support the HLS protocol, when the proxy server receives the video stream from the video server, it can directly use the HLS protocol to parse and match the video stream during the parsing process. Hereinafter, taking the case where both the first terminal and the proxy server support the HLS protocol as an example, the video projection method provided by the embodiments of the present invention will be introduced. Figure 5 is a flowchart of a video projection method provided by an embodiment of the present invention, and this embodiment may be based on Figure 1 the implementation environment shown. Refer to Figure 5 and this embodiment includes:

[0077] 501. When the first terminal receives a video playback instruction, it sends a video stream request message to the proxy server, and the video stream request message carries video URL information.

[0078] The video playback instruction may be triggered by a user's playback operation on the first terminal, and the playback operation may refer to a start operation of a game and a start playback operation of a video, and the embodiments of the present invention do not limit this. The video stream request message is used to request the video stream corresponding to the video URL information from the video server and return the video stream to the first terminal.

[0079] Wherein, the value of the message type field of the video stream request message may be a first string, and the first string is used to indicate that the message is a video stream request message. It should be noted that the "first", "second", etc. attributives involved in the embodiments of the present invention are not used to distinguish the content of specific fields or strings, but only to distinguish different request fields or strings.

[0080] 502. When the proxy server receives the video stream request message, it sends the video stream request message to the video server.

[0081] It should be noted that at this stage, the proxy server is only used to forward the received message, and the received message may be a message sent by the first terminal or a message sent by the video server.

[0082] 503. The video server sends a video stream to the proxy server based on the video stream request message.

[0083] In an embodiment of the present invention, the video server may obtain a video stream corresponding to the video URL information according to the video URL information in the video stream request message.

[0084] 504. After receiving the video stream, the proxy server sends the video stream to the first terminal.

[0085] 505. The first terminal plays based on the received video stream.

[0086] The above steps 501-505 describe the message interaction between the first terminal and the video server. During this process, the messages exchanged between the first terminal and the proxy server are all forwarded by the proxy server. When the first terminal plays a video based on the video stream, the user can initiate a screen mirroring operation on the first terminal to synchronize the currently playing video to another terminal for playing, thereby achieving screen mirroring.

[0087] 506. When the first terminal receives a screen mirroring instruction, it sends a screen mirroring request message to the proxy server. The screen mirroring request message carries at least video URL information.

[0088] Of course, the screen mirroring request message may also carry information about the second terminal, such as the network protocol address of the second terminal or the identifier of the second terminal, so as to determine the target device for screen mirroring.

[0089] Among them, the value of the message type field of the screen mirroring request message may be a second string, and the second string is used to indicate that the message is a screen mirroring request message. The screen mirroring request message is used to request to screen mirror the video stream being played on the first terminal to the second terminal.

[0090] It should be noted that in the embodiment of the present invention, the first terminal is taken as a VR terminal for illustration. Then the screen mirroring request message may also carry head rotation information. The head rotation information is used to represent the head rotation situation of the current user of the first terminal, so that the second terminal can play a video picture synchronized with the first terminal according to the head rotation information, as shown in steps 512 and 515. Of course, the first terminal may not necessarily carry head rotation information.

[0091] 507. After receiving the screen mirroring request message, the proxy server sends the screen mirroring request message to the second terminal.

[0092] The above steps 505 and 507 are both implemented by the local forwarding function provided by the proxy server for devices within the local area network, and the embodiments of the present invention do not elaborate on this.

[0093] It should be noted that at the current stage, the proxy server is only used to forward the received messages, and the received messages can be messages sent by the first terminal or messages sent by the video server.

[0094] 508. The second terminal sends a screen mirroring proxy request message to the proxy server according to the received screen mirroring request message, and the screen mirroring proxy request message carries at least video URL information.

[0095] For the stream information of the video stream, the stream information may include video URL information. Of course, the stream information may also include the network protocol address of the first terminal, so that the proxy server can perform matching according to the video URL information and the network protocol address of the first terminal.

[0096] Among them, the value of the message type field of the screen mirroring proxy request message can be a third string, and the third string is used to indicate that the message is a screen mirroring proxy request message, and the screen mirroring proxy request message is used to request the proxy server to screen mirror the video stream being played by the first terminal to the second terminal.

[0097] From steps 505 to 508, it can be known that in this screen mirroring process, the first terminal does not need to send the video stream to the second terminal, but transfers the process of obtaining the video stream to the proxy server, reducing the network pressure and power consumption of the first terminal.

[0098] 509. The proxy server matches the video stream sent by the video server according to the network protocol address of the first terminal and the video URL information of the first video stream, and the video server is used to provide the first video stream.

[0099] Since the proxy server can receive the video stream sent by the video server, when the proxy server receives the screen mirroring proxy request message, the proxy server can parse the received video stream to obtain the network protocol address of the target device of the video stream and the video URL information, and compare the network protocol address of the first terminal and the video URL information of the first video stream with the parsed network protocol address and video URL information. When the network protocol address of the first terminal and the video URL information of the first video stream are the same as the parsed network protocol address and video URL information, it means that the first video stream is matched.

[0100] 510. When the proxy server matches the first video stream, it copies the first video stream to obtain a second video stream.

[0101] It should be noted that when the proxy server starts monitoring the data interaction between the first terminal and the video server, the proxy server can store the video stream sent by the video server to the first terminal. Since there is a mapping relationship between the video URL information of the video stream and the data packets of the video stream, the proxy server can obtain the video stream indicated by the video URL information according to the video URL information.

[0102] Therefore, the proxy server copies the first video stream, that is, the proxy server copies the video stream indicated by the video URL information according to the above mapping relationship.

[0103] It should be noted that the second video stream is the video stream copied by the proxy server. The attributives such as "first" and "second" involved in the embodiments of the present invention are not used to distinguish the content of the video stream, but only to distinguish the original video stream and the copied video stream.

[0104] 511. The proxy server sends the second video stream to the second terminal.

[0105] Among them, the second video stream is used for video playback on the second terminal.

[0106] The copying and forwarding in the above steps 510 and 511 can be real-time copying and real-time forwarding to ensure a small delay, so that the entire screen mirroring process can proceed smoothly.

[0107] 512. When the second terminal receives the second video stream, it plays based on the second video stream.

[0108] It should be noted that for the embodiments of the present invention, when the second terminal plays a video based on the second video stream, the head rotation information also needs to be considered to ensure that the video picture played on the second terminal is the same as the video picture being played on the first terminal. Therefore, after the first terminal initiates screen mirroring, it can send the video synchronization message of the first terminal to the second terminal, so that when the second terminal starts playing, it can directly perform synchronous playback based on the video synchronization message. The video synchronization message includes the stream information of the first video stream, the playback progress, and the head rotation information of the first terminal.

[0109] 513. The first terminal periodically sends a video synchronization message to the proxy server. The video synchronization message includes the stream information of the first video stream, and the video synchronization message also includes at least one of the playback progress and the head rotation information of the first terminal.

[0110] Among them, in addition to the stream information, the video synchronization message may include the following information contents: (1) the playing progress and the head rotation information of the first terminal, (2) only the playing progress, (3) only the head rotation information of the first terminal. For any of the above information contents, the embodiments of the present invention do not make any limitations thereon.

[0111] Since the head rotation message of the VR video will change at any time during the playing process, and the first terminal may pause, fast forward, or rewind when playing the video, the first terminal may periodically send video synchronization messages, so that the second terminal can adjust the playing screen at any time based on the received video stream according to the content in the synchronization information forwarded by the proxy service, thereby synchronizing the video played by the second terminal with the video played by the first terminal. To achieve the effect of synchronous video playback, the period for the first terminal to send synchronization messages to the proxy server can be very short, and this period can be at the millisecond level.

[0112] 514. After receiving the video synchronization message, the proxy server sends the video synchronization message to the second terminal.

[0113] 515. The second terminal plays the video based on the video synchronization message and the received video stream.

[0114] The second terminal can determine the picture being played by the first terminal according to the information carried in the video synchronization message (such as head rotation information and playing progress) and the received video stream, so that the second terminal synchronously plays the video being played by the first terminal, thereby realizing the synchronous playback between the second terminal and the first terminal and achieving the purpose of screen mirroring.

[0115] It should be noted that when the second terminal periodically receives the video synchronization message, the second terminal periodically adjusts the played video picture according to the received video synchronization message to keep it synchronized with the video picture played by the first terminal.

[0116] When the playing state of the first terminal switches to fast forward, rewind, or pause, the changed playing state can be carried in the video synchronization message. For example, the changed playing state can be carried in the playing progress field. When the second terminal learns that the playing state of the first terminal has changed according to the video synchronization message, the second terminal can send a screen mirroring proxy request message to the proxy server again, so that the proxy server can re-match the video stream being played by the first terminal, copy the matched video stream, and send the copied video stream to the second terminal, so that the video played by the second terminal is synchronized with the video played by the first terminal, that is, the process from step 508 to step 515 is performed again.

[0117] 516. When the first terminal receives a screen mirroring end instruction, it sends a screen mirroring end request message to the proxy server.

[0118] The screen mirroring end instruction can be triggered by the user's end operation. For example, it is triggered when the user exits a video playback or a game application. Embodiments of the present invention do not limit how it is specifically triggered. Among them, the screen mirroring end request message is used to instruct the second terminal to stop screen mirroring.

[0119] Among them, the value of the message type field of the screen mirroring end request message can be a fourth string, and the fourth string is used to indicate that the message is a screen mirroring end request message, and the screen mirroring end request message is used to request the proxy server to end screen mirroring.

[0120] 517. After receiving the screen mirroring end request message, the proxy server sends the screen mirroring end request message to the second terminal.

[0121] The above steps 516 to 517 are the process of the proxy server forwarding messages for devices within the local area network, and this process will not be elaborated here.

[0122] 518. Based on the screen mirroring end request message, the second terminal sends a screen mirroring proxy end request message to the proxy server. The screen mirroring proxy end request message is used to request the proxy server to end the matching process of the first video stream.

[0123] Among them, the screen mirroring proxy end request message carries the network protocol address of the first terminal. The value of the message type field of the screen mirroring proxy end request message can be a fifth string, and the fifth string is used to indicate that the message is a screen mirroring proxy end request message, and the screen mirroring proxy end request message is used to request the proxy server to end screen mirroring.

[0124] 519. When the proxy server receives the screen mirroring proxy end request message, it stops the matching of the video stream.

[0125] When the proxy server receives the screen mirroring proxy end request message, it can stop parsing the video stream sent by the video server, and thus will not perform the matching of the video stream. As a result, the proxy server no longer sends the second video stream to the second terminal, and thus the screen mirroring of the first terminal on the second terminal ends.

[0126] The screen mirroring method provided by the embodiment of the present application enables the proxy server to match the video stream being played by the first terminal from the received video streams according to the network protocol address of the first terminal and the video URL information, and send the video stream corresponding to the video being played by the first terminal to the second terminal, so that the second terminal can play the video indicated by the video stream, achieving the purpose of synchronous playback between the first terminal and the second terminal. This avoids the first terminal from sending the video stream to the second terminal, reduces the network pressure and power consumption of the first terminal, and avoids lags, thereby improving the screen mirroring quality. Further, the first terminal periodically sends video synchronization messages so that the second terminal can play the video being played by the first terminal according to the video synchronization messages, thereby improving the synchronization effect.

[0127] The above embodiment is described by taking the case where both the first terminal and the proxy server support the HLS protocol, and the proxy server can match the first video stream. However, when both the first terminal and the proxy server support the HLS protocol, the proxy server may not be able to match the first video stream. For this situation, the present invention provides a video screen mirroring method, as Figure 6 shown.

[0128] Figure 6 is a flowchart of a video screen mirroring method provided by an embodiment of the present invention. This embodiment can be based on Figure 1 the shown implementation environment. Refer to Figure 6 , this embodiment includes:

[0129] 601. When the first terminal receives a video playback instruction, it sends a video stream request message to the proxy server, and the video stream request message carries video URL information.

[0130] 602. When the proxy server receives the video stream request message, it sends the video stream request message to the video server.

[0131] 603. The video server sends a video stream to the proxy server based on the video stream request message.

[0132] 604. When the proxy server receives the video stream, it sends the video stream to the first terminal.

[0133] 605. The first terminal plays based on the received video stream.

[0134] 606. When the first terminal receives a screen mirroring instruction, it sends a screen mirroring request message to the proxy server, and the screen mirroring request message carries at least video URL information.

[0135] 607. After receiving the screen mirroring request message, the proxy server sends the screen mirroring request message to the second terminal.

[0136] 608. The second terminal sends a screen mirroring proxy request message to the proxy server according to the received screen mirroring request message, and the screen mirroring proxy request message carries at least video URL information.

[0137] 609. The proxy server matches the video stream sent by the video server according to the network protocol address of the first terminal and the video URL information of the first video stream, and the video server is used to provide the first video stream.

[0138] 610. When the proxy server fails to match the first video stream according to the screen mirroring request message, it sends a video stream request message to the video server, and the video stream request message carries video URL information.

[0139] Among them, the value of the message type field of the video stream request message can be a third string, and the third string is used to indicate that the message is a video stream request message, and the video stream request message is used to request a video stream from the video server.

[0140] Based on the matching in step 609, the proxy server fails to match the first video stream. Since the first terminal uses the HLS protocol, it is very likely that some video fragments have been stored on the first terminal. And since the video URL information is constantly changing, based on the video URL information carried in the current screen mirroring proxy request message, it may not be possible to find the above video fragments in the data received after the proxy server starts proxying. Therefore, the proxy server needs to download the corresponding video stream data from the video server.

[0141] It should be noted that the proxy server can also store any received video stream during operation, so that it can be matched based on the pre-stored data when receiving the screen mirroring proxy request message. Of course, it can store only the video stream within a preset duration each time. For example, it only stores the video stream received in the past 5 seconds, and deletes the video stream more than 5 minutes ago according to the first-in-first-out principle.

[0142] 611. The video server receives the video stream request message.

[0143] 612. When the video server receives the video stream request message, it sends a third video stream to the proxy server.

[0144] Among them, the third video stream is the video stream obtained by the video server based on the video URL information sent by the proxy server. And the third video stream is the video stream being played on the first terminal.

[0145] 613. After the proxy server receives the third video stream, it sends the third video stream to the second terminal, and the third video stream is used for video playback on the second terminal.

[0146] It should be noted that the third video stream can be stored in the proxy server based on the mapping relationship between the video URL information and the video stream data packet.

[0147] Steps 609 to 613 are the steps executed by the proxy server when the stored video URL information cannot match the first video stream. Through these steps, the proxy server can obtain some video shards that have been downloaded by the first terminal, avoiding the problem of out-of-sync screen mirroring caused by data loss and improving the screen mirroring effect and quality.

[0148] 614. After the second terminal receives the third video stream, it plays based on the third video stream.

[0149] 615. The first terminal periodically sends a video synchronization message to the proxy server. The video synchronization message includes the stream information of the first video stream, and the video synchronization message also includes any one of the playback progress and the head rotation information of the first terminal.

[0150] 616. After the proxy server receives the video synchronization message, it sends the video synchronization message to the second terminal.

[0151] 617. The second terminal plays the video based on the video synchronization message and the received video stream.

[0152] 618. When the first terminal receives the screen mirroring end instruction, it sends a screen mirroring end request message to the proxy server.

[0153] 619. After the proxy server receives the screen mirroring end request message, it sends the screen mirroring end request message to the second terminal.

[0154] 620. The second terminal sends a screen mirroring proxy end request message to the proxy server based on the screen mirroring end request message. The screen mirroring proxy end request message is used to request the proxy server to end the matching process of the first video stream.

[0155] 621. After the proxy server receives the screen mirroring proxy end request message, it stops matching the video stream.

[0156] The screen mirroring method provided by the embodiments of the present application can, through a proxy server, request the video stream being played by a first terminal from a video server based on video URL information and the network protocol address of the video server, and send the video stream obtained based on this request to a second terminal, so that the second terminal can play the video indicated by the video stream, achieving the purpose of synchronous playback between the first terminal and the second terminal. This can avoid the phenomenon of asynchronous screen mirroring caused by the proxy server being unable to match the video stream being played by the first terminal, and avoid the first terminal from sending the video stream to the second terminal, reducing the network pressure and power consumption of the first terminal and avoiding lag, thereby improving the screen mirroring quality. Further, the first terminal periodically sends video synchronization messages so that the second terminal can play the video being played by the first terminal according to the video synchronization messages, thereby further improving the synchronization effect.

[0157] The above embodiments are described by taking the first terminal within a local area network and the proxy server defaulting to support the HLS protocol as an example. In some embodiments, for example, when both the first terminal and the proxy server default to support the RTP protocol, the video screen mirroring method provided by the embodiments of the present invention will be introduced below by taking the first terminal and the proxy server both supporting the RTP protocol as an example. The differences from the Figure 5 embodiments shown are mainly that the information carried in the interaction message for indicating the video being played by the first terminal is a five-tuple. Figure 7 is a flowchart of a video screen mirroring method provided by the embodiments of the present invention. This embodiment can be based on the Figure 1 shown implementation environment. Refer to Figure 7 . This embodiment includes:

[0158] 701. When the first terminal receives a video playback instruction, it sends a video stream request message to the proxy server, and this video stream request message carries video URL information.

[0159] 702. When the proxy server receives this video stream request message, it sends this video stream request message to the video server.

[0160] 703. The video server sends a video stream to the proxy server based on this video stream request message.

[0161] 704. When the proxy server receives this video stream, it sends this video stream to the first terminal.

[0162] 705. The first terminal plays based on the received video stream according to this video stream.

[0163] 706. When the first terminal receives a screen mirroring instruction, it sends a screen mirroring request message to the proxy server, and this screen mirroring request message carries the five-tuple of the first video stream.

[0164] 707. After receiving the screen mirroring request message, the proxy server sends the screen mirroring request message to the second terminal.

[0165] 708. The second terminal receives the screen mirroring request.

[0166] 709. The second terminal sends a screen mirroring proxy request message to the proxy server according to the received screen mirroring request message, and the screen mirroring proxy request message carries the five-tuple of the first video stream.

[0167] 710. The proxy server receives the screen mirroring proxy request.

[0168] 711. The proxy server matches the data stream sent by the video server according to the five-tuple of the first video stream, and the video server is used to provide the first video stream.

[0169] Since the proxy server can receive the video stream sent by the video server, when the proxy server receives the screen mirroring proxy request message, the proxy server can parse the received video stream to obtain the five-tuple of the video stream, and compare the five-tuple of the first video stream in the screen mirroring proxy request message with the parsed five-tuple. When they are the same, it means that the first video stream is matched.

[0170] 712. When the proxy server matches the first video stream, it copies the first video stream to obtain the second video stream.

[0171] 713. The proxy server sends the second video stream to the second terminal.

[0172] 714. The second terminal receives the second video stream.

[0173] 715. When the second terminal receives the second video stream, it plays based on the second video stream.

[0174] 716. The first terminal periodically sends a video synchronization message to the proxy server, and the video synchronization message includes the stream information of the first video stream. The video synchronization message also includes any one of the playback progress and the head rotation information of the first terminal.

[0175] 717. When the proxy server receives the video synchronization message, it sends the video synchronization message to the second terminal.

[0176] 718. The second terminal receives the video synchronization message.

[0177] 719. The second terminal plays the video based on the video synchronization message and the received video stream.

[0178] 720. When the first terminal receives a screen mirroring end instruction, it sends a screen mirroring end request message to the proxy server.

[0179] 721. When the proxy server receives the screen mirroring end request message, it sends the screen mirroring end request message to the second terminal.

[0180] 722. The second terminal receives the screen mirroring end request message.

[0181] 723. Based on the screen mirroring end request message, the second terminal sends a screen mirroring proxy end request message to the proxy server, and the screen mirroring proxy end request message is used to request the proxy server to end the matching process of the first video stream.

[0182] 724. The proxy server receives the screen mirroring end request message.

[0183] 725. When the proxy server receives the screen mirroring proxy end request message, it stops the matching of the video stream.

[0184] The above steps 701 to 725 are the same as steps 601 to 621. The main difference is that the information carried in the interactive message for indicating the video being played by the first terminal is a five-tuple, and other steps are not limited.

[0185] The screen mirroring method provided by the embodiments of the present application enables the proxy server to match the video stream being played by the first terminal from the received video streams according to the five-tuple, and send the video stream corresponding to the video being played by the first terminal to the second terminal, so that the second terminal can play the video indicated by the video stream, achieving the purpose of synchronous playback between the first terminal and the second terminal, avoiding the first terminal from sending the video stream to the second terminal, reducing the network pressure and power consumption of the first terminal, avoiding stuttering, and thus improving the screen mirroring quality. Further, the first terminal periodically sends video synchronization messages so that the second terminal can play the video being played by the first terminal according to the video synchronization messages, thereby improving the synchronization effect.

[0186] The above embodiments are described by taking the first terminal in the local area network and the proxy server defaulting to support the HLS protocol or the RTP protocol as an example. In some embodiments, the first terminal may support both the HLS protocol and the RTP protocol, and when interacting with the video server, it may adopt any of the above protocols. Therefore, the proxy server can identify the supported protocol through the message sent by the first terminal, so as to realize the matching of the video stream. Figure 8 It is a flowchart of a video screen mirroring method provided by an embodiment of the present invention, and this embodiment can be based on Figure 1 the shown implementation environment. Refer to Figure 8 and this embodiment includes:

[0187] 801. When the first terminal receives a video playback instruction, it sends a video stream request message to the proxy server, and the video stream request message carries video URL information.

[0188] 802. When the proxy server receives the video stream request message, it sends the video stream request message to the video server.

[0189] 803. The video server sends a video stream to the proxy server based on the video stream request message.

[0190] 804. When the proxy server receives the video stream, it sends the video stream to the first terminal.

[0191] 805. The first terminal plays based on the received video stream according to the video stream.

[0192] 806. When the first terminal receives a screen mirroring instruction, it sends a screen mirroring request message to the proxy server. The screen mirroring request message carries at least the stream information of the first video stream being played by the first terminal and a protocol type field, and the protocol type field is used to indicate the streaming media transmission protocol adopted by the first terminal.

[0193] The first terminal can determine the value of the protocol type field according to the streaming media transmission protocol it supports, and different values of the protocol type field correspond to different streaming media transmission protocols.

[0194] For example, when the value of the protocol type field is 0, it means that the streaming media transmission protocol adopted by the first terminal is the HLS protocol. When the value of the protocol type field is 1, it means that the streaming media transmission protocol adopted by the first terminal is the RTP protocol. Of course, the protocol type field can also be represented in other forms such as other numerical values or strings, and the embodiments of the present invention do not specifically limit this.

[0195] 807. After receiving the screen mirroring request message, the proxy server sends the screen mirroring request message to the second terminal.

[0196] 808. The second terminal sends a screen mirroring proxy request message to the proxy server according to the received screen mirroring request message. The screen mirroring proxy request message carries at least the stream information of the first video stream being played by the first terminal and the protocol type field.

[0197] 809. The proxy server determines the target streaming media transmission protocol according to the protocol type field in the screen mirroring proxy request message. The target streaming media transmission protocol is the streaming media transmission protocol adopted by the first terminal, and different values of the protocol type field correspond to different streaming media transmission protocols.

[0198] As can be seen from step 806, the protocol type field can indicate the streaming media transmission protocol supported by the first terminal. For example, when the protocol type field is 0, the streaming media transmission protocol adopted by the first terminal is the HLS protocol. When the protocol type field is 1, the streaming media transmission protocol adopted by the first terminal is the RTP protocol.

[0199] 810. The proxy server matches the video stream sent by the video server based on the target streaming media transmission protocol, and the video server is used to provide the first video stream.

[0200] It should be noted that in step 810, when determining the target streaming media transmission protocol, the stream information corresponding to the target streaming media transmission protocol can be extracted from the screen mirroring proxy request message, and the received video stream can be parsed using the target streaming media transmission protocol, and the parsed stream information is compared with the extracted stream information to perform the above matching process.

[0201] For example, after the proxy server receives the screen mirroring proxy request message, when the protocol type field is 0, it indicates that the streaming media transmission protocol adopted by the first terminal is the HLS protocol, and the stream information of the first video stream is the network protocol address of the first terminal and the video URL information. The proxy server can parse the received video stream to obtain the network protocol address of the target device of the video stream and the video URL information, and compare the network protocol address of the first terminal and the video URL information of the first video stream with the parsed network protocol address and video URL information. When the network protocol address of the first terminal and the video URL information of the first video stream are the same as the parsed network protocol address and video URL information, it indicates that the first video stream has been matched.

[0202] After the proxy server receives the screen mirroring proxy request message, when the protocol type field is 1, it indicates that the streaming media transmission protocol adopted by the first terminal is the RTP protocol, that is, the stream information of the first video stream is a five-tuple. The proxy server can parse the received video stream to obtain the five-tuple of the video stream, and compare the five-tuple in the screen mirroring proxy request message with the parsed five-tuple. When they are the same, it indicates that the first video stream has been matched.

[0203] 811. When the proxy server matches the first video stream, it copies the first video stream to obtain the second video stream.

[0204] 812. The proxy server sends the second video stream to the second terminal.

[0205] 813. When the second terminal receives the second video stream, it plays based on the second video stream.

[0206] 814. The first terminal periodically sends a video synchronization message to the proxy server. The video synchronization message includes the stream information of the first video stream, and the video synchronization message further includes any one of the playback progress and the head rotation information of the first terminal.

[0207] 815. After receiving the video synchronization message, the proxy server periodically sends the video synchronization message to the second terminal.

[0208] 816. The second terminal plays the video based on the video synchronization message and the received video stream.

[0209] 817. When the first terminal receives the screen mirroring end instruction, it sends a screen mirroring end request message to the proxy server.

[0210] 818. After receiving the screen mirroring end request message, the proxy server sends the screen mirroring end request message to the second terminal.

[0211] 819. Based on the screen mirroring end request message, the second terminal sends a screen mirroring proxy end request message to the proxy server. The screen mirroring proxy end request message is used to request the proxy server to end the matching process of the first video stream.

[0212] 820. After receiving the screen mirroring proxy end request message, the proxy server stops matching the video stream.

[0213] It should be noted that when the streaming media transmission protocol adopted by the first terminal is the HLS protocol, in the initial stage of proxy by the proxy server, since the video segments already stored by the first terminal have not been downloaded, the first video stream may not be matched. To avoid the phenomenon of out-of-sync screen mirroring caused by data loss, steps 610 to 612 need to be performed so that the second terminal can play the third video stream.

[0214] The screen mirroring method provided by the embodiments of the present application enables a proxy server to match the video stream being played by a first terminal from the received video streams according to the network protocol address of the first terminal and the information of the video stream, and send the video stream corresponding to the video being played by the first terminal to a second terminal, so that the second terminal can play the video indicated by the video stream, achieving the purpose of synchronous playback between the first terminal and the second terminal, avoiding the first terminal from sending the video stream to the second terminal, reducing the network pressure and power consumption of the first terminal, avoiding lags, and thus improving the screen mirroring quality. Further, the first terminal periodically sends video synchronization messages, so that the second terminal can play the video being played by the first terminal according to the video synchronization messages, thereby improving the synchronization effect. In addition, the proxy server can adopt different parsing strategies according to the protocol type field in the screen mirroring proxy request information to achieve adaptive and differential processing for videos with different streaming media transmission protocols.

[0215] Figure 9 FIG. 4 is a schematic structural diagram of a video screen mirroring device provided by an embodiment of the present invention. The device includes: a first receiving module 901, a matching module 902, an obtaining module 903, and a first sending module 904

[0216] The first receiving module 901 is configured to execute the above step 710;

[0217] The matching module 902 is configured to execute the above step 711;

[0218] The obtaining module 903 is configured to execute the above step 712;

[0219] The first sending module 904 is configured to execute the above step 713.

[0220] Optionally, the first video stream is an RTP stream, and the stream information of the first video stream includes a five-tuple, see step 706.

[0221] Optionally, the stream information of the first video stream includes video URL information, see step 606.

[0222] Optionally, the device further includes:

[0223] A second sending module, configured to execute the above step 610;

[0224] A second receiving module, configured to execute the above step 611;

[0225] A third sending module, configured to execute the above step 612.

[0226] Optionally, the stream information of the first video stream further includes the network protocol address of the first terminal.

[0227] Optionally, the device further includes:

[0228] A determination module, configured to execute step 809 above;

[0229] An execution module, configured to execute step 810 above.

[0230] Optionally, the device further includes:

[0231] A third receiving module, configured to execute step 717 above.

[0232] Optionally, the device further includes:

[0233] A fourth receiving module, configured to execute step 724 above;

[0234] A stop module, configured to execute step 725 above.

[0235] Figure 10 It is a schematic structural diagram of a video projection device provided by an embodiment of the present invention. The device includes: a first receiving module 1001, a first sending module 1002, a second receiving module 1003, a third receiving module 1004, and a playing module 1005

[0236] The first receiving module 1001 is configured to execute step 708 above;

[0237] The first sending module 1002 is configured to execute step 709 above;

[0238] The second receiving module 1003 is configured to execute step 714 above;

[0239] The third receiving module 1004 is configured to execute step 718 above;

[0240] The playing module 1005 is configured to execute step 719 above.

[0241] Optionally, the first video stream is an RTP stream, and the stream information of the first video stream includes a five-tuple, see step 706.

[0242] Optionally, the stream information of the first video stream includes video URL information, see step 606.

[0243] Optionally, the stream information of the first video stream further includes the network protocol address of the first terminal.

[0244] Optionally, the protocol type field of the projection proxy request message is used to indicate the streaming media transmission protocol adopted by the first terminal, see step 809.

[0245] Optionally, the device further includes:

[0246] A fourth receiving module, configured to execute step 722 above;

[0247] A second sending module, configured to execute the above step 723.

[0248] Any combination of the above optional technical solutions can be adopted to form alternative embodiments of the present disclosure, which will not be elaborated one by one here.

[0249] It should be noted that when the video projection device provided in the above embodiment projects a video, only the division of the above functional modules is used for illustration. In actual applications, the above functions can be assigned to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the video projection device provided in the above embodiment and the method embodiment of video projection belong to the same concept. For the specific implementation process, please refer to the method embodiment, which will not be elaborated here.

[0250] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A video projection method, characterized in that, it is applied to a proxy server, and the proxy server is in the same local area network as a first terminal and a second terminal. The method includes: Receiving a first video stream sent by a video server outside the local area network; Sending the first video stream to the first terminal, where the first video stream is used for video playback on the first terminal; Receiving a screen projection proxy request message from the second terminal; According to the screen projection proxy request message, copying the first video stream to obtain a second video stream; Sending the second video stream to the second terminal, where the second video stream is used for video playback on the second terminal.

2. The method according to claim 1, characterized in that, the screen projection proxy request message carries at least stream information of the first video stream, and the step of copying the first video stream according to the screen projection proxy request message to obtain a second video stream includes: Matching a data stream sent by the video server to the first terminal according to the stream information of the first video stream carried in the screen projection proxy request message, where the data stream includes the first video stream; When the first video stream is matched, copying the first video stream to obtain a second video stream.

3. The method according to claim 2, characterized in that, the first video stream is a Real-Time Streaming Protocol (RTP) stream, and the stream information of the first video stream includes a five-tuple.

4. The method according to claim 2, characterized in that, the stream information of the first video stream includes video Uniform Resource Locator (URL) information.

5. The method according to any one of claims 4, characterized in that, the screen projection proxy request message further includes the network protocol address of the video server, and the method further includes: When the first video stream is not matched, sending a video stream request message to the video server according to the screen projection proxy request message of the second terminal, where the video stream request message carries video URL information; Receiving a third video stream, where the third video stream is the video stream corresponding to the video URL information carried in the video stream request message; Sending the third video stream to the second terminal.

6. The method according to any one of claims 1-5, characterized in that, the step of copying the first video stream according to the screen projection proxy request message to obtain a second video stream includes: Determining a target streaming media transmission protocol according to a protocol type field in the screen projection proxy request message, where the target streaming media transmission protocol is the streaming media transmission protocol adopted by the first terminal, and different values of the protocol type field correspond to different streaming media transmission protocols; Based on the target streaming media transmission protocol, performing the step of matching the data stream sent by the video server to the first terminal according to the stream information of the first video stream carried in the screen projection proxy request message.

7. The method according to any one of claims 1-5, characterized in that, the method further includes: Receive the video synchronization message periodically sent by the first terminal, and forward the video synchronization message to the second terminal. The video synchronization message includes the stream information of the first video stream, and the video synchronization message further includes at least one of the playing progress and the head rotation information of the first terminal.

8. The method according to any one of claims 1-5, wherein, the method further includes: Receive the screen mirroring proxy end request message from the second terminal, where the screen mirroring proxy end request message is used to request the proxy server to end the replication process of the first video stream; Based on the screen mirroring proxy end request message, stop replicating the first video stream.

9. The method according to any one of claims 1-5, wherein, the screen mirroring proxy request message is sent by the second terminal based on the received screen mirroring request message.

10. A video screen mirroring method, wherein, applied to the second terminal, the second terminal and the proxy server and the first terminal are in the same local area network, and the proxy server is configured to send the first video stream to the first terminal after receiving the first video stream sent by the video server; the method includes: Receive the screen mirroring request message from the first terminal; Based on the screen mirroring request message, send a screen mirroring proxy request message to the proxy server; Receive the second video stream sent by the proxy server, where the second video stream is obtained by the proxy server replicating the first video stream, and the first video stream is the video stream being played by the first terminal; Play the second video stream.

11. The method according to claim 10, wherein, the screen mirroring request message carries at least the stream information of the first video stream, and the screen mirroring proxy request message carries at least the stream information of the first video stream.

12. The method according to claim 11, wherein, the first video stream is an RTP stream, and the stream information of the first video stream includes a five-tuple.

13. The method according to claim 11, wherein, the stream information of the first video stream includes video uniform resource locator (URL) information.

14. The method according to any one of claims 10-13, wherein, the method further includes: Receive the video synchronization message sent by the first terminal, where the video synchronization message includes the stream information of the first video stream, and the video synchronization message further includes any one of the playing progress and the head rotation information of the first terminal; The step of playing the second video stream includes: Based on the video synchronization message, play the second video stream.

15. The method according to any one of claims 10-13, wherein, the method further includes: Receive the screen mirroring end request message from the first terminal; Send a screen mirroring proxy end request message to the proxy server, where the screen mirroring proxy end request message is used to request the proxy server to end the replication process of the first video stream.

16. A computer device, wherein, The computer device includes a processor and a memory, and at least one instruction is stored in the memory, and the instruction is loaded by the processor to cause the computer device to execute the video projection method according to any one of claims 1 to 9.

17. A terminal device, characterized in that the terminal device includes a processor and a memory, and at least one instruction is stored in the memory, and the instruction is loaded by the processor to cause the terminal device to execute the video projection method according to any one of claims 10 to 15.

18. A computer-readable storage medium, characterized in that at least one instruction is stored in the storage medium, and the instruction is loaded by a processor to execute the video projection method according to any one of claims 1 to 15.

Citation Information

Patent Citations

  • Media content sharing

    US20130282793A1