Video playing method and device, electronic equipment and storage medium

By using shared memory blocks between the PC video player and the client, the problems of poor video playback and high CPU usage in the prior art are solved, and a more efficient and stable video playback experience is achieved.

CN119450143APending Publication Date: 2025-02-14GUANGZHOU HUYA INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411381162.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The existing PC video playback technology has problems such as high CPU usage, poor video playback or large delay, affecting client performance and stability, and relying on browser compatibility and performance.

Method used

By creating a shared memory block between the video player and the client, the video player decodes the video stream and writes it to the shared memory block, the client renders the video stream directly from the shared memory block, reducing IO operations and memory copying.

Benefits of technology

It improves the performance and stability of the PC video player, reduces delay and performance overhead, ensures the smoothness of video playback, and improves the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119450143A_ABST
    Figure CN119450143A_ABST
Patent Text Reader

Abstract

The invention provides a video playing method and device, electronic equipment and a storage medium, and relates to the technical field of video playing. The method comprises the following steps: after a video player is started by a client, creating a shared memory block based on configuration information of a to-be-played video from the client; the video player obtains a video stream of the video to be played according to the configuration information, decodes the video stream to obtain a decoded video stream, and writes the decoded video stream into a shared memory block; and the client accesses the shared memory block and renders the decoded video stream to play the to-be-played video, so that additional IO operation or memory copying is not needed, time delay and performance overhead are reduced, and the performance and stability of the PC end video player are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video playback, and in particular to a video playback method, device, electronic equipment and storage medium. Background Art

[0002] Existing PC (Personal Computer) end video playback technologies are generally divided into three types: "multi-process architecture player", "embedded video player" and "browser plug-in player".

[0003] "Multi-process architecture player" separates the video player and the client into different processes, but usually uses traditional inter-process communication technologies such as pipes and message queues for data transmission. It requires IO (Input / Output) communication, which leads to high CPU (Central Processing Unit) occupancy and may cause the video playback to be unsmooth or have large delays.

[0004] "Embedded video player" is to integrate the video player directly into the client, and perform video decoding and rendering through the same process. Although it is simple to implement, it is very easy to affect the performance and stability of the client.

[0005] "Browser plug-in player" uses browser plug-ins to achieve video playback, but this solution relies on the compatibility and performance of the browser, is not suitable for all PC client scenarios, and is easily restricted by browser security policies.

[0006] Therefore, how to improve the performance and stability of PC video players is a technical problem that needs to be solved at present. Summary of the invention

[0007] The present invention provides a video playing method, device, electronic device and computer-readable storage medium, which can improve the performance and stability of a PC-side video player.

[0008] The technical solution of the present invention can be implemented as follows:

[0009] In a first aspect, the present invention provides a video playback method, which is applied to an electronic device, wherein the electronic device is deployed with a client and a video player running in different processes, and the method comprises:

[0010] After being started by the client, the video player creates a shared memory block based on the configuration information of the video to be played from the client;

[0011] The video player obtains the video stream of the video to be played according to the configuration information, decodes the video stream, obtains the decoded video stream and writes it into the shared memory block;

[0012] The client accesses the shared memory block and renders the decoded video stream to play the video to be played.

[0013] Optionally, the configuration information includes a media file address of the video to be played, and the step of the video player creating a shared memory block based on the configuration information of the video to be played from the client includes:

[0014] Obtaining the media file of the video to be played according to the media file address;

[0015] The shared memory block is created according to the width and height information of the media file.

[0016] Optionally, the video stream includes multiple video frames, the decoded video stream includes multiple decoded video frames, and the video player decodes the video stream to obtain the decoded video stream and writes it into the shared memory block, including:

[0017] Obtain all frames to be decoded from the multiple video frames according to the decoding frame rate at the current moment;

[0018] For any of the frames to be decoded, if the frame to be decoded is a repeated frame, skip the frame to be decoded;

[0019] If the frame to be decoded is not a repeated frame, decoding the frame to be decoded to obtain a decoded video frame;

[0020] Traversing all the frames to be decoded, writing all the decoded video frames obtained into the shared memory block, and returning to the step of obtaining all the frames to be decoded at the current moment according to the decoding frame rate at the current moment at the next moment, until there are no video frames in the video stream that are not used as frames to be decoded.

[0021] Optionally, the method further includes a step in which the video player adjusts the decoding frame rate, which includes:

[0022] If the current moment is separated from the last adjustment moment by a preset time, the decoding frame rate is adjusted according to the system resources and video playback status of the electronic device at the current moment.

[0023] Optionally, the decoded video stream includes a plurality of decoded video frames, and the client accesses the shared memory block, and the step of rendering the decoded video stream includes:

[0024] According to the rendering frame rate at the current moment, all frames to be rendered are obtained from the multiple decoded video frames;

[0025] Render all the frames to be rendered, and return to the step of obtaining all the frames to be rendered from the shared memory block according to the rendering frame rate at the current moment at the next moment, until all the decoded video frames are rendered as frames to be rendered.

[0026] Optionally, the method further includes a step in which the client adjusts the rendering frame rate, which includes:

[0027] If the current moment is separated from the last adjustment moment by a preset time, the rendering frame rate is adjusted according to the system resources and video playback status of the electronic device at the current moment.

[0028] Optionally, the method further comprises:

[0029] When the video to be played is finished or a closing request sent by the client is received, the video player closes and releases the shared memory block;

[0030] If the video player is not started again by the client within a preset time, the process in which the video player is located is terminated.

[0031] In a second aspect, the present invention provides a video playback device, applied to a client, the device comprising a client and a video player;

[0032] The video player is used to create a shared memory block based on the configuration information of the video to be played from the client after being started by the client; obtain the video stream of the video to be played according to the configuration information, decode the video stream, obtain the decoded video stream and write it into the shared memory block;

[0033] The client is used to access the shared memory block and render the decoded video stream to play the video to be played.

[0034] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the video playback method as described in the first aspect is implemented.

[0035] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the video playback method as described in the first aspect.

[0036] Compared with the prior art, the video playback method provided by the present invention is that after the video player is started by the client, a shared memory block is created based on the configuration information of the video to be played from the client; the video player obtains the video stream of the video to be played according to the configuration information, decodes the video stream, obtains the decoded video stream and writes it into the shared memory block; the client accesses the shared memory block, renders the decoded video stream, and plays the video to be played. Since the present invention uses a shared memory block that can be directly accessed by both the video player and the client, the video player directly writes the decoded video frame into the shared memory block, and the client directly accesses the shared memory block and renders the decoded video frame, without the need for additional IO operations or memory copies, reducing delays and performance overhead, thereby improving the performance and stability of the PC-side video player.

[0037] Other features and advantages disclosed in the present invention will be described in the following description, or some features and advantages can be inferred or determined without doubt from the description, or can be learned by implementing the above-mentioned technology disclosed in the present invention.

[0038] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0040] Figure 1 A schematic diagram of a flow chart of a video playback method provided by an embodiment of the present invention;

[0041] Figure 2 A schematic diagram of a process of decoding a video stream by a video player provided by an embodiment of the present invention;

[0042] Figure 3 A schematic diagram of a process of rendering a video stream by a client provided in an embodiment of the present invention;

[0043] Figure 4 A schematic diagram of a video playback process provided by an embodiment of the present invention;

[0044] Figure 5 A functional unit block diagram of a video playback device provided by an embodiment of the present invention;

[0045] Figure 6 A schematic block diagram of the structure of an electronic device provided by an embodiment of the present invention.

[0046] Icon: 100 - video playback device; 101 - video player; 102 - client; 200 - electronic device; 210 - memory; 220 - processor. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0048] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0050] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0051] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.

[0052] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.

[0053] In order to improve the performance and stability of a PC-side video player, the present invention provides a video playback method, which will be described in detail below.

[0054] Please refer to Figure 1 , the video playing method includes steps S101 to S103.

[0055] S101, after being started by a client, the video player creates a shared memory block based on configuration information of the video to be played from the client.

[0056] The client and the video player are running in different processes. The client sends a request to the video player to start the process where the video player is located.

[0057] After starting the process where the video player is located, the client establishes a pipeline for communicating with the video player. In the embodiment of the present invention, in order to reduce network overhead and transmission delay, the channel created by the client transmits the configuration information of the video to be played (such as the media file address and sound configuration), and does not transmit the resource image of the video to be played.

[0058] The client transmits the configuration information of the video to be played to the process where the video player is located through the above-mentioned pipeline. After receiving the configuration information of the video to be played, the video player first obtains the media file of the video to be played according to the media file address of the video to be played included in the configuration information; then, creates a shared memory block according to the width and height information of the media file.

[0059] The width and height information of a media file usually refers to the horizontal and vertical dimensions of the file in pixels. This applies to pictures, videos, and certain types of graphic files. For example, the dimensions of a picture may be 1920 pixels wide and 1080 pixels high, usually expressed as 1920x1080. These dimensions determine the display size of the file on the screen, as well as the physical size when printed (depending on the print resolution).

[0060] The video player opens the media file of the video to be played, reads its width and height information, and builds a shared memory block based on the width and height of the media file, involving virtual memory, shared files, process shared memory blocks, and fixed shared memory block size.

[0061] Among them, virtual memory is a computer memory management technology that integrates physical memory and hard disk storage for use by applications. By establishing a memory page table, virtual memory allows different processes to have their own independent address space.

[0062] Shared files are an important mechanism under virtual memory management. Through memory-mapped files, multiple processes can map the same file into their own address spaces, thereby achieving shared access to the same physical memory.

[0063] The video player and the client map the same file to their respective address spaces through memory-mapped files, thereby sharing the same physical memory. Since this memory is shared, after the video player writes the image data to the shared memory block, the client can immediately read and render it without additional IO operations or memory copies. This greatly reduces the overhead of memory copying and communication, and improves playback efficiency and system stability.

[0064] When playing the same media file, the size of the shared memory block is fixed to ensure the correctness of drawing the image. When you need to play another video with different width and height, you need to release the old shared memory block and reapply for a new one.

[0065] After the video player completes receiving the configuration information and building the shared memory block, it returns a ready message to the client. After receiving the ready message, the client sends a command to the video player to start playing the video.

[0066] S102, the video player obtains the video stream of the video to be played according to the configuration information, decodes the video stream, obtains the decoded video stream and writes it into the shared memory block.

[0067] When the video player receives a command to start playing a video, it reads the video stream of the video to be played from the media file of the video to be played obtained according to the media file address of the video to be played included in the configuration information, and Figure 2 The following steps S201 to S204 are shown to perform video decoding.

[0068] S201, acquiring all frames to be decoded from a plurality of video frames included in a video stream according to a decoding frame rate at a current moment.

[0069] The decoding frame rate refers to the number of video frames decoded per unit time. For example, if the decoding frame rate is N frames / second, N video frames are decoded per second.

[0070] S202: For any frame to be decoded, if the frame to be decoded is a frame to be decoded, skip the frame to be decoded.

[0071] The repeated frame refers to a video frame that is slightly different from the previous video frames within a certain range, or a repeated video frame.

[0072] For any frame to be decoded at the current moment, if the video player recognizes that it is a repeated frame, it will not decode the frame to be decoded, but directly skip the frame to be decoded and enter the processing process of the next frame to be decoded.

[0073] S203: If the frame to be decoded is not a repeated frame, decode the frame to be decoded to obtain a decoded video frame.

[0074] For any frame to be decoded at the current moment, if the video player recognizes that it is not a repeated frame, it is necessary to decode the frame to be decoded to obtain a decoded video frame.

[0075] After traversing all frames to be decoded, step S203 is executed.

[0076] S204, writing all obtained decoded video frames into a shared memory block.

[0077] It can be understood that the video player executes steps S202 to S203 for each video frame to be decoded at the current moment, and writes all obtained decoded video frames into the shared memory block.

[0078] After the video player writes all the decoded video frames obtained at the current moment into the shared memory block, it needs to determine whether there are any video frames in the video stream that have not been used as frames to be decoded. If not, the decoding is terminated. If so, at the next moment, it returns to step 201 and executes the above steps S201 to S204 again.

[0079] It can be understood that the decoded video stream includes decoded video frames obtained at each moment.

[0080] In order to further improve the decoding efficiency, the video stream of the video to be played can be decoded in parallel in a multi-threaded manner.

[0081] In the embodiment of the present invention, the decoding frame rate is adjusted dynamically, that is, the decoding frame rate at different times is different, and the video player adjusts its own IO pressure by dynamically adjusting the decoding frame rate.

[0082] The process of the video player adjusting the decoding frame rate may be that if the current moment is separated from the last adjustment moment by a preset time, the decoding frame rate is adjusted according to the system resources of the electronic device and the video playing status at the current moment.

[0083] The system resources of the electronic device include CPU and memory resources, and the video playback status refers to the smoothness and delay of the video being played. If the CPU and memory resources are consumed too much and / or the video being played is not smooth or has a long delay, the decoding frame rate needs to be reduced. If the CPU and memory resources are consumed less and the video being played is smooth and has a short delay, the decoding frame rate can be increased.

[0084] S103, the client accesses the shared memory block and renders the decoded video stream to play the video to be played.

[0085] After the client sends a command to the video player to start playing the video, Figure 3 The following steps S301 to S302 are shown for video rendering.

[0086] S301, obtaining all frames to be rendered from multiple decoded video frames according to the rendering frame rate at the current moment.

[0087] The rendering frame rate refers to the number of decoded video frames rendered per unit time. For example, if the rendering frame rate is N frames / second, N decoded video frames are decoded per second.

[0088] S302, rendering all frames to be rendered, and returning to the step of obtaining all frames to be rendered from the shared memory block according to the rendering frame rate at the current moment at the next moment, until all decoded video frames are rendered as frames to be rendered.

[0089] After rendering the frame to be rendered read from the shared memory block at the current moment, the client needs to determine whether there are any unrendered decoded video frames in the shared memory block. If not, the rendering is terminated. If so, at the next moment, return to step 301 and execute the above steps S201 to S302 again.

[0090] In the embodiment of the present invention, the rendering frame rate is adjusted dynamically, that is, the rendering frame rate at different times is different. The client can maintain the smoothness of playback when resources are tight by dynamically adjusting the rendering frame rate.

[0091] The process of adjusting the rendering frame rate by the client may be to adjust the rendering frame rate according to the system resources and video playback status of the electronic device at the current moment if the current moment is separated from the last adjustment moment by a preset time.

[0092] The system resources of the electronic device include CPU and memory resources, and the video playback status refers to the smoothness and latency of the video being played. If the CPU and memory resources are consumed too much and / or the video being played is not smooth or has a long latency, the rendering frame rate needs to be reduced. If the CPU and memory resources are consumed less and the video being played is smooth and has a short latency, the rendering frame rate can be increased.

[0093] The decoding frame rate is related to the number of decoded video frames written by the video player to the shared memory block at each moment, and the rendering frame rate is related to the number of frames to be rendered read by the client from the shared memory block at each moment. It can be understood that in order to achieve that as soon as the video player writes the decoded video frame to the shared memory block, the client can immediately read the decoded video frame from the shared memory block for rendering, and the rendering frame rate can be kept consistent with the decoding frame rate.

[0094] The data transmission process of the video playback method provided by the above embodiment of the present invention is as follows Figure 4As shown, the video stream in the media file of the video to be played is decoded by the video player, and the video player writes the decoded video stream into the shared memory block. The client reads the decoded video stream from the shared memory block for rendering, thereby playing the video to be played.

[0095] In addition, the video player closes and releases the shared memory block when the video to be played is finished or a closing request is received from the client. If the video player is not started again by the client within a preset time, the process in which it is located is terminated.

[0096] Understandably, the video player does not exit immediately after closing, but stays for a while. If no new playback request arrives during this period, all memory is released and the process is terminated to ensure the effective use and recycling of system resources.

[0097] The following uses advertisement video data as an example to illustrate the implementation process of the above video playback method.

[0098] Among them, the video player described in the above embodiments is an advertisement player in this example, and the video to be played described in the above embodiments is an advertisement to be played in this example.

[0099] The client initiates a request to the ad player to start the ad player process. The client establishes a communication channel for transmitting the media file address and sound configuration information of the ad to be played. In order to reduce network overhead and transmission delay, the communication channel does not transmit the resource image of the ad to be played.

[0100] The client transmits the media file address and sound configuration information of the advertisement to be played to the advertisement player through the communication channel.

[0101] The advertisement player opens the media file of the advertisement to be played according to the media file address of the advertisement to be played, reads the width and height information of the media file, and constructs a shared memory block according to the width and height information of the media file.

[0102] After establishing the shared memory block, the ad player returns a ready message to the client.

[0103] After receiving the ready information returned by the client, the client sends a command to the advertisement player to start playing the advertisement.

[0104] The ad player decodes the video stream of the ad to be played at the background according to the set decoding frame rate, and writes the obtained decoded video frames into the shared memory block.

[0105] During the decoding process, for video frames that may be repeated or have very little change in the video stream, the ad player can skip these video frames and not decode them, thereby improving decoding efficiency while maintaining video quality.

[0106] The ad player can also dynamically adjust the decoding frame rate according to the current system resources and ad playback status, and take advantage of the multi-core CPU to perform parallel decoding through multi-threading.

[0107] When the ad player writes the decoded video frame into the shared memory block, the client synchronously reads the decoded video frame written into the shared memory block by the ad player, and renders it according to the set rendering frame rate to realize the ad playback.

[0108] During the rendering process, the client can dynamically adjust the rendering frame rate based on current system resources and ad playback conditions to ensure that ad playback remains smooth when resources are tight.

[0109] When the advertisement to be played is finished or a closing request is received from the client, the advertisement player releases the shared memory block created for the advertisement to be played.

[0110] After closing, the ad player waits for a period of time. If no new playback request is received from the client during this period of time, all shared memory blocks are released and the process is terminated to ensure the effective use and recycling of system resources.

[0111] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0112] (1) The video player writes the decoded video frames directly into the shared memory block, and the client directly accesses the shared memory block and renders the decoded video frames without the need for additional IO operations or memory copies, thus reducing latency and performance overhead.

[0113] (2) As soon as the video player writes the decoded video frame to the shared memory block, the client can immediately read the decoded video frame from the shared memory block for rendering. This real-time performance ensures smooth video playback without any freezes or delays;

[0114] (3) The video player and the client run in different processes, which can prevent the entire client from being affected by an error in the video player. If the video player crashes, the client can still run stably and only needs to restart the video player. Different processes manage their resources independently, avoiding competition and conflicts caused by shared resources, thereby improving the stability and reliability of the system. By using shared memory blocks, the two processes do not need to maintain redundant data separately, saving memory space and improving memory utilization.

[0115] (4) The video player skips repeated frames during decoding, reducing unnecessary decoding operations and lowering the CPU burden during the decoding process. In addition, the video player further optimizes resource usage by using multi-threading and dynamically adjusting the decoding frame rate;

[0116] (5) The video player continues to stay for a while after the video ends to respond to possible new requests from the client, avoiding resource waste caused by frequent creation and destruction of processes. The memory is released and the process is terminated only when there are no new requests, further improving resource utilization.

[0117] In order to execute the corresponding steps in the above method embodiment and various possible implementations, an implementation of the video playback device 100 is provided below.

[0118] Please refer to Figure 5 , the video playing device 100 includes a video player 101 and a client 102 .

[0119] The video player 101 is used to create a shared memory block based on the configuration information of the video to be played from the client after being started by the client 102; obtain the video stream of the video to be played according to the configuration information, decode the video stream, obtain the decoded video stream and write it into the shared memory block;

[0120] The client 102 is used to access the shared memory block and render the decoded video stream to play the video to be played.

[0121] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the video playback device 100 described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0122] Furthermore, the embodiment of the present invention also provides an electronic device 200, please refer to Figure 6 , the electronic device 200 may include a memory 210 and a processor 220 .

[0123] Among them, the processor 220 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the program execution of the video playback method provided by the above method embodiment.

[0124] The memory 210 may be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 210 may exist independently and be connected to the processor 220 via a communication bus. The memory 210 may also be integrated with the processor 220. Among them, the memory 210 is used to store machine executable instructions for executing the scheme of the present invention. The processor 220 is used to execute the machine executable instructions stored in the memory 210 to implement the above-mentioned method embodiment.

[0125] An embodiment of the present invention further provides a computer-readable storage medium containing a computer program. When the computer program is executed, it can be used to perform relevant operations in the video playback method provided by the above method embodiment.

[0126] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A video playback method, characterized in that: Applied to an electronic device, the electronic device is deployed with a client and a video player running in different processes, the method includes: After being started by the client, the video player creates a shared memory block based on the configuration information of the video to be played from the client; The video player obtains the video stream of the video to be played according to the configuration information, decodes the video stream, obtains the decoded video stream and writes it into the shared memory block; The client accesses the shared memory block and renders the decoded video stream to play the video to be played.

2. The method according to claim 1, characterized in that The configuration information includes the media file address of the video to be played, and the step of the video player creating a shared memory block based on the configuration information of the video to be played from the client includes: Obtaining the media file of the video to be played according to the media file address; The shared memory block is created according to the width and height information of the media file.

3. The method according to claim 1, characterized in that The video stream includes a plurality of video frames, the decoded video stream includes a plurality of decoded video frames, and the video player decodes the video stream, obtains the decoded video stream, and writes the decoded video stream into the shared memory block, comprising: Obtain all frames to be decoded from the multiple video frames according to the decoding frame rate at the current moment; For any of the frames to be decoded, if the frame to be decoded is a repeated frame, skip the frame to be decoded; If the frame to be decoded is not a repeated frame, decoding the frame to be decoded to obtain a decoded video frame; Traversing all the frames to be decoded, writing all the decoded video frames obtained into the shared memory block, and returning to the step of obtaining all the frames to be decoded at the current moment according to the decoding frame rate at the current moment at the next moment, until there are no video frames in the video stream that are not used as frames to be decoded.

4. The method according to claim 3, characterized in that The method further includes a step in which the video player adjusts the decoding frame rate, which includes: If the current time is separated from the last adjustment time by a preset time, the decoding frame rate is adjusted according to the system resources of the electronic device at the current time.

5. The method according to claim 1, characterized in that The decoded video stream includes a plurality of decoded video frames, and the client accesses the shared memory block. The step of rendering the decoded video stream includes: According to the rendering frame rate at the current moment, all frames to be rendered are obtained from the multiple decoded video frames; Render all the frames to be rendered, and return to the step of obtaining all the frames to be rendered from the shared memory block according to the rendering frame rate at the current moment at the next moment, until all the decoded video frames are rendered as frames to be rendered.

6. The method according to claim 5, characterized in that The method further includes a step in which the client adjusts the rendering frame rate, which includes: If the current moment is separated from the last adjustment moment by a preset time, the rendering frame rate is adjusted according to the system resources and video playback status of the electronic device at the current moment.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: When the video to be played is finished or a closing request sent by the client is received, the video player closes and releases the shared memory block; If the video player is not started again by the client within a preset time, the process in which the video player is located is terminated.

8. A video playback device, characterized in that: Applied to a client, the device comprises a client and a video player; The video player is used to, after being started by the client, create a shared memory block based on the configuration information of the video to be played from the client; obtain the video stream of the video to be played according to the configuration information, decode the video stream, obtain the decoded video stream and write it into the shared memory block; The client is used to access the shared memory block and render the decoded video stream to play the video to be played.

9. An electronic device, characterized in that: It includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the video playback method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the video playback method as described in any one of claims 1 to 7.