Video processing method, device, electronic device and storage medium
By receiving server-side position synchronization data in a wide area network environment and combining network delay and predicted position data, the target display position of the moving object is determined, which solves the problem of position synchronization error and repeated jumping caused by network delay, and achieves a smooth transition effect.
Patent Information
- Application Number
- CN202210730141.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-06-24
AI Technical Summary
In the existing technology, due to unstable network delay in a wide area network environment, large errors and repeated horizontal jumps occur in the position synchronization of moving objects, which affects the display effect.
By receiving the position synchronization data sent by the server, the alternative position data is determined based on the network delay, and combined with the predicted position data of the current video frame and the current position data of the target moving object, the target display position of the next video frame is determined to avoid network delays. Position bounces caused by latency.
It realizes the smooth transition effect of moving objects in each video frame under the condition of unstable network delay, and improves the accuracy and stability of position synchronization.
Smart Images

Figure CN115089961B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular to a video processing method, device, electronic device, and storage medium. Background Art
[0002] In online game scenarios, it is usually necessary to synchronize the positions of moving objects, that is, it is necessary to determine the display positions of the moving objects in each video frame.
[0003] The main method used in existing position synchronization is to determine the time delay based on the sending timestamp of the position synchronization data sent by the server and the receiving timestamp of the position synchronization data received by the client, and then determine the display position of the moving object in each video frame based on the time delay to achieve the effect of position synchronization.
[0004] However, the above method is only applicable to local area networks. For wide area networks, network delays are unstable for each electronic device. When position synchronization is performed based on the above method, the synchronized position will repeatedly jump within a large error range, greatly reducing the display effect. Summary of the invention
[0005] The present disclosure provides a video processing method, device, electronic device and storage medium to accurately and effectively determine and display the target display position of a moving object, so as to achieve a synchronous and smooth transition effect of the position.
[0006] In a first aspect, an embodiment of the present disclosure provides a video processing method, the method comprising:
[0007] Receive location synchronization data sent by the server;
[0008] Determining candidate position data according to the position synchronization data and current position data of the current video frame;
[0009] Determine a target display position of a next video frame according to the candidate position data, the predicted position data of a preset number of frames after the current video frame, and the current position data of the target moving object in the current video frame;
[0010] The target moving object is controlled to be displayed at the target display position of the next video frame.
[0011] In a second aspect, an embodiment of the present disclosure further provides a video processing device, the device comprising:
[0012] A synchronization data receiving module, used to receive location synchronization data sent by the server;
[0013] An alternative position determination module, used to determine the alternative position data according to the position synchronization data and the current position data of the current video frame;
[0014] A display position determination module, configured to determine a target display position of a next video frame according to the candidate position data, the predicted position data of a preset number of frames after the current video frame, and the current position data of the target moving object in the current video frame;
[0015] The target position display module is used to control the target moving object to be displayed at the target display position of the next video frame.
[0016] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0017] one or more processors;
[0018] a storage device for storing one or more programs,
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the video processing method as described in any one of the embodiments of the present disclosure.
[0020] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the video processing method as described in any one of the embodiments of the present disclosure.
[0021] The technical solution provided by the embodiment of the present disclosure can determine alternative position data, that is, position data determined based on network delay, according to the synchronous position data and the current position data of the current video frame after receiving the synchronous position data sent by the server; then, according to the alternative position data, the predicted position data of a preset number of frames after the current video frame, and the current position data, the target display position of the next video frame can be determined, and the target object can be controlled to be displayed at the target display position of the next video frame, which solves the problem that the target display position is determined only according to the network delay in the prior art and cannot be applied to the situation where the network delay duration is unstable. It is achieved that under the condition of unstable network delay, the alternative position data can be determined first, and then the predicted position data can be determined based on the alternative position data, and then the target display position for display to the next video frame can be determined based on the predicted position data, so as to avoid the problem of repeated horizontal jumping of the target display position within a certain degree due to network delay, and achieve the technical effect of smooth transition of the target moving object in each video frame. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0023] Figure 1 A schematic diagram of a video processing method provided by an embodiment of the present disclosure;
[0024] Figure 2 A schematic diagram of a difference provided by an embodiment of the present disclosure;
[0025] Figure 3 A schematic diagram of determining a target position provided by an embodiment of the present disclosure;
[0026] Figure 4 A schematic diagram of determining a target position provided by an embodiment of the present disclosure;
[0027] Figure 5 A schematic diagram of the structure of a video processing device provided by an embodiment of the present disclosure;
[0028] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0030] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0031] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0032] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0033] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0034] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0035] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0036] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0037] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0038] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0039] Before introducing the technical solution provided by the embodiment of the present disclosure, an exemplary description of the application scenario can be given. The technical solution provided by the embodiment of the present disclosure can be applied in any scenario requiring position synchronization. Optionally, the scenario of position synchronization can include a game scenario, such as a scenario in a racing game requiring a user identifier to be displayed synchronously with a corresponding racing car.
[0040] Figure 1A flow chart of a video processing method provided by an embodiment of the present disclosure is provided. The embodiment of the present disclosure is applicable to dynamically determining the target display position of a target moving object in a corresponding video frame and displaying it, thereby obtaining a target video. The method can be executed by a video processing device, which can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal, a PC or a server, etc. It should also be noted that the technical implementation of the embodiment of the present disclosure can be executed by a server, or by a client, or by a server and a client in cooperation.
[0041] like Figure 1 As shown, the method includes:
[0042] S110: Receive location synchronization data sent by the server.
[0043] When the user plays games or shoots videos on the client, the user can receive the position synchronization data sent by the server in real time or intermittently. The position synchronization data mainly includes the display position of the target moving object and the timestamp of sending the display position.
[0044] It should be noted that whether the server sends the position synchronization data in real time or intermittently corresponds to the pre-configured position synchronization frame rate. Optionally, the application scenario is position synchronization in a racing scene, the rendering frame rate is 30 frames, and the position synchronization frame rate is 15 frames, which means that position synchronization is performed 15 times per second, that is, the server will send 15 position synchronization data per second.
[0045] Specifically, the server sends position synchronization data of at least one target moving object based on a preconfigured position synchronization frame rate, and each client can receive the position synchronization data sent by the server to determine the target display position where the target moving object will be rendered in the next video frame.
[0046] In the embodiment of the present disclosure, before receiving the location synchronization data sent by the server, it also includes: configuring the location synchronization frame rate for the server, so that the server sends the location synchronization data based on the location synchronization frame rate.
[0047] It should be noted that the technical solution provided by the embodiment of the present disclosure can be integrated into any software or page. The corresponding instance can be deployed in a wide area network, that is, users in different areas can use the data network or WLAN to enter the corresponding application scenario at the same time to obtain the final target video.
[0048] In order to achieve the effect of carrying a large number of users and accurate location synchronization, the location synchronization frame rate of the server can be pre-configured to send location synchronization data based on the location synchronization frame rate.
[0049] Among them, the position synchronization frame rate can be understood as the frequency of sending position synchronization data per second. Optionally, if the rendering frame rate is 30 frames per second, the position synchronization frame rate can be 15 frames per second, that is, only 15 position synchronizations are performed per second. The specific position synchronization frame rate can be configured by the developer according to actual needs.
[0050] In the embodiment of the present disclosure, the benefit of setting the synchronization position frame rate is that if the application instance is deployed in a wide area network, the position synchronization frame rate can be lowered considering the large number of users and the unstable network delay duration for each user, so as to perform position synchronization based on the lowered position synchronization frame rate, thereby improving the accuracy of position synchronization and reducing resource consumption.
[0051] S120: Determine candidate location data according to the location synchronization data.
[0052] It should be noted that the server sends the location synchronization data to the client based on network transmission, and the network transmission process has a certain delay, usually about 30ms from the server to the client. In other words, the location synchronization data received by the client is sent from the server 30ms ago. In order to avoid the problem of inaccurate positioning due to network delay, alternative location data can be determined based on network delay.
[0053] The candidate position data may be understood as position data determined based on the position synchronization data sent by the server and the current position data of the current video frame. The position synchronization data includes synchronization position information and timestamp information.
[0054] Specifically, the client can determine the candidate location data corresponding to the location synchronization data according to the received location synchronization data and the preset network delay duration, so as to solve the problem of accurate synchronization of location data caused by network delay.
[0055] It should be noted that the network delay duration varies for different electronic devices and at different times. In order to further improve the accuracy of position synchronization, the network delay duration can be dynamically determined, and the candidate position data can be first determined based on the network delay duration, so as to determine the final target display position based on the candidate position data.
[0056] In this embodiment, determining the candidate position data according to the position synchronization data may be: determining the candidate position data according to the synchronization position information and synchronization timestamp in the position synchronization data and the reception timestamp of the position synchronization data.
[0057] The receiving timestamp is the time corresponding to the receiving of the location synchronization data. The synchronization timestamp in the location synchronization data is the timestamp corresponding to when the server sends the location synchronization data.
[0058] It can be understood that: the network delay duration can be determined based on the synchronization timestamp in the synchronization location data and the reception timestamp of the received location synchronization data; and then the alternative location data is determined based on the synchronization location information and the network delay duration.
[0059] Optionally, alternative position data is determined based on the synchronization position information and synchronization timestamp in the position synchronization data and the receiving timestamp of the received position synchronization data, including: determining the time difference based on the synchronization timestamp in the position synchronization data and the receiving timestamp of the received position synchronization data; determining the offset distance based on the time difference and the movement speed of the target moving object; determining the alternative position data based on the offset distance and the synchronization position information in the position synchronization data.
[0060] The time difference can be understood as the network delay time for the server to transmit the data network to the client. The target moving object is a game object or character object moving in the display interface, and optionally, the game object is a bee. The movement speed of the game object can be pre-set during the development stage, that is, when the game object or character object is not controlled, it can move at the set movement speed. The offset distance is the distance that the target moving object can move within the network delay time.
[0061] Specifically, after the client receives the position synchronization data, the synchronization timestamp in the position synchronization data can be obtained and the receiving timestamp when the position synchronization data is received can be determined. Based on the synchronization timestamp and the receiving timestamp, the network delay duration, that is, the time difference, can be determined. Based on the product of the pre-set movement speed and the network delay duration, the distance that the target moving object can move within the network delay duration, that is, the offset distance, can be determined. Based on the synchronization position information and the offset distance in the position synchronization data, the alternative position data can be determined.
[0062] S130, determining a target display position of a next video frame according to the candidate position data, the predicted position data of a preset number of frames after the current video frame, and the current position data of the target moving object in the current video frame.
[0063] Among them, the preset number of frames is determined according to the rendering time of each frame. Usually, 30 frames can be rendered in 1s, and 10 frames are about 333ms. The difference from the current position is smoothly moved to the next position within 333ms. The movement is considered to be smooth, that is, a smooth transition, that is, the position transition within 333ms is a smooth transition for the user. At this time, the preset number of frames can be 10 frames. The predicted position data is the position data determined based on the alternative position data and the preset number of frames. The current position data is the position data of the target moving object in the current video frame. The target display position is the display position of the target object in the next video frame.
[0064] In this embodiment, the target display position of the next video frame is determined based on the alternative position data, the predicted position data of a preset number of frames after the current video frame, and the current position data of the target moving object in the current video frame, including: determining the predicted position data of a preset number of frames after the current video frame based on the alternative position data and the preset position offset per frame; determining the target display position of the next video frame by processing the difference between the predicted position data and the current position data.
[0065] The preset position offset of each frame is set in the development stage. The difference processing can be understood as follows: Figure 2 , the position synchronization data received in the first frame corresponds to point A, and the position synchronization data received in the third frame corresponds to point B. If no position synchronization data is received in the second frame, then the position synchronization data of the second frame should be between point A and point B. Correspondingly, during the game movement, only the position synchronization data of the first frame and the tenth frame are received, then the position synchronization data between the first frame and the tenth frame can be: Xn=X A +(X B -X A )*n / 10
[0066] Yn=Y A +(Y B -Y A )*n / 10
[0067] Where n represents any frame between the first frame and the tenth frame, X A Indicates the horizontal coordinate of the first frame position synchronization data, X B Indicates the horizontal coordinate of the second frame position synchronization data, Y A Indicates the vertical coordinate of the first frame position synchronization data, Y B The vertical coordinate representing the first frame position synchronization data.
[0068] The advantage of using the difference method is that when the position synchronization frame rate is low, obvious position shift may occur. In order to avoid such position, the target position data can be determined based on the predicted position data after the preset number of frames and the current position data of the current video frame. At this time, the data of the next video frame is mainly determined based on the data difference after multiple video frames, which can solve the shift phenomenon caused by the low synchronization position frame rate and achieve the effect of smooth motion transition.
[0069] For example, see Figure 3 , the data mentioned above corresponds to which frame, for example, 0 represents the current video frame, 1 represents the next video frame of the current video frame, and so on. The current synchronization position is the current position data of the target moving object in the current video frame. The time difference can be calculated based on the receiving timestamp of the received synchronization position data and the synchronization timestamp in the synchronization position data. The offset distance can be determined based on the product of the time difference and the preset movement speed of the target moving object. According to the offset distance and the position synchronization data in the synchronization position data, the alternative position data is obtained. According to the alternative position data and the position offset of each frame, the predicted position data of the tenth frame after the current video frame is obtained. According to the difference processing of the current position data and the predicted position data, the position data of the second frame, that is, the next frame after the current video frame, is obtained. The position data corresponds to the target display position of the target moving object.
[0070] The above method can be used to specifically determine the target display position, so that in the next video frame, the corresponding target moving object can be displayed based on the target display position.
[0071] On the basis of the above technical solution, it should also be noted that when the network delay is long, position jumps may occur. At this time, the solution provided by the embodiment of the present disclosure can be adopted to achieve the effect of smooth position transition of the target moving object in each video frame.
[0072] Here is an optional example:
[0073] See also Figure 4 After receiving the synchronization position data, the delay between the receiving timestamp of the synchronization position and the sending timestamp of the location synchronization data is relatively large. Accordingly, the determined candidate position data can be found in Figure 4100mm at the position. At this time, based on the position offset of 1mm for each video frame, the predicted position data after the preset number of frames is determined. For example, the predicted position data of the 10th frame after the current frame is 109. By using the difference processing method, it can be obtained that the target display position of the second frame is 10.9. At this time, the target display position is the display position of the target moving object in the second frame. The advantage of adopting the technical solution provided by the embodiment of the present disclosure is that, for scenes with poor network or long network delay, the target display position of the next video frame can still be determined relatively accurately and effectively, thereby achieving the effect of smooth transition of the target moving object in each video frame.
[0074] S140: Control the target moving object to be displayed at the target display position of the next video frame.
[0075] Specifically, the target object may be controlled to be displayed at the target display position in the next video frame.
[0076] Exemplarily, the application scenario is a game scenario, and the target moving object in the display interface is a bee. The movement of the bee in the horizontal direction can determine its position based on the technical solution provided in the embodiment of the present disclosure, and the movement information in the vertical direction can be adjusted according to the user's head movement. When the bee adjusts its position in the vertical direction according to the user's head movement, its target display position in the horizontal direction can be determined based on the technical solution provided in the embodiment of the present disclosure. According to the target display position and the position in the vertical direction, its final display position is obtained.
[0077] The technical solution provided by the embodiment of the present disclosure can determine alternative position data, that is, position data determined based on network delay, according to the synchronous position data and the current position data of the current video frame after receiving the synchronous position data sent by the server; then, according to the alternative position data, the predicted position data of a preset number of frames after the current video frame, and the current position data, the target display position of the next video frame can be determined, and the target object can be controlled to be displayed at the target display position of the next video frame, which solves the problem that the target display position is determined only according to the network delay in the prior art and cannot be applied to the situation where the network delay duration is unstable. It is achieved that under the condition of unstable network delay, the alternative position data can be determined first, and then the predicted position data can be determined based on the alternative position data, and then the target display position for display to the next video frame can be determined based on the predicted position data, so as to avoid the problem of repeated horizontal jumping of the target display position within a certain degree due to network delay, and achieve the technical effect of smooth transition of the target moving object in each video frame.
[0078] On the basis of the above-mentioned embodiment, in order to reduce resources and carry more users, that is, to adapt to the situation of wide area network, the position synchronization frame rate is usually set to be lower than the rendering frame rate. At this time, there may be a situation where a certain video frame does not receive the position synchronization data. In order to determine the target display position in this case, it can be:
[0079] The target display position of the next video frame is determined according to the current position data and the preset position offset of each frame.
[0080] It can be understood that the target display position can be obtained by adding the preset position offset per frame based on the current position data, and the target moving object can be displayed at the target display position in the next video frame.
[0081] It can be understood that, under the mechanism of low-frame data synchronization, based on the technical solution provided in the embodiment of the present disclosure, it can be determined that the position information seen by different users on the display interface is relatively consistent with the actual situation. For example, in a racing game scene, the speed and direction of the cars of two users are consistent, so the users see each other's car bodies also maintain the same body position, which improves the effect of the synchronized position gradually approaching the actual situation.
[0082] Based on the above technical solutions, it should be noted that if the predicted position data and the current position data are both two-dimensional data, the difference between the predicted position data and the current position data in each dimension is processed to determine the target display position of the next video frame.
[0083] It can be understood that, regardless of whether the target display position is a two-dimensional coordinate or a three-dimensional coordinate, the method provided by the embodiment of the present disclosure can be used to determine the candidate position data and the predicted position data, and then use the difference processing method in each dimension to determine the target display position of the target moving object in the next video frame. The above method improves the scalability of determining the target display position.
[0084] Figure 5 A schematic diagram of the structure of a video processing device provided by an embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the device includes: a synchronization data receiving module 410, an alternative position determining module 420, a display position determining module 430 and a target position display module 440.
[0085] Among them, the synchronization data receiving module 410 is used to receive the position synchronization data sent by the server; the alternative position determination module 420 is used to determine the alternative position data according to the position synchronization data; the display position determination module 430 is used to determine the target display position of the next video frame according to the alternative position data, the predicted position data of a preset number of frames after the current video frame, and the current position data of the target moving object in the current video frame; the target position display module 440 is used to control the target moving object to be displayed at the target display position of the next video frame.
[0086] On the basis of the above technical solution, the device further includes: a position synchronization frame rate configuration module, which is used to configure the position synchronization frame rate for the server, so that the server sends the position synchronization data based on the position synchronization frame rate.
[0087] On the basis of the above technical solution, the candidate position determination module is further used to determine the candidate position data according to the synchronization position information and synchronization timestamp in the position synchronization data and the receiving timestamp of the position synchronization data.
[0088] On the basis of the above technical solution, the candidate position determination module includes:
[0089] a difference determination unit, configured to determine a time difference based on a synchronization timestamp in the position synchronization data and a reception timestamp of receiving the position synchronization data;
[0090] an offset distance determining unit, configured to determine an offset distance based on the time difference and a moving speed of the target moving object;
[0091] The candidate position determining unit is used to determine the candidate position data based on the offset distance and the synchronization position information in the position synchronization data.
[0092] On the basis of the above technical solution, the target position display module includes:
[0093] A predicted position data determining unit, configured to determine predicted position data for a preset number of frames after a current video frame based on the candidate position data and a preset position offset for each frame;
[0094] The display unit is used to determine the target display position of the next video frame by processing the difference between the predicted position data and the current position data.
[0095] On the basis of the above technical solution, the display unit is used to process the difference between the predicted position data and the current position data in each dimension if the predicted position data and the current position data are two-dimensional data to determine the target display position of the next video frame.
[0096] Based on the above technical solution, the preset number of frames is determined according to the rendering time of each frame.
[0097] On the basis of the above technical solution, the device further comprises:
[0098] When the position synchronization data sent by the server is not received, the target display position of the next video frame is determined according to the current position data and the preset position offset of each frame.
[0099] Based on the above technical solution, the method is applied in a scenario of position synchronization of moving objects.
[0100] The technical solution provided by the embodiment of the present disclosure can determine alternative position data, that is, position data determined based on network delay, according to the synchronous position data and the current position data of the current video frame after receiving the synchronous position data sent by the server; then, according to the alternative position data, the predicted position data of a preset number of frames after the current video frame, and the current position data, the target display position of the next video frame can be determined, and the target object can be controlled to be displayed at the target display position of the next video frame, which solves the problem that the target display position is determined only according to the network delay in the prior art and cannot be applied to the situation where the network delay duration is unstable. It is achieved that under the condition of unstable network delay, the alternative position data can be determined first, and then the predicted position data can be determined based on the alternative position data, and then the target display position for display to the next video frame can be determined based on the predicted position data, so as to avoid the problem of repeated horizontal jumping of the target display position within a certain degree due to network delay, and achieve the technical effect of smooth transition of the target moving object in each video frame.
[0101] The video processing device provided in the embodiments of the present disclosure can execute the video processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0102] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0103] Figure 6 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 6 , which shows an electronic device (eg, Figure 6The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0104] like Figure 6 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0105] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0106] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0107] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0108] The electronic device provided by the embodiment of the present disclosure and the video processing method provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0109] The embodiments of the present disclosure provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the video processing method provided by the above embodiments is implemented.
[0110] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0111] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0112] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0113] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0114] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0115] Receive location synchronization data sent by the server;
[0116] Determining candidate position data according to the position synchronization data;
[0117] Determine a target display position of a next video frame according to the candidate position data, the predicted position data of a preset number of frames after the current video frame, and the current position data of the target moving object in the current video frame;
[0118] The target moving object is controlled to be displayed at a target display position of the next video frame.
[0119] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0120] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0121] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0122] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0123] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0124] According to one or more embodiments of the present disclosure, [Example 1] provides a video processing method, the method comprising:
[0125] Receive location synchronization data sent by the server;
[0126] Determining candidate position data according to the position synchronization data and current position data of the current video frame;
[0127] Determine a target display position of a next video frame according to the candidate position data, the predicted position data of a preset number of frames after the current video frame, and the current position data;
[0128] The target moving object is controlled to be displayed at the target display position of the next video frame.
[0129] According to one or more embodiments of the present disclosure, [Example 2] provides a video processing method, further comprising:
[0130] The position synchronization frame rate is configured for the server, so that the server sends the position synchronization data based on the position synchronization frame rate.
[0131] According to one or more embodiments of the present disclosure, [Example 3] provides a video processing method, further comprising:
[0132] Optionally, determining the candidate position data according to the position synchronization data and the current position data of the current video frame includes:
[0133] The candidate position data is determined according to the synchronization position information and synchronization timestamp in the position synchronization data, the current position data, and the receiving timestamp of the position synchronization data.
[0134] According to one or more embodiments of the present disclosure, [Example 4] provides a video processing method, further comprising:
[0135] Optionally, determining the candidate location data according to the synchronization location information and synchronization timestamp in the location synchronization data, the current location data, and a reception timestamp of receiving the location synchronization data includes:
[0136] Determining a time difference based on a synchronization timestamp in the position synchronization data and a reception timestamp of receiving the position synchronization data;
[0137] Determining offset position information based on the time difference and the moving speed of the target moving object;
[0138] The candidate position data is determined based on the offset position information and the synchronization position information in the position synchronization data.
[0139] According to one or more embodiments of the present disclosure, [Example 5] provides a video processing method, further comprising:
[0140] Optionally, determining the target display position of the next video frame according to the candidate position data, the predicted position data of a preset number of frames after the current video frame, and the current position data includes:
[0141] Determine predicted position data for a preset number of frames after the current video frame based on the candidate position data and the preset position offset for each frame;
[0142] The target display position of the next video frame is determined by processing the difference between the predicted position data and the current position data.
[0143] According to one or more embodiments of the present disclosure, [Example 6] provides a video processing method, further comprising:
[0144] Optionally, determining the target display position of the next video frame by processing the difference between the predicted position data and the current position data includes:
[0145] If the predicted position data and the current position data are two-dimensional data, the difference between the predicted position data and the current position data in each dimension is processed to determine the target display position of the next video frame.
[0146] According to one or more embodiments of the present disclosure, [Example 7] provides a video processing method, further comprising:
[0147] Optionally, the preset number of frames is determined according to the rendering duration of each frame.
[0148] According to one or more embodiments of the present disclosure, [Example 8] provides a video processing method, further comprising:
[0149] Optionally, when the position synchronization data sent by the server is not received, the target display position of the next video frame is determined according to the current position data and a preset position offset for each frame.
[0150] According to one or more embodiments of the present disclosure, [Example 9] provides a video processing method, further comprising:
[0151] Optionally, the method is applied in a scenario of position synchronization of moving objects.
[0152] According to one or more embodiments of the present disclosure, [Example 3] provides a video processing device, the device comprising: a synchronization data receiving module, configured to receive location synchronization data sent by a server;
[0153] An alternative position determination module, used to determine the alternative position data according to the position synchronization data and the current position data of the current video frame;
[0154] A display position determination module, configured to determine a target display position of a next video frame according to the candidate position data, the predicted position data of a preset number of frames after the current video frame, and the current position data;
[0155] The target position display module is used to control the target moving object to be displayed at the target display position of the next video frame.
[0156] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0157] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0158] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A video processing method, characterized in that: include: Receive location synchronization data sent by the server; Determining candidate location data according to the location synchronization data specifically includes: determining the candidate location data according to synchronization location information and synchronization timestamp in the location synchronization data and a receiving timestamp of receiving the location synchronization data; Determining a target display position of a next video frame according to the candidate position data, the predicted position data of a preset number of frames after the current video frame, and the current position data of the target moving object in the current video frame, wherein the predicted position data is determined based on the candidate position data and the preset number of frames; The target moving object is controlled to be displayed at a target display position of the next video frame.
2. The method according to claim 1, characterized in that Also includes: The position synchronization frame rate is configured for the server, so that the server sends the position synchronization data based on the position synchronization frame rate.
3. The method according to claim 1, characterized in that The determining the candidate position data according to the synchronization position information and the synchronization timestamp in the position synchronization data and the receiving timestamp of the position synchronization data comprises: Determining a time difference based on a synchronization timestamp in the position synchronization data and a reception timestamp of receiving the position synchronization data; Determine an offset distance based on the time difference and the moving speed of the target moving object; The candidate position data is determined based on the offset distance and the synchronization position information in the position synchronization data.
4. The method according to claim 1, characterized in that The step of determining a target display position of a next video frame according to the candidate position data, the predicted position data of a preset number of frames after the current video frame, and the current position data of the target moving object in the current video frame includes: Determine predicted position data for a preset number of frames after the current video frame based on the candidate position data and the preset position offset for each frame; The target display position of the next video frame is determined by processing the difference between the predicted position data and the current position data.
5. The method according to claim 4, characterized in that The step of determining a target display position of a next video frame by processing a difference between the predicted position data and the current position data comprises: If the predicted position data and the current position data are both two-dimensional data, the difference between the predicted position data and the current position data in each dimension is processed to determine the target display position of the target moving object in the next video frame.
6. The method according to claim 1, characterized in that The preset number of frames is determined according to the rendering duration of each frame.
7. The method according to claim 1, characterized in that Also includes: When the position synchronization data sent by the server is not received, the target display position of the next video frame is determined according to the current position data and the preset position offset of each frame.
8. The method according to any one of claims 1 to 7, characterized in that: The method is applied in a scenario of position synchronization of moving objects.
9. A video processing device, characterized in that: include: A synchronization data receiving module, used to receive location synchronization data sent by the server; The candidate position determination module is used to determine the candidate position data according to the position synchronization data and the current position data of the current video frame, specifically including: determining the candidate position data according to the synchronization position information and synchronization timestamp in the position synchronization data and the receiving timestamp of the position synchronization data; a display position determination module, configured to determine a target display position of a next video frame according to the candidate position data, the predicted position data of a preset number of frames after the current video frame, and the current position data of the target moving object in the current video frame, wherein the predicted position data is determined based on the candidate position data and the preset number of frames; The target position display module is used to control the target moving object to be displayed at the target display position of the next video frame.
10. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the video processing method as described in any one of claims 1-8.
11. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the video processing method according to any one of claims 1 to 8 when executed by a computer processor.
Citation Information
Patent Citations
Collision synchronization method, client, and storage medium
CN108540454A
Position synchronization method in network game
CN109381858A
